From the Python documentation:
* NotImplemented: "Special value which can be returned by the 'rich comparison'
special methods (__eq__(), __lt__(), and friends), to indicate that the
comparison is not implemented with respect to the other type."
* NotImplementedError: "This exception is derived from RuntimeError. In user
defined base classes, abstract methods should raise this exception when they
require derived classes to override the method."
Make sure all Python code in the repo specifies which exceptions to
catch when using `except:`.
Regressions can be catched using `flake8-blind-except` going forward.
* E101: indentation contains mixed spaces and tabs
* E111: indentation is not a multiple of four
* E128: continuation line under-indented for visual indent
* E302: expected 2 blank lines, found 1
* W191: indentation contains tabs
https://github.com/apple/swift-corelibs-xctest/pull/43 introduces
a dependency between XCTest and Foundation. Modify the build script
in order to properly build all products:
- Build Foundation before XCTest, then link Foundation when building
XCTest by using new '--foundation-build-dir' option.
- Link Foundation when testing SwiftPM by using new '--foundation'
option.
- On Linux, ensure Foundation is built when XCTest is.
The repo contains roughly 80 Python scripts. "snake_case" naming is used for
local variables in all those scripts. This is the form recommended by the PEP 8
naming recommendations (Python Software Foundation) and typically associated
with idiomatic Python code.
However, in nine of the 80 scripts there were at least one instance of
"camelCase" naming prior to this commit.
This commit improves consistency in the Python code base by making sure that
these nine remaining files follow the variable naming convention used for
Python code in the project.
References:
* PEP 8: https://www.python.org/dev/peps/pep-0008/
* pep8-naming: https://pypi.python.org/pypi/pep8-naming
Prior to https://github.com/apple/swift-corelibs-xctest/pull/57 and
https://github.com/apple/swift-corelibs-xctest/pull/58, the
swift-corelibs-xctest build script did not provide a way an already
built XCTest.so to be tested or installed. As a result, the Swift
build script would build XCTest several times.
For example, the following invocation would build XCTest three separate
times:
```
$ utils/build-script --xctest --test -- --install-xctest
```
Modifications to the XCTest build script now allow a prebuilt XCTest to
be tested (via the `build_script.py test` subcommmand) and installed
(via the `build_script.py install` subcommand). Use these in the Swift
build script to build XCTest only once, then test and install the built
version.
Also, explicitly disable XCTest installation on OS X. XCTest's
`build_script.py` only supports non-Darwin platforms, so running
`utils/build-script --xctest -- --install-xctest` on OS X used to cause
the build script to fail because of how that script invokes `swiftc`.
It now fails with an explicit error indicating `--install-xctest` is
unsupported.
I am going to use the link job for limiting swift lto compile time.
The reason not to use the same variables as LLVM (i.e. LLVM_PARALLEL_LINK_JOBS)
is that Swift since it is compiling more IR may have a larger memory
representation implying less parallel linking jobs than LLVM can be used on
bots.
http://public.kitware.com/pipermail/cmake-developers/2015-November/026993.html
We check for this in build-script-impl and if you are running such a version,
special flags are passed in to work around the issue. If you do not have this verison of cmake, this change should not affect you in any way.
This will be fixed in cmake 3.4.1.