Avoid passing this from the individual repositories that we build as
part of the runtime. This flag is automatically computed as part of
`Build-CMakeProject`.
Add swift-subprocess to the checkout set so that we can start
investigating building that for integration into swift-build.
Co-authored-by: Tina L <49205802+itingliu@users.noreply.github.com>
If Swift is being used, the client should always specify `-SwiftSDK` to
ensure that the right version is being taken always. This will ensure
that we build the runtime properly going forward.
Ensure that we properly use the platform information to select the SDK.
We had a number of cases where we assumed that the platform was Windows.
That no longer holds today as we build for more platforms.
Due to a bug in CMake, the `project()` invocation for Android projects
always overrides the `CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER` passed
on the command line with the compilers from the NDK installation.
Since the values we passed on the command line were not taking effect,
these changes remove them from the cmake invocation. This fixes
incremental Android builds.
Clang driver only passes arch-specific library paths as search paths
to the linker for WebAssembly targets but we were installing
libxml2.a under `<sysroot>/lib` without the multiarch triple. It led
to the linker not finding libxml2.a when importing FoundationXML
Swift Testing is in the downloadable toolchains but is not in the normal library
lookup path, so one needs to specify it explicitly with a -I command so it is
found by the test command.
Due to the fact that Wasm testing targets are configured by Python `build-script` unlike `build-script-impl` for the rest of testing targets, `--lit-args` value was ignored and not recorded in these targets. These are configured as `LLVM_LIT_ARGS` in CMake.
Let's assign the `LLVM_LIT_ARGS` configuration value in Python `build-script` to handle `--lit-args` consistently for all testing targets.
test/CMakeLists.txt: run Embedded Swift for Wasm tests
Run new `check-swift-embedded-wasi` target from `test/CMakeLists.txt`, tweak `lit.cfg` to support WASI Clang resource dir, exclude unsupported tests based on `CPU=wasm32` instead of `OS=wasi`.
Run new `check-swift-embedded-wasi` target from `test/CMakeLists.txt`, tweak `lit.cfg` to support both `-wasi` and `-wasip1` triples, exclude unsupported tests based on `CPU=wasm32` instead of `OS=wasi`.
wasmswiftsdk.py: consistently apply `build_runtime_with_host_compiler`
Following up on https://github.com/swiftlang/swift/pull/83134https://github.com/swiftlang/swift/pull/82949https://github.com/swiftlang/swift/pull/82946https://github.com/swiftlang/swift/pull/82944.
With these changes I'm able to quickly build and test only Wasm Swift SDK without rebuilding the whole toolchain when latest development snapshot is installed, using this invocation:
```
./swift/utils/build-script --skip-build-benchmarks --release --skip-early-swift-driver \
--skip-build-lldb --skip-build-cmark --skip-build-llvm --skip-build-swift \
--build-runtime-with-host-compiler --build-wasm-stdlib
```
Timing on M4 MacBook Pro:
```
--- Build Script Analyzer ---
Build Percentage Build Duration (sec) Build Phase
================ ==================== ===========
43.6% 257.75 Building wasmswiftsdk
20.6% 121.91 Building wasmthreadsstdlib
20.6% 121.78 Building wasmstdlib
5.4% 32.03 Building wasmllvmruntimelibs
3.6% 21.39 Running tests for wasmthreadsstdlib
3.5% 20.91 Running tests for wasmstdlib
2.7% 15.74 Building wasilibc
0.0% 0.04 macosx-arm64-extractsymbols
0.0% 0.04 macosx-arm64-package
0.0% 0.03 merged-hosts-lipo-core
0.0% 0.03 merged-hosts-lipo
Total Duration: 591.65 seconds (9m 51s)
```