Commit Graph

941 Commits

Author SHA1 Message Date
Doug Gregor
bf9f0eca1b [build-script] Add support for building, installing, and testing swift-driver
Add build-script command-line options for building, installing, and
testing swift-driver:
* `--swift-driver` will build the Swift driver. If testing is enabled,
  it will be tested as well
* `--install-swift-driver` will install the `swift-driver` and
  `swift-help` executables in the toolchain.
* `--skip-test-swift-driver` will disable testing of the Swift driver
when other tests are being run.

The Swift driver depends on SwiftPM to build; it is recommended that
you use `--infer` to get the appropriate dependencies built.

Note that this option does not yet replace the existing Swift driver
executables (`swiftc`, `swift`) with the new driver, nor does it
install the SwiftDriver library for use elsewhere.
2020-06-19 12:19:47 -07:00
Michael Gottesman
a6cb3aebb9 Merge pull request #32256 from gottesmm/pr-6a889299976ad0e3dfbc1849e1b7edaf177c53ce
[build-script] Add option --infer to infer dependencies.
2020-06-09 14:24:16 -07:00
Michael Gottesman
a313f62522 [build-script] Add option --infer to infer dependencies.
This causes build-script to use the conservative dependency information that I
committed. When one uses this option, it is assumed that one wants to also
install all built products.

Some notes:

1. I included an extra --install-all option so without --infer enabled
   one can enable this sort of install everything that we want to
   build behavior.

2. I added %cmake as a lit variable. I did this so I could specify in
   my build-system unit tests that on Linux they should use the just
   built cmake (if we built cmake due to an old cmake being on the
   system). Otherwise, the build system unit tests took way too
   long. These are meant to be dry-runs, so building this cmake again
   is just wasteful and doesn't make sense.

3. I unified how we handle cmark, llvm, swift with the rest of the
   build products by making them conditional on build_* variables, but
   to preserve current behavior I made it so that they are just
   enabled by default unlike things like
   llbuild/swiftpm/foundation/etc. This was necessary since previously
   we would just pass these flags to build-script-impl and
   build-script didn't know about them. Now I taught build-script
   about them so I can manipulate these skip-build-{cmark,llvm,swift}
   and then just pass them down to build-script-impl if appropriate
   rather than relying on build-script-impl to control if these are
   built.

Once this lands, I think we are at a good enough place with
build-script until we get rid of build-script-impl in terms of high
value QoI that will imnprove productivity. Once build-script-impl is
destroyed, we can start paring back what build-script itself does.
2020-06-09 11:04:43 -07:00
Michael Gottesman
d45047dfb3 Merge pull request #32260 from gottesmm/pr-89123c4fe2e41b356d82591f3e4482b004aacc8f
[build-script] Remove a bunch of conservative dependencies on lldb.
2020-06-08 23:54:42 -07:00
Michael Gottesman
49288f757d [build-script] Remove a bunch of conservative dependencies on lldb.
I only didn't touch playground-support since I don't know if there are deps
there or not. Everything else here though shouldn't need lldb to be built.
2020-06-08 21:26:19 -07:00
Michael Gottesman
450b005c3c [build-script] Add support for specifying that a product is a non-darwin only product.
We have a few of these like foundation, libdispatch, icu, xctest that are built
outside of build-script on Darwin.
2020-06-08 19:30:02 -07:00
Michael Gottesman
28f60a09bf Merge pull request #32247 from gottesmm/pr-bd788ac2872223df1190069035d4106524088523
[build-script] Fix import of dependencies of each product.
2020-06-08 17:17:14 -07:00
Michael Gottesman
363bd5d26e [build-script] Fix import of dependencies of each product.
While actually wiring this up, I discovered that I imported these products
incorrectly.

Should be NFC.
2020-06-08 13:20:15 -07:00
Michael Gottesman
8effe4984e [build-script] Add a really simple build scheduler that assumes/enforces a DAG build graph.
Some notes:

* I am purposely trying to not do something too crazy here. My hope is that this
  can tied us over until we can remove a bunch of build-script logic (after
  build-script-impl is destroyed).

* Given this need for simplicity, I purposely did something really simple: I
  assumed the build-graph was a DAG. This makes it really easy to compute a
  topological ordering just by computing RPOT numbers from POT numbers. That is
  what I did in this implementation.

