Commit Graph

865 Commits

Author SHA1 Message Date
Robert Widmann
0869b519cd Revert "Fallback to building Cmake from source on all platforms, not just Linux (#33543)"
This reverts commit 539b241bf2.
2020-08-29 17:19:49 -07:00
tbkka
539b241bf2 Fallback to building Cmake from source on all platforms, not just Linux (#33543)
* Fallback to building Cmake from source on all platforms, not just Linux

* Remove no-longer-used import
2020-08-28 13:26:29 -07:00
Artem Chikin
fc4ef192ae [build-script] Add a default-enabled "clean" step for swift-driver and swiftpm
Along with options to disable the mandatory clean using: `--skip-clean-swift-driver` and `--skip-clean-swiftpm`.

This will ensure that every invocation of build-script will, by default, clean up all build artifacts of these projects and re-build them from scratch.
This is needed for all builds because today arbitrary changes to the compiler can lead to us being unable to incrementally build components that are themselves written in Swift. This causes now-frequent failures in incremental build bots, and is a scenario that is encountered by developers. (For example see: rdar://65006593)

The proper long-term solution is to enable library evolution for these projects. Until this is done, the only safe thing to do is to always rebuild them.

Resolves rdar://65006593
2020-08-20 11:27:27 -07:00
Kuba (Brecka) Mracek
7378afd1bf Pass -isysroot to both CFLAGS and LDFLAGS when building ninja (#33414)
* Pass -isysroot to both CFLAGS and LDFLAGS when building ninja

* Update test expectations too
2020-08-13 15:25:20 -07:00
Kuba (Brecka) Mracek
ef89b0dc51 Add a 'standalone_minimal' preset to build a minimal, static, OS independent, self-contained binaries of stdlib. (#33286) 2020-08-12 07:28:34 -07:00
Doug Gregor
e2cdc5e04b Merge pull request #33196 from DougGregor/concurrency-lib
[Concurrency] Stub out an experimental concurrency support library.
2020-07-30 11:51:27 -07:00
Doug Gregor
3339f18e5c Appease pointless Python lint error 2020-07-30 09:07:41 -07:00
Doug Gregor
9b0266cf6a [Concurrency] Stub out an experimental concurrency support library.
The experimental concurrency model will require a supporting runtime
and possibly end-user-visible library constructs. Introduce a stub of
such a library, enabled by a new `build-script` option
`--enable-experimental-concurrency`, so we have a place to put this
work.
2020-07-29 16:32:27 -07:00
Saleem Abdulrasool
2bf0ee413f build: remove tensorflow-swift-apis from the master branch
Remove the ability to build this dependency.
2020-07-28 08:27:24 -07:00
Mishal Shah
e38a8bf4aa Merge pull request #33076 from apple/shahmishal/support-correct-simulator-arch
Only execute test for supported simulator plaforms
2020-07-24 14:48:02 -07:00
Saleem Abdulrasool
9f0e0a6e2e build: remove PythonKit integration 2020-07-23 13:38:54 -07:00
Mishal Shah
a43626639f Only execute test for supported simulator plaforms 2020-07-23 11:07:10 -07:00
Saleem Abdulrasool
4586a6ae3b validation: make test_shell Python3 friendly
The custom `shell` module would coerce the byte-string representation
from `subprocess` into a text string representation in the happy path.
However, the same handling was not applied to the error case.  This
would result in a byte-string representation being returned in Python 3
rather than the text string.  Perform the conversion in both cases to
ensure that we can handle the strings without having to do the
conversion.
2020-07-14 21:54:48 +00:00
Mishal Shah
a930b51494 [Apple Silicon] Simulator support for arm64 2020-07-02 19:17:29 -07:00
Mishal Shah
83c57f3e58 [Apple Silicon] [Build] Filter out any architectures that are unsupported by the SDKs 2020-07-02 19:05:45 -07:00
Mishal Shah
2aef2c5fe3 [Apple Silicon] Fix cross-compilation in Xcode trains where we're not building stdlib at all 2020-07-02 18:25:44 -07:00
Mishal Shah
960f6ced74 [Apple Silicon] [build-script] Support stdlib macOS arm64/arm64e 2020-07-02 18:13:16 -07:00
Mishal Shah
ee1ea6e514 [Apple Silicon] Support building for macOS arm64/arm64e 2020-07-02 18:03:39 -07:00
Mishal Shah
919da26d15 [Apple Silicon] [Build] Generalize macOS architecture check 2020-07-02 16:40:16 -07:00
Ben Langmuir
c03ea7ad44 Merge pull request #32546 from dylansturg/add_swift_format_product
Add a build product and presets for swift-format.
2020-07-01 14:40:01 -07:00
Dylan Sturgeon
3b168d87fd Changes for review:
- Fix extra space in build-script arg to build swift-format.
- Fix python lint errors in `swiftformat.py`.
- Remove swiftsyntax from swiftformat build preset.
2020-06-26 13:38:54 -07:00
Dylan Sturgeon
e56ce8a88c Minor review tweaks.
- Remove unused `package_name` method.
- Disable swift-syntax tests in swift-format builder preset.
2020-06-25 14:39:28 -07:00
Dylan Sturgeon
e225bfb332 Add a build prodct for swift-format.
This product supports building and testing swift-format, forwarding the commands to a build script inside of swift-format's repo to handle actually invoking Swift PM. There are new command line options to support the swift-format product:

`--swiftformat`: Enables building swift-format.
`--skip-test-swiftformat': Disables running tests for swift-format after building.

Installing is intentionally not implemented because swift-format isn't ready to be installed as part of the Swift toolchain.
2020-06-25 10:35:07 -07:00
Doug Gregor
26bb4ec140 Appease the Python linter 2020-06-19 18:17:59 -07:00
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