Commit Graph

101 Commits

Author SHA1 Message Date
Michael Gottesman
ad3e05d82e [build-script] Add support for building the compiler with sanitizer coverage so we can make libFuzzer based fuzzers for swift compiler tools. 2018-05-02 17:39:18 -07:00
Michael Gottesman
e071e46068 Add build-script flag --enable-exclusivity-checking to enable exclusivity checking always when we compile stdlibCore.
It is off by default.

rdar://39335800
2018-04-11 09:23:06 -07:00
Michael Gottesman
e567bc9028 [+0-all-args] Enable +0 normal arguments.
rdar://34222540
2018-03-19 20:25:31 -07:00
Jacob Mizraji
68f9659775 Start passing libtool to CMake
This will align the libtool passed to CMake with the clang and clang++
2018-02-05 11:23:37 -08:00
Michael Gottesman
8c0908aac5 [cmake][build-script] Add support for building the runtime with +0 normal args.
I am upstreaming some changes to the runtime to support +0 normal arguments.

rdar://34222540
2017-12-30 21:58:25 -05:00
Michael Gottesman
aa4e2dac2c [build-script] Add support for compiling swift with leaks sanitizer.
This only enables the swift compiler (not its output) to be used with leaks
sanitizer on linux.

Some important notes: On Linux, right now we are not completely leak clean. I
was only able to get a -Onone build of the stdlib without triggering lsan (I was
unable to run the optimizer and the tests successfully). Additionally even at
-Onone, I had to suppress some leaks in the driver. The point of this though is
to prevent any further -Onone leaks from being committed to the tree since
-Onone leaks that are not bounded (unlike the driver bugs) could cause SourceKit
to leak memory. Since SourceKit is a long running process... such a type of leak
would be bad.

rdar://32876901
2017-06-22 12:52:12 -07:00
Mishal Shah
f1c3629246 Revert "python: Fix nosetests tests." 2017-04-06 18:51:50 -07:00
Doug Coleman
c0b7918099 python: Fix nosetests tests.
Why are the python reasons for having our code nested in a directory
called ``swift_build_support.swift_build_support/`` instead of simply
``swift_build_support/``? Is that what we really want here?
2017-04-06 17:47:09 -07:00
Jacob Mizraji
2647ca2f84 Pass CLANG_VERSION_* cmake flags to the LLVM build.
In a normal swiftless clang build, if it doesnt know CLANG_VERSION_*,
clang's cmake falls back on LLVM_VERSION_*. We pass a CLANG_COMPILER_VERSION
to swift, but it is not necessarily what clang wants to know.

The intention of this CLANG_VERSION_* flag in Clang is to know
what Swift calls clang_user_visible_version. This is the non-specific
version of Clang. For example, clang-900 - this is 9.0.0, while Swift
would like clang_compiler_version to be the specific version that the
driver will print out.

Flag naming!

Fix tests
2017-03-29 15:57:06 -07:00
Michael Gottesman
912a162e57 [build-script] Give ubsan, tsan the same treatment I gave asan in 824ffa6857. 2017-03-26 20:07:14 -07:00
Hugh Bellamy
8671854674 Properly python lint remaining files 2017-03-23 14:06:46 +07:00
Doug Coleman
e7390d1770 Revert "utils: Add swiftenvs, which allow the overriding of compiler tools."
This reverts commit 2b923f3846.
2017-03-22 20:09:34 -07:00
Doug Coleman
e480227d82 Revert "swiftenv-script: Fix some issues with swiftenvs." 2017-03-22 17:00:21 -07:00
Doug Coleman
351a515f6c swiftenv-script: Bug fixes for swiftenv.
Fix the mocked output files of swiftc. Change the lookup of
clang from build-script to build-script-impl like all the other
commands. Pass more args to LLVM. Fix swiftenv creation. Fix unit tests.

