These products are built with CMake. In incremental build environments,
these products don't detect compiler changes, so the artifacts aren't
rebuilt unless the source code of these projects are changed.
To workaround that, always clean them in build-script to ensure they are
rebuilt.
rdar://135021207
Bump the deployment target from macOS 10.13-aligned versions to macOS
13.0-aligned versions. This allows us to stop linking CoreFoundation
in the swift runtime, which was previously required for availability
checking. It also lets us align the deployment target on x86_64 with
arm64, which was 11.0. Finally, it is a prerequisite to being able to
build swift using the macOS 15 beta SDKs.
This change adds build support for swift-testing in the Wasm Swift SDK.
Unfortunately, we can't use the regular SwiftTesting build-script product
because Wasm build cannot use build-script's cross-compilation infrastructure
for now. So we build swift-testing in WasmSwiftSDK product and install it
to the SDK package.
Rather than make this change, swiftlang/sourcekit-lsp@37d003eb7 had the
`--no-clean` flag do nothing, which means the flag can't be used at all.
Instead, switch the flag to `--clean` in swiftlang/sourcekit-lsp#1558 and don't
invoke it by default.
Currently, when a command fails with this message
```
ERROR: command terminated with a non-zero exit status 1, aborting
```
it's unclear at all which exact command terminated, which makes it very hard to debug issues in the build script.
The stdlib build configuration for wasm is incompatible with the
embedded targets (e.g. `SWIFT_STDLIB_COMPACT_ABSOLUTE_FUNCTION_POINTER=TRUE`),
so we need to disable building the embedded stdlib
Just built Swift SDK would be useful for SwiftPM to perform integration
tests. All of those products do not depend on just built SwiftPM
(WasmKit is built using host tools), so it is safe to build them earlier.
This change adds a new product, WasmSwiftSDK, to build the Swift SDK for
WebAssembly. The product is built using the swift-sdk-generator package
and takes just built WebAssembly stdlib, clang runtime libraries,
and wasi-sysroot as input, and produces a Swift SDK artifactbundle under
swift-sdk-generator/Bundles.
The `classes-wasm.swift` test was the only executable test for
WebAssembly that requires wasm runtime at test-time. Other tests
in the `embedded` directory run only on the macOS / Linux host toolchain
builds and some of them are incompatible with SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB=OFF.
Given that the `classes-wasm.swift` test is the only test we want to run
during WasmStdlib build, move it to a separate directory `embedded/wasm`.
- Before f34d388bf2, the EarlySwiftDriver used Dispatch/Foundation from
old host toolchain at the initial "build" step, and then re-linked the just
built Dispatch/Foundation at "install" step.
- WasmStdlib product incorrectly set `BOOTSTRAPPING_MODE` to `HOSTTOOLS`
and it makes `SwiftSource.cmake` set `LD_LIBRARY_PATH` to load the
Dispatch/Foundation from the just built toolchain (SWIFT_NATIVE_SWIFT_TOOLS_PATH).
After f34d388bf2, the EarlySwiftDriver always uses the corelibs of
the old host toolchain, so setting `LD_LIBRARY_PATH` leads to loading
incompatible corelibs of the old host toolchain, and the build fails.
This change tells the CMake build system to use CROSSCOMPILE mode.
We already built the toolchain for the current host from the revision
being built for the target, so we don't need to inject the lib library
of the old host toolchain.
Currently those are hardcoded to `-g`, but in some Apple internal
configurations we would like to change them.
There are other part of the build system that hardcode `-g`
(e.g. in `SwiftCompilerSources` and `AddSwiftStdlib.cmake`),
but we are not interested in those at the moment -- we will address those
in the future if need be.
Supports rdar://127503136
Fix some indentation issues.
Change `build-script-impl` to make `build-linux-static` a positive argument.
Fix documentation for `--linux-archs` and `--linux-static-archs` (the options
are comma separated for `build-script`, but semicolon separated for
`build-script-impl`).
Set the default for `linux-static-archs` to `x86_64, aarch64` so that we
install the expected content in the toolchain.
Add missing default for `test_linux_static`.
Make sure to pass down `--skip-build-linux` and `--build-linux-static`.
Factor out config file generation and call it from the install step in `llvm.py`
as well as from the build step.
rdar://123503470
The early swift driver build would switch the Dispatch and Foundation
build used while building between an initial clean build and an
incremental rebuild. The early swift driver should consistently use the
same Foundation and Dispatch for each build.
This change tells the early swift driver stops build-script from telling
the early driver build to use the Foundation and Dispatch that it built.
Declare a new `LINUX_STATIC` SDK and configure it.
Add options to set the build architectures for the `LINUX` and
`LINUX_STATIC` SDKs, similar to what we have for Darwin, because
we'll be cross-compiling.
Also add an option to point the build system at the sources for
the musl C library, which we're using for `LINUX_STATIC`.
rdar://123503470
`unitest.assertEquals` is deprecated in Python 3.2 and finally removed in
Python 3.12 [1]. Due to this, this test files in recent Linux distros,
like Ubuntu 24.04 or Fedora 38+. This patch replaces the deprecated
function with `assertEqual`.
[1] https://docs.python.org/3/whatsnew/3.12.html