I haven't wired it up to anything and just added a simple test that shows how it
can properly infer from a toy dependency tree the dependencies of a "toy
swiftpm" project.
2020-06-08 12:53:07 -07:00
Michael Gottesman
1e1b350fd1 [build-script] Add dependencies for all build-script products as a first approximation.
In most cases, I followed the ordering of dependencies defined already by
build-script's product classes. In a subsequent commit I am going to add an
option (disabled by default) that schedules this via a simple topological sort
based on proving our dep graph is a DAG and using RPOT numbers.
2020-06-06 01:19:53 -07:00
Michael Gottesman
104c8f363c [build-script] Make is_build_script_impl_product() a pure method and get rid of default Yes answer.
This forces the code to self document this property. This is just an NFC
refactor.
2020-06-05 20:16:33 -07:00
Mike Ash
2a55b9d08f Fix python lint errors. 2020-05-30 14:04:32 -04:00
Ben Cohen
49cbf9788f Rename swiftdt to swift-inspect 2020-05-29 08:31:04 -07:00
Michael Gottesman
404867eee7 [build-script] Convert swiftdt to be a swiftpm project that is built via a build-script product. 2020-05-29 08:31:03 -07:00
Doug Gregor
a87b8d5f43 [build-script] When we build Dispatch and Foundation, pass them down to SwiftPM's build 2020-05-12 11:17:45 -07:00
Max Desiatov
f88269587b Gardening: fix typo in swift_build_support product.py 2020-05-11 13:17:24 +01:00
Argyrios Kyrtzidis
7600043559 [utils/build-parser-lib] Fixes for building the parser library
* Need to symlink 'swift' into 'llvm-project' since we are doing a unified configure with 'swift' as an external project.
* Need to set "-DLLVM_ENABLE_LIBEDIT=FALSE" to get iOS builds working again
2020-05-06 07:49:35 -07:00
Ben Langmuir
bb89c46f06 Merge pull request #31015 from benlangmuir/sk-sanitize
[build-script] Add sanitizer options to sourcekit-lsp
2020-04-28 09:03:33 -07:00
Mishal Shah
682b375372 Merge pull request #30565 from buttaface/prefix
[build-script] Add the installation prefix to the toolchain path
2020-04-20 10:03:22 -07:00
Ben Langmuir
5eb14326f0 [build-script] Add sanitizer options to sourcekit-lsp
For now, default to no sanitizers.
2020-04-14 10:33:38 -07:00
Ben Langmuir
43bb415668 Merge pull request #30963 from benlangmuir/isdb-san
[build-script] Add sanitizer support to indexstore-db product
2020-04-14 09:28:55 -07:00
Ben Langmuir
1d7ce7efe5 [build-script] Add sanitizer support to indexstore-db product
Support the usual `--enable-*san options`, but also add a
`--test-indexstore-db-santitize-all` that runs the tests once for each
sanitizer. Sanitizing just indexstore-db with a regular toolchain should
be much faster than using sanitized compilers.
2020-04-13 15:39:36 -07:00
Robert Widmann
22b0526917 Merge pull request #30082 from 3405691582/OpenBSD_Port_Build
Build system recognizes OpenBSD.
2020-04-12 09:30:17 -07:00
3405691582
f8d0174b85 Build system recognizes OpenBSD.
Commit for CMake and build scripts to recognize OpenBSD. To keep this
commit relatively short, this just deals with the rather simple and
uncontroversial changes to the build system.

Note that OpenBSD calls "x86_64" as "amd64", Since the Swift stdlib will
be put in a subdirectory named after ARCH, to ensure the standard
library is properly found later, we use the native architecture name for
OpenBSD in the build system rather than trying to deal with the
difference the other way around.
2020-04-03 13:34:17 -04:00
Dario Rexin
964de289a7 Update cmake version to 3.16.5
3.15.1 contains a bug that causes libraries that use the CMake Swift module to be built with -Onone, even in release mode.
2020-03-31 18:42:53 -07:00
Butta
41ef65c23e [build-script] Add the installation prefix to the toolchain path
In several places, it was assumed to be /usr and hard-coded to that. This makes sure
the installation prefix actually passed in is used.
2020-03-22 20:02:00 +05:30
Kuba (Brecka) Mracek
5d918e5ee1 Merge branch 'master' into mracek/arm64e 2020-03-03 08:28:01 -08:00
Saleem Abdulrasool
d8a40a1662 build: use the correct install location
Use the correct installation location path computation
`toolchain_install_path` rather than trying to compute it ourselves.
This ensures that the files are installed into the right location.
2020-02-27 16:12:17 -08:00
Kuba Mracek
45ba5cec05 [arm64e] Add arm64e support into Swift's build system 2020-02-27 16:08:15 -08:00
Mishal Shah
5a4d290deb [Test] Fix build system test by adding only_non_executable_test flag 2020-02-21 19:56:53 +05:30
Mishal Shah
2f7ff37329 [Build System] Add support to execute non-executable tests 2020-02-21 18:03:16 +05:30
Saleem Abdulrasool
ac6e34ce7c build: make tensorflow-swift-apis build with older CMake
Support CMake 3.15 for the build which required changing into the build
tree before configuring/building.