The reason this patch works is that build-script-impl gets
all the arguments that are not handled by build-script.
2017-03-22 12:47:33 -07:00
Doug Coleman
2b923f3846 utils: Add swiftenvs, which allow the overriding of compiler tools. 2017-03-21 14:59:12 -07:00
Mishal Shah
dd9c81c965 Revert "Integrate python-lint into validation tests" 2017-03-21 12:24:46 -07:00
Hugh Bellamy
639c0beec7 Get python-lint build clean 2017-03-21 20:21:43 +07:00
Michael Gottesman
824ffa6857 [build-script] When building with asan, mangle asan into the build subdirectory name.
Today, when you enable ASAN, build-script just reconfigures your normal build
directory to use ASAN. This forces you to recompile LLVM and Swift with ASAN
enabled and then (once you have finished using ASAN) to recompile LLVm/Swift
without ASAN.

By using a different build-directory, one still has to (potentially) recompile
LLVM/Swift, but one's original directory has not become invalidated. Thus when
you switch back to a normal build, one does not have to recompile LLVM and
(potentially) Swift!
2017-03-17 18:44:48 -07:00
Hugh Bellamy
fa3543d3c5 Fix some pylint errors for double whitespace after class/function 2017-02-17 15:37:19 +07:00
Michael Gottesman
fee2db81de [cmake] Add a new option called SWIFT_FORCE_OPTIMIZED_TYPECHECKER that forces Sema to be built optimized.
This should help speed up people trying to compile the standard library and do
SILGen work. *NOTE* This will not necessarily result in a type checker that is
as fast as a release build since most likely the type checker will use some
link_once odr functions that are debug. But it should still be significantly
faster otherwise.

