Commit Graph

867 Commits

Author SHA1 Message Date
Butta
e9eb3b06c1 [build] Switch get_install_destdir() and other duplicated logic to the new host_install_destdir() 2021-12-08 13:52:29 +05:30
Butta
ec43ef1b37 [build] Allow cross-compiling build-script products for non-Darwin hosts too
To that end, move the --cross-compile-deps-path flag from build-script-impl to a
publicly documented build-script flag and use it for build-script products'
library dependencies too. Generate a SPM destination JSON file that can be used
both for cross-compiling these build-script products and by users for their own
Swift packages.

Also, add a native_toolchain_path() method, that uses a prebuilt toolchain if
available, and pass an install prefix in to swift-driver and sourcekit-lsp.
2021-12-08 13:52:28 +05:30
Mishal Shah
465f9690df Revert "build-swift: Explicitly use python3" 2021-12-03 14:29:36 -08:00
swift-ci
7b2eb1f821 Merge pull request #39987 from Catfish-Man/printf-in-this-economy 2021-12-03 05:23:56 -08:00
David Smith
fc3e718771 Initial support for compile-time generation of vprintf format strings, behind the SWIFT_STDLIB_STATIC_PRINT flag 2021-12-02 16:58:36 -08:00
Rob Prentiss
8e9e11c31d Use list comprehension for filter
In python3, 'filter' returns an interable which doesn't support using
'len()'. This switches to a list comprehension, so that we can check the
length of 'enabled_pipeline'.

This is required to move build-swift to Python3.
2021-12-01 10:56:56 -08:00
Gwynne Raskind
00b95911fe While we're at it, when echoing output from shell.run(), echo the command that's running _before_ executing it instead of after so the user can actually see what's going on instead of getting confused by the ordering of the output after the fact. 2021-11-26 12:11:58 -06:00
Gwynne Raskind
900a8e27b1 Fix input environment not being respected by shell.run() 2021-11-26 11:45:06 -06:00
Richard Wei
65bffd7ad7 Add _MatchingEngine and _StringProcessing modules.
These modules are part of the experimental declarative string processing feature. If accepted to the Standard Library, _StringProcessing will be available via implicit import just like _Concurrency, though _MatchingEngine will still be hidden as an implementation detail.

`_MatchingEngine` will contain the general-purpose pattern matching engine ISA, bytecode, and executor. `_StringProcessing` will contain regular expression and pattern matching APIs whose implementation depends on the matching engine..

Also consolidates frontend flag `-enable-experimental-regex` as `-enable-experimental-string-processing`.