Use the just-built `swiftc` to build the product.
2020-02-20 15:35:41 -08:00
Saleem Abdulrasool
5d87e43ffb build: improve the PythonKit build
This improves the PythonKit build for CMake <3.16 and for Python 2.7 or
Python 3.x.
2020-02-20 08:22:58 -08:00
Saleem Abdulrasool
ef32ead97f build: correct executable name for swift compiler
The swift compiler is `swiftc` not `swift`.  Correct the spelling.
2020-02-19 11:09:06 -08:00
Saleem Abdulrasool
01f9321496 build: build PythonKit with just built toolchain
Use the toolchain we just built to build the PythonKit module.
2020-02-18 16:34:05 -08:00
Saleem Abdulrasool
9b332a3a35 build: add an option to optionally build tensorflow-swift-apis
Now that the autodifferentiation support is being upstreamed, add an
option to enable building the TensorFlow swift-apis package optionally.
This enables easier development cycles for the engineers working on it.
2020-02-13 13:21:30 -08:00
Saleem Abdulrasool
8d32ee36fc Merge pull request #29443 from compnerd/unsupported-playground-support
build: migrate playground support to post-build artifact
2020-02-12 11:28:03 -08:00
Ross Bayer
e793fcf052 [Build System: build-script] Moved SWIFT_SOURCE_ROOT, SWIFT_BUILD_ROOT and SWIFT_REPO_NAME along with other project path constants into a new build_swift.constants module. 2020-02-11 12:46:03 -08:00
Saleem Abdulrasool
f4086d8428 build: migrate playground support to post-build artifact
This migrates the playground support out of the build-script-impl and
into the python based build system.  This makes it build more similarly
to the Swift Package Manager and SourceKit-LSP.  More importantly, it
reduces the dependency on build-script-impl.
2020-02-08 14:00:02 -08:00
Ross Bayer
e8f2119e0a Merge pull request #29603 from Rostepher/remove-diagnostics-module
[Build System: build-script] Remove the diagnostics module from swift_build_support.
2020-02-02 16:58:30 -08:00
Ross Bayer
4450ce365a [Build System: build-script] Remove the diagnostics module from swift_build_support. 2020-02-02 14:30:51 -08:00
Ross Bayer
52428ff971 [Build System: build-script] Remove the host module from swift_build_support.
The functions used to calculate default LTO link jobs for LLVM and Swift have been moved to the build_swift.defaults module.
2020-02-02 14:01:19 -08:00
Ross Bayer
a7d6cd8126 [Build System: build-script] Adds a new cache_utils module to build_swift which replaces the existing module from swift_build_support. 2020-01-30 23:06:14 -08:00
Ross Bayer
ca4fc19a50 [Build System: build-script] Remove the tar module from swift_build_support.
The single function it provided to archive a source diretory has been moved to build-script which was the only caller.
2020-01-26 23:32:34 -08:00
Ross Bayer
3bc3f795a3 [Build System: build-script] Remove the debug module from swift_build_support.
The single function it provided to print the xcodebuild version and SDK versions has been moved to build-script which was the only caller.
2020-01-26 14:31:06 -08:00
Saleem Abdulrasool
e26b21675d Merge pull request #29366 from compnerd/optional-pythonkit-support
build: add support for optionally building PythonKit
2020-01-25 09:15:44 -08:00
Saleem Abdulrasool
cad0c7ae21 build: add support for optionally building PythonKit
This adds support for building PythonKit as a package as part of the
toolchain build.
2020-01-24 11:17:41 -08:00
Ross Bayer
1d0f8d7602 [Build System: build-script] Update the DarwinPlatform.is_embedded method to account for macCatalyst. 2020-01-24 03:11:04 -08:00
Devin Coughlin
9b4a890262 [Utils] Attempt to appease python_lint 2020-01-21 20:27:14 -08:00
Devin Coughlin
89e381ca66 [CMake/Tests] CMake and lit.cfg support for running macCatalyst tests
Add support for testing with macCatalyst to lit.cfg and the test CMake.

This adds lit test features for whether the standard library and runtime was
built with macCatalyst support:

  REQUIRES: maccatalyst_support

The test suite can also be run in two modes: one where the macOS tests
are run as usual (against a zippered standard library, runtime, and overlays)
and another where iOS tests are compiled with the macCatalyst target
triple and executed as macCatalyst processes.

The iOS tests for macCatalyst can be run by passing `--maccatalyst-ios-tests`
to build-script. There are new lit test features to enable a test to specify
whether it supports that environment:

  REQUIRES: OS=maccatalyst
  UNSUPPORTED: OS=macCatalyst
2020-01-21 18:28:17 -08:00