Commit Graph

320 Commits

Author SHA1 Message Date
Saleem Abdulrasool
71e4d23f00 build: bootstrap cmake without QT 2019-12-07 16:23:56 -08:00
Butta
14cc620016 [android] A few tweaks for native compilation and to get more tests working
Now that CMAKE_HOST_SYSTEM_NAME and CMAKE_SYSTEM_NAME are set by default to
Android in the Termux app, make the needed tweaks. Some tests were adapted
to work natively on Android too, adds sys/cdefs.h to the Bionic modulemap,
and includes the start of native Android platform support in the build-script.
2019-12-07 01:01:59 +05:30
Mishal Shah
91e0db40b6 [Build System] Update the llvm projects path to be inside llvm-project dir 2019-11-17 00:12:26 -08:00
Alex Hoppen
ac9288d7ed [build-script] Build SwiftEvolve as part of the unified build 2019-11-05 15:38:24 -08:00
Alex Hoppen
869f8b4344 Merge pull request #28005 from ahoppen/unified-build
Build SwiftSyntax and the stress tester using a unified build
2019-11-04 20:02:58 -08:00
Ankit Aggarwal
7241030876 Move swiftpm to swift_build_support infra
This will allow cleaning up most of the hacks in SwiftPM's build script.

<rdar://problem/56220087>
2019-11-03 03:23:35 +00:00
Alex Hoppen
5764b77226 Build SwiftSyntax and the stress tester using a unified build
This avoids recompiling SwiftSyntax for every dependent project.
SwiftEvolve will be added to the unified build next.
2019-11-02 19:48:11 -07:00
Ben Langmuir
11aeb8b7fa Add build-script option --skip-test-toolchain-benchmarks 2019-10-31 09:47:20 -07:00
Alex Hoppen
fcd3457560 [build-script] Migrate SwiftSyntax to swift_build_support 2019-10-29 10:40:09 -07:00
Alex Hoppen
776e2c0030 Revert "Migrate building SwiftSyntax to swift_build_support" 2019-10-29 09:55:32 -07:00
Alex Hoppen
7ed085cb55 [build-script] Migrate SwiftSyntax to swift_build_support 2019-10-25 15:58:07 -07:00
Alex Hoppen
9721fd70b7 Merge pull request #27840 from ahoppen/dont-build-ios-stdlib
[build-script] Don't build stdlib for iOS if --skip-build-ios is passed
2019-10-24 09:15:27 -07:00
Alex Hoppen
ea2d44e5b6 [build-script] Don't build stdlib for iOS if --skip-build-ios is passed 2019-10-22 14:32:16 -07:00
Rintaro Ishizaki
4d31e7e755 [build-script] Fix python-lint issue
rdar://problem/56469555
2019-10-21 11:43:20 -07:00
Alex Hoppen
1926da3fe7 [build-script] Move building swiftevolve to swift_build_support 2019-10-19 19:10:41 -07:00
Alex Hoppen
adbd96bcf1 [build-script] Move building skstresstester to swift_build_support 2019-10-19 19:10:41 -07:00
Alex Hoppen
39c3f39b82 [build-script] Add function to compute toolchain path 2019-10-18 18:14:25 -07:00
Alex Hoppen
7be52d3852 [build-script] Extract logic determining whether to test/install a product to separate function
Previously, you were to check if a build/test/install is necessary in
the builds/test/install method which is easy to miss. This gives the
check more visibility.
2019-10-18 10:00:29 -07:00
Dan Zheng
2bd55f6755 [Autodiff upstream] Add build-script flag for differentiable programming. (#27595)
Add `--enable-experimental-differentiable-programming` build-script flag.

The build-script flag enables/disables standard library additions
related to differentiable programming. This will allow official Swift
releases to disable these additions.

The build-script flag is on by default to ensure testing of
differentiable programming standard library additions. An additional
driver flag must be enabled to use differentiable programming features:
https://github.com/apple/swift/pull/27446
2019-10-14 14:34:48 -07:00
Alex Hoppen
fa8a56e315 [build-script] Remove redundant test check in sourcekitlsp's build product description 2019-10-08 13:25:46 -07:00
Simon Evans
ec396dc4f0 Linux: Build CMake if the checked out version is newer than the installed version.
- For Linux only, if the checked out CMake repository is a newer version
  than the installed CMake version or CMake is not installed, build and
  use CMake from source.

- This does not affect macOS build or set any minimum required CMake
  version in CMakeLists.txt
2019-08-22 22:51:09 +01:00
Arnold Schwaighofer
257ef70157 Revert "Linux: Build CMake if the checked out version is newer than the installed version." 2019-08-22 14:00:51 -07:00
Simon Evans
ded44f5ba5 Linux: Build CMake if the checked out version is newer than the installed version.
- For Linux only, if the checked out CMake repository is a newer version
  than the installed CMake version or CMake is not installed, build and
  use CMake from source.

- This does not affect macOS build or set any minimum required CMake
  version in CMakeLists.txt
2019-08-21 12:05:36 +01:00
Ben Langmuir
2a1a4dde80 Make pylint happy 2019-08-12 14:11:33 -07:00
Ben Langmuir
718a5bf368 [build-script] Installation support for sourcekit-lsp
Add --install-sourcekit-lsp option to build-script and update presets
for package bots to install it.
2019-08-12 13:24:49 -07:00
Ben Langmuir
7f3a1e2f62 [build-script] Pass ninja path to indexstore-db/sourcekit-lsp 2019-07-22 11:44:58 -07:00
Daniel Rodríguez Troitiño
5a2fd7441b Merge pull request #23303 from drodriguez/cmake-options-improvements
[build-script] Improvements to CMakeOptions.
2019-06-12 10:01:36 -07:00
Saleem Abdulrasool
7ff22f5b7a Merge pull request #25266 from drodriguez/windows-fix-python-tests
[windows] Fix Python tests in Windows.
2019-06-11 10:35:02 -07:00
Ross Bayer
8db65b35a4 Merge pull request #25122 from Rostepher/darwin-supported-archs
[Build System: CMake] Darwin Supported Archs and Modules.
2019-06-10 12:03:04 -07:00
Daniel Rodríguez Troitiño
3fb9a2a7a4 [windows] Fix Python tests in Windows.
- Forward several environment variables to the test environment because
Windows uses them to inform the processes about things like the number
of processors and the architecture.
- Normalize some literal Unix paths to be the same as the results in
Windows, that will have forward slashes and the drive letter.
- Skip some test that use build-script-impl and tests that check for
files being executable (everything is executable in Windows).
- Don't use the owner and group arguments for tar on Windows.
- Hide the stderr output of which. In Windows it prints the full PATH in
case of failures, which is disrupting.
- Quote many paths in Windows in the output of build-script results.
- Provide a version of mock-distcc that can be executed in Windows. The
raw Python script cannot.
- Change the expected results for clang/clang++ to the right values in
Windows (clang-cl in both cases).
2019-06-06 11:30:22 -07:00
mishal_shah
a123d6321a Fix Python lint failure in test_host_specific_configuration 2019-05-31 18:50:05 -07:00
Arnold Schwaighofer
959a6acc28 Fix build-script's handling of --test-optimize-none-with-implicit-dynamic 2019-05-31 11:22:09 -07:00
Ross Bayer
1da11512e7 [Build System: build-script] Add new build-script options to specify supported architectures and module-only architectures on Darwin platforms. 2019-05-29 17:50:56 -07:00
Daniel Rodríguez Troitiño
def82feff4 [build-script] Move HostSpecificConfiguration out of main script.
This will allow using `HostSpecificConfiguration` from other parts that
are not the main script in the future. This is interesting because the
information is mostly useful when building Swift. The rest of products
are not really interested in the results of these calculations.

Includes a suite of tests that check the implementation correctly
calculates the right targets to build under diverse circumstances.
2019-05-29 14:52:08 -07:00
Brent Royal-Gordon
72f8249cb2 Print build-script notes to stderr
This makes it easier to ignore them programmatically.
2019-05-18 12:51:49 -07:00
Julian Lettner
4dcb49d8e7 Merge pull request #24330 from apple/preset-for-llvm-tsan-libdispatch-tests
[build][Linux] Create preset to run LLVM's TSan libdispatch tests
2019-05-17 10:32:55 -07:00
Julian Lettner
9631700d9e [build][Linux] Create preset to run LLVM's TSan libdispatch tests
Build a separate compiler-rt instance for running the tests. It is built
and tested against an installed toolchain instead of the llvm-build-dir.

Install everything we need to run tests (CMake modules, FileCheck, etc.)
into the toolchain directory.

Add synthetic target 'all' for llvm-install-components. Also we must set
LLVM_INSTALL_UTILS=ON, so the utilities required by tests (e.g.,
FileCheck) are included in the install target.
2019-05-16 13:17:30 -07:00
Daniel Rodríguez Troitiño
6bf0826524 [build-script] Improvements to CMakeOptions.
CMakeOptions was briefly used in the cmake module, but mostly unused in
the rest of the modules, however, several products were dealing with
what eventually will end as CMake options, but not using the already
existing code, and duplicating it.

The changes tries to unify all usage around CMakeOptions which avoids
code duplication. Additionally, it provides some more API surface in
CMakeOptions to make it more useful.

- The initializer can be passed a list of tuples or another CMakeOptions
  to copy into the newly created options.
- Boolean Python values are treated automatically as boolean CMake
  options and transformed into `TRUE` and `FALSE` automatically.
- Provides `extend`, which will add all the tuples from a list or all
  the options from another `CMakeOptions` into the receiving
  `CMakeOptions`.
- Provides `__contains__`, which makes checking for existing options a
  little easier (however, being `CMakeOptions` basically a list, the
  checking has to include also the value, which is not that helpful).
- Modify LLVM and Swift products to use `CMakeOptions`. It makes the
  boolean values clearer and avoid a lot of repetitive string
  formatting.
- Modify the tests to make them pass and provide new test for newly
  introduced features.
2019-05-14 13:25:58 -07:00
Daniel Rodríguez Troitiño
5c0e743fa5 [build-script] Introduce ProductBuilder. Transform Ninja to use it.
ProductBuilder allows us to tackle the different way than the different
products need to be build. The builders follow a very simple interface,
but inside them the details are hidden.

Previously the Ninja product was both a Product and ProductBuilder. The
methods that did the build have moved into ProductBuilder to match the
future ProductBuilders.
2019-05-13 12:36:29 -07:00
swift-ci
cfc03f85b6 Merge pull request #23955 from gottesmm/pr-098e8d08913c6672dcb8933d89afcd7c9f900dbd 2019-04-11 12:13:52 -07:00
Michael Gottesman
4a6154b4c4 [build-script] Rename ToolchainBenchmarks -> Benchmarks.
This is a better name for the internal interface. The outside option is still
--toolchain-benchmarks to distinguish it from the normal --benchmarks which is
part of swift's cmake.
2019-04-11 10:38:27 -07:00
Michael Gottesman
c86c1763c6 [benchmarks] Add support to the build-script swiftpm benchmarks for building the benchmarks in -Osize. 2019-04-11 10:10:38 -07:00
Michael Gottesman
53ff97428a [benchmarks] Change the build_script_helper to use subdirectories for each build and install final binaries in a toplevel ./bin build directory.
This will let me:

1. Add -Osize support easily.
2. Put all of the binaries in the same directory so that Benchmark_Driver can
   work with them via the -tools argument.
2019-04-10 22:18:50 -07:00
Michael Gottesman
115f7a43e0 Move build_script_helper from ./benchmarks/utils => ./benchmarks/scripts. 2019-04-10 22:18:50 -07:00
Daniel Rodríguez Troitiño
a8297b84bd [build-script] Rename all do_* methods to simply *.
As proposed in #23822, the do_* methods should only be using the * parts. Because all building should have the same names, this commit removes the prefix from all the method instances.
2019-04-08 15:51:27 -07:00
Saleem Abdulrasool
bc9c79a080 Revert "[build-script] Move HostSpecificConfiguration out of main script."
This reverts commit b9e17a7656.

Unfortunately, this caused conflicts on the Apple internal CI.
Reverting this for now.  This can be split up into smaller patches to
make it easier to merge.
2019-04-08 10:40:59 -07:00
Saleem Abdulrasool
9fb7fc0d60 Merge pull request #23810 from drodriguez/build-script-move-host-specific-configuration
[build-script] Move HostSpecificConfiguration out of main script.
2019-04-08 08:33:38 -07:00
Michael Gottesman
df539948d5 [benchmarks] Add support for building the benchmarks via build-script against the just created toolchain.
Now one can on Darwin/Linux build the benchmarks via swiftpm from build-script by passing in:

```
build-script $NORMAL_ARGS --install-swift --install-swiftpm --install-llbuild --toolchain-benchmarks --swiftpm --llbuild
```

This is done using the infrastructure that BenL added for sourcekit-lsp.
2019-04-07 13:25:31 -07:00
Daniel Rodríguez Troitiño
0e4f9380e9 [utils] Remove unused method.
The method was not used anywhere, and Workspace provides a better alternative which gives the full path instead of just the directory name.
2019-04-05 17:39:59 -07:00
Daniel Rodríguez Troitiño
b9e17a7656 [build-script] Move HostSpecificConfiguration out of main script.
This will allow using HostSpecificConfiguration from other parts that
are not the main script in the future.

Additionally, a lot of code that was part of BuildScriptInvocation has
been moved into HostSpeficiaConfiguration because nobody else needed it,
and HostSpecificConfiguration was highly coupled with the Invocation
object (through one of its arguments). This should make the
Configuration object a better citizen in other scenarios.
2019-04-04 19:21:42 -07:00