Resolves rdar://85478647.
2021-11-19 09:27:33 -08:00
buttaface
30c292ca87 [android] Update to NDK 23b (#39921)
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.
2021-11-17 20:58:42 -08:00
Franklin Schrans
0a04ccec1b Merge pull request #39723 from d-ronnqvist/add-docc-in-build-script
[BuildScript] Add products for Swift-DocC and Swift-DocC-Render
2021-11-02 09:55:17 +00:00
Ethan Kusters
4d7383366b Add get_dependencies method to Swift-DocC-Render script
Adding the required `get_dependencies` class method should resolve the remaining test failures we're seeing for macOS toolchain builds.
2021-10-29 14:11:32 -07:00
Doug Gregor
6d0abdf1da Fix infernal Python linter warnings 2021-10-26 22:18:43 -07:00
Doug Gregor
7591d44996 Propagate Swift version information to the back-deployed binaries 2021-10-26 20:58:06 -07:00
Ethan Kusters
6fff54d215 Use swift-docc-render-artifact instead of building swift-docc-render 2021-10-19 17:26:02 -07:00
Saleem Abdulrasool
15a5d2c54b Revert "[android] Update to NDK 23" 2021-10-16 11:07:23 -07:00
swift-ci
46f3cc9dd8 Merge pull request #39045 from buttaface/android-ndk-23 2021-10-15 20:55:19 -07:00
David Rönnqvist
f662d50684 Add build script products for Swift-DocC and Swift-DocC-Render
(rdar://79703353)
2021-10-13 12:36:28 -07:00
Butta
7fa1b4b2ac [android] Update to NDK 23
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.

Also, add the libatomic dependency for Android armv7, just as on linux.
2021-10-12 12:37:01 +05:30
Alex Hoppen
fb7a5b8a38 [BuildScript] Don't install SwiftSyntax
Instead, link all binaries in the toolchain using SwiftSyntax (currently only `sk-stress-test`) should link to the binary statically. This simplifies the way SwiftSyntax is built and at the same time slightly reduces the toolchain size.
2021-10-11 22:04:11 +02:00
Eric Miotto
a0c6367145 Address Python lint issue in unrelated file 2021-10-01 15:09:41 -07:00
Eric Miotto
6fbc9623fb Don't include tests for back deploy concurrency product
Addresses rdar://83777172
2021-10-01 12:30:45 -07:00
Erik Eckstein
af71088d29 libswift: bootstrapping build
Adding build modes for libswift: off, hosttools, bootstrapping, bootstrapping-with-hostlibs
The two bootstrapping modes are new. For details see libswift/README.md
2021-09-28 18:51:42 +02:00
Max Desiatov
b1236e92f9 swift_build_support: Add WASI to StdlibDeploymentTarget (#39244)
This change adds support for WASI to `StdlibDeploymentTarget` in `swift_build_support/targets.py`. This will allow us to build stdlib for WASI in the future.

Related to SR-9307.
2021-09-27 17:59:38 +01:00
Zoe Carver
9313efc911 Merge pull request #39353 from zoecarver/allow-cmake-swift-override
[build] Allow `CMAKE_Swift_COMPILER` to be overriden.
2021-09-21 20:02:47 -04:00
zoecarver
5d2dd07eff [build] Allow CMAKE_Swift_COMPILER to be overriden.
If `CMAKE_Swift_COMPILER` is defined, the build script will now use that.
2021-09-17 17:05:39 -07:00
Karoy Lorentey
e73ef1fd87 [benchmark] Set SWIFT_DETERMINISTIC_HASHING while running benchmarks in regular smoke tests 2021-09-16 20:23:32 -07:00
Doug Gregor
0068722088 Fix the host-specific installation destdir for build-script products.
Prior to this, build-script products that build in the host-specific
directories for cross-compilation would get the wrong path, and
therefore wouldn't get picked up in toolchain builds.
2021-09-10 20:54:46 -07:00
Doug Gregor
d52d4d56af Fix Python lint warning 2021-09-09 14:57:08 -07:00
Doug Gregor
da50b81c4f Prefer just-built compiler when building back-deployed concurrency library 2021-09-09 09:34:17 -07:00
swift-ci
0c122a514f Merge pull request #38673 from buttaface/skip-clean 2021-08-30 16:27:14 -07:00
Doug Gregor
599974367e Enable concurrency back-deployment in the compiler by default.
Remove the option that explicitly enables concurrency back-deployment,
and instead always enable its support in the compiler. Remove the use
of the extraneous CMake option as well.
2021-08-28 22:43:41 -07:00
Doug Gregor
529abeee22 Merge pull request #39061 from DougGregor/concurrency-back-deploy-libraries-ci
Enable concurrency back deployment in CI configurations
2021-08-28 07:47:45 -07:00
Doug Gregor
6d6c2e69bf [build-script] Add --install-back-deploy-concurrency.
Allow the installation of the back-deployment shared libraries for
concurrency via build-script.
2021-08-27 08:58:52 -07:00
Michael Gottesman
e23525601e Merge pull request #38888 from gottesmm/stage2-swift-split-build-script-impl
[build-script] Split the build-script-impl pipeline into two pipelines so I can put a build-script product pipeline in between.
2021-08-27 06:31:35 -07:00
Michael Gottesman
4f149d07ce [build-script] Split the build-script-impl pipeline into two pipelines so I can put a build-script product pipeline in between.
This is where I am going to put the stage 2 swift. The reason why I need to do
this is that I need libdispatch, foundation, etc on Linux to use the stage2
compiler.
2021-08-26 16:48:25 -07:00
Doug Gregor
602937d06c Clean up build-script test failures and linter errors 2021-08-26 08:49:44 -07:00
Doug Gregor
f2995a3755 Optionally build the compiler and _Concurrency library for back deployment.
When enabling the build of the back-deployable concurrency library via
the build-script option `--back-deploy-concurrency`, also build the
compiler and (main) concurrency library to support older deployment targets.

Building the compiler for older deployment targets is effectively the
same as implicitly passing
`-Xfrontend -enable-experimental-back-deploy-concurrency`. That option
should probably go away.

Building the primary _Concurrency library for back-deployment means
setting the "SwiftStdlib 5.5" availability back to the earlier
deployment targets. This should have no effect on how the _Concurrency
library binary is built, but it does ensure that the right
availability annotations are in the _Concurrency module.
2021-08-26 08:49:44 -07:00
Doug Gregor
3f749dc13b Add an option to build the concurrency library for back deployment.
Introduce an additional build product to build-script to build
back-deployable concurrency libraries. These libraries would need to
be embedded in apps deployed prior to macOS 12/iOS 15 to support
concurrency.

The built-script option `--back-deploy-concurrency` can be provided to
build these back-deployment libraries. They are built in addition to
the normal concurrency libraries, as a separate product that installs
into `lib/swift-5.5/<platform>` within the toolchain. The macro
`SWIFT_CONCURRENCY_BACK_DEPLOYMENT` is set when building the
concurrency library, so that we can adapt the implementation to older
OS's.
2021-08-26 08:49:43 -07:00
Michael Gottesman
15aff43980 Revert "Revert "[build-script] Use a builder to setup pass pipelines that are then scheduled when using --infer""
This reverts commit 7348395a30.
2021-08-25 19:31:29 -07:00
Mishal Shah
7348395a30 Revert "[build-script] Use a builder to setup pass pipelines that are then scheduled when using --infer" 2021-08-18 08:34:18 -07:00
Michael Gottesman
6d50463656 [build-script] Use a builder to setup pass pipelines that are then scheduled when using --infer
The key thing here is that by using this builder, I am going to be able to split
the build-script-impl pipeline in two and put in a build-script pipeline in
between. This is needed so that on Linux, we can build the stage 2 compiler
before we build any of the build-script-impl libraries that depend on having a
swift compiler.

This should be an NFCI change. I am relying on our build system unit tests to
ensure that I am not changing any real behavior.
2021-08-17 19:54:03 -07:00
Butta
9d1736c123 [build] Add flags to allow skipping rebuilding the corelibs
Add three new flags, '--skip-clean-libdispatch', '--skip-clean-foundation', and
'--skip-clean-xctest', that leave the previous builds of those products in place.
2021-08-16 17:19:56 +05:30
Michael Gottesman
c86e3af454 [build-script] Refactor out BuildScriptInvocation into its own file and out of the top level build-script file.
This shrinks the number of lines in build-script by 50% and just makes it easier
to read. It will also enable me to refactor parts of it into pieces without
touching the main build-script file. This is really library code... build-script
itself doesn't care about how BuildScriptInvocation is actually implemented
under the hood.
2021-08-15 20:01:58 -07:00
Michael Gottesman
04adce1541 Merge pull request #38853 from gottesmm/pr-d8c550901b98bd6c923d361cead9546d950350b9
[build-script] Specify CMAKE_RANLIB when building a CMakeProduct.
2021-08-12 16:03:21 -07:00
Michael Gottesman
db01f33d88 [build-script] Specify CMAKE_RANLIB when building a CMakeProduct.
When I perform the stage2 build, the first C-libdispatch seems to require this.
2021-08-12 11:45:17 -07:00
Eric Miotto
3ebb554690 [build] Restore previous semantics of stdlib-deployment-targets test (#38848)
For historical reasons, we configure and build standard library targets
differently depending on whether `stdlib-deployment-targets` is no set or set to
`[]`.

Add a test to make this need more explicit.

Addresses rdar://81651877
2021-08-12 07:08:30 -07:00
Michael Gottesman
2333cbcf21 [cmark] Start always cross compiling cmark on Linux. 2021-08-08 20:31:41 -07:00
Michael Gottesman
d0ad980931 [build-script] Implement setattr on StageArgs.
In case people want to override staged args in funky ways.
2021-08-05 14:54:41 -07:00
Michael Gottesman
c3d094074a [build-script] Make sure that StageArgs are never passed a StageArgs as their args.
No good reason to do this and simplifies the state space.
2021-08-05 14:08:26 -07:00