This makes getting to SILGen take 16 seconds on my machine instead of forever
when compiling with everything else in the compiler in debug mode.
2017-02-05 16:48:54 -08:00
Doug Coleman
1f0baffb93 utils/.../ninja.py: Support CXX for ninja builds on Linux.
Without this fix, on Linux, passing --build-ninja looks for g++
and fails to build on the CI.
2017-01-12 16:15:58 -08:00
practicalswift
4a50e7ba9f [gardening] PEP-8 fixes 2017-01-07 21:09:49 +01:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Michael Gottesman
d81be870bc [semantic-sil] When compiling with sil ownership disabled, explicitly disable it.
Otherwise, when one switches from compiling with a semantic sil enabled build to
a normal build, one is still compiling with semantic-sil enabled.
2017-01-04 15:21:30 -08:00
Doug Coleman
51543db9e1 swift_build_support: If we are using the Ninja generator and we have found a toolchain.ninja, use that ninja.
If ninja is installed, treat it as a path to ninja anyway.
2016-12-14 11:44:01 -08:00
practicalswift
b2af4653e4 [gardening] Fix PEP-8 violations. 2016-12-08 18:47:24 +01:00
Michael Gottesman
a9f737c7c7 [swift_build_support] Always emit a compilation_db.
There is no reason not to do this (and it is really cheap) and I want to make
some scripts use it with various clang tooling techniques like clang-tidy to
improve code quality. This will ensure that by default people can just use these
scripts without knowing about how things are working under the hood.
2016-12-06 17:34:21 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Michael Gottesman
857b764730 Add support for creating a compilation db for swift to build-script. 2016-11-11 13:28:30 -08:00
vitalyster
395fe061fd swift_build_support: do not raise exception when capturing shell with… (#5380)
* swift_build_support: do not raise exception when capturing shell with optional flag

This fixes one of https://bugs.swift.org/browse/SR-2966 failed tests when testing environment trying to instantiate FreeBSD toolchain on Linux and `sysctl` is not in the PATH

* swift_build_support: fix shell test
2016-10-20 15:29:01 -07:00
Michael Gottesman
b16d4fa505 [semantic-arc] Add build-script option --enable-sil-ownership to turn on the SIL ownership model.
rdar://28685236
2016-10-11 11:29:12 -07:00
practicalswift
ce3b47e329 [gardening] PEP-8 fixes. 2016-09-25 20:41:55 +02:00
Michael Gottesman
6fd9dca2e6 [benchmark] Allow the number of test samples cmake will use to be specified from the command line.
The benchmark bot uses this functionality today to run the benchmarks. By
default build-script only uses 3 samples for each test. Given the noise on our
systems, this is definitely not sufficient for any sort of robust numbers.

Using this patch, I am going to change the benchmarking bot to take the minimum
of 20 samples as we do for our internal benchmarking. This should help make the
benchmark bot give better data. This will have as a cost cause the bot to take
more time. The testing time issue can be solved down the line by changing to a
protocol where we first do tests with a small number of samples (< 5). Then any
benchmark with a delta > 5% is rerun with 20 samples or perhaps until a
statistical criterion is satisfied. But until that is implemented, this at least
makes the bot useful.

There are other things that need to be changed on the benchmarking bot as well,
namely that it should build on a separate machine from which it is running the
benchmarks on. The benchmarking machine should be quiet and not have any work
being done on it. But that is also for another time.
2016-09-23 20:05:10 -07:00
Michael Gottesman
ab714cfa12 [vacation/gardening] fix python lint errors. 2016-08-12 10:11:18 -04:00
Michael Gottesman
4aad5801c8 [vacation/gardening] Move clang/swift version specification from build-script-impl => swift_build_support.products. 2016-08-12 10:07:20 -04:00
Michael Gottesman
72603eb944 [vacation/gardening] Move compiler-vendor code from build-script-impl => swift_build_support.products.
This is part of an effort to provide examples on how to migrate product
specific flags from build-script-impl => swift_build_support.products.
2016-08-12 10:07:20 -04:00
Michael Gottesman
88db3ab0e0 [vacation-gardening] Use more unittest.TestCase.assertIn instead of *.assertTrue(foo in bar). 2016-08-12 09:06:17 -04:00
Michael Gottesman
f82f38ef9b [vacation/gardening] Use canonical cmake names for TRUE/FALSE just out of paranoia. 2016-08-12 09:06:17 -04:00
Michael Gottesman
14b2dd5296 [build-script] Move computation of LLVM_ENABLE_ASSERTIONS from build-script-impl to swift_build_support.products.LLVM. 2016-08-10 01:30:30 -04:00
Michael Gottesman
a56d6ac068 [build-script] Move llvm-targets-to-build to swift_build_support.products.LLVM from build-script-impl. 2016-08-10 01:30:30 -04:00
Robert Widmann
ed9fec7003 Fix python-lint build 2016-08-08 10:24:40 -07:00
practicalswift
3ebfbe4ef0 Remove unused imports. 2016-08-06 20:26:47 +02:00
Michael Gottesman
10bafd67e0 [build-script] Add support for passing into swift -DSWIFT_RUNTIME_USE_SANITIZERS flag. 2016-08-03 14:17:41 -07:00
Michael Gottesman
7611e12bf5 [build-script] Add support for compiling swift with tsan enabled. 2016-08-01 15:11:09 -07:00
Dmitri Gribenko
6eb40a084b build-script: support 4 version components in Clang versions 2016-07-13 22:08:24 -07:00
Mishal Shah
3a945c4bbe [utils] Add test for optional_bool action 2016-06-16 13:33:09 -07:00
Mishal Shah
e4341ab990 [build-script] Add optional_bool action and update build-script to use it 2016-06-15 11:44:21 -07:00
SpringsUp
02ad66db3c [build-script] Infer --android platform flag by presence of a stdlib-target 2016-06-10 08:35:21 +02:00
practicalswift
285b6b526c [gardening] Fix typo. 2016-06-09 10:14:23 +02:00
Daniel Dunbar
3e3fe3fd7c Merge pull request #2960 from ddunbar/freebsd-toolchain-crash
[swift_build_support] Fix crash in FreeBSD toolchain.
2016-06-08 19:24:52 -07:00