utils: adjust the emission of `SDKSettings.json`. Use lowercase spellings for the platform names to match SwiftBuild's expectations as pointed out by @jakepetroules.
Adjust the install path computation to support installation of ARM64 on
AMD64. This enables the isolation of the runtimes on all architectures
for Windows to allow building the isolated runtime distribution.
When we invoke the script block it could throw an exception so we should
wrap it in a try finally block to ensure that we can restore the old
environment variables, otherwise you can end up back in a shell that has
an incorrect set of variables set.
This is most noticable if an exception is thrown when entering the vs
dev shell since without resetting the old vars you will have invalid
Visual Studio env variables set meaning you need to manually reset your
shell environment.
EnableCaching should only configure cmake to allow for sccache usage, it
should not configure sccache itself in any way. Those configuration
options should be deferred into the environment variables that sccache
will look for when it starts up.
When setting up sccache we can choose between local disk caching or
remote caching via an S3-ish blob storage engine. To allow for backward
compatibility for anyone that might be using the existing option for
disk caching we leave it place and instead provide a new remote caching
option.
This option assumes you've read the sccache documentation for setting up
the correct environment variables for telling sccache where to find the
bucket and how to authenticate to it.
To work-around #80059, we need to stop return address signing and
opt-out of BTCFI enforcement via enabling a platform linker option.
We don't want to completely undo the BTCFI work in the rare case that
we later figure out how to properly address the above issue, or allow
users who might want to benefit from BTCFI enforcement and won't use
Concurrency. To do this, condition the existing BTCFI flag enforcement
into a configuration option that defaults to off for now.
Because the new swift-driver needs to "know" whether the frontend is
configured to opt-out or not, and since the new driver communicates with
the frontend via the target info JSON to begin with, we add a field
that emits the build flavor to signal the right behavior.
This creates a helper for building the SDK for a given OS/Architecture.
The building of the SDK should be uniform and this ensures that we can
maintain that uniformity.
This also highlights any structural changes that are being adjusted
manually. The desire is to bring this to zero by gaining control over
the install rules.
Enable the Concurrency runtime for the experimental runtime builds on
Windows. This is required to enable the use of the static runtime to
bootstrap the early swift-driver.
WASI with Embedded Swift provides WASI-libc and libc++ headers necessary to build the `_Concurrency` module for Wasm. We now add `wasm32-unknown-wasip1-wasm` triple to `EMBEDDED_STDLIB_TARGET_TRIPLES` when `SWIFT_WASI_SYSROOT_PATH` is set, which builds the necessary stdlib slice.
---------
Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
Ninja requires CMake 3.15 or newer to build, while the CMake on Amazon
Linux 2 is only 2.8. We bootstrap a newer CMake anyway, so build it
before Ninja so that Ninja has a new enough CMake.
If the directory where the build time log is supposed to go doesn't
exist, create it. The append file mode will create files, but won't
create directories. When we start building ninja, we haven't necessary
created the build directory yet, so this results in an error about the
missing directory when writing the build time log.
The ninja builder took a host argument that was unused by the function.
The ninja build failed to pass this argument, resulting in
an execution failure. Removing the argument.