Commit Graph

8542 Commits

Author SHA1 Message Date
Mishal Shah
c110c9570f Merge pull request #83809 from finagolfin/cross-tools
[6.2.1][build] Make it possible to build a cross-compilation toolchain for Android, including Testing
2025-09-18 09:10:48 -07:00
Ben Barham
05783f077b Bump wasmkit to 0.1.6 for 6.2.1
(cherry picked from commit f2e654d7e1)
2025-09-15 12:15:47 -07:00
Mishal Shah
99eea239bf Merge pull request #81342 from swiftlang/maxd/bump-wasmkit-6.2
6.2: Bump WasmKit in `update-checkout-config.json` to 0.1.6

(cherry picked from commit 5bae58a1cf)
2025-09-15 12:12:09 -07:00
Charles Zablit
4bb6b284ce Merge pull request #84166 from charles-zablit/charles-zablit/windows/move-llvm-overrides-to-llvm-repo
🍒 [windows] move llvm test overrides to the llvm-project repository
2025-09-11 21:57:28 +01:00
Charles Zablit
47da1dcc2e [update-checkout] add a check for locked repositories 2025-09-09 17:35:50 +01:00
Charles Zablit
e48c9a42f7 [windows] move llvm test overrides to the llvm-project repository 2025-09-09 11:23:52 +01:00
Charles Zablit
0e7694683a [windows] update to the 6.1.2 toolchain in build.ps1 2025-09-05 16:17:00 +01:00
Charles Zablit
caec84cd54 [windows] upgrade to Python 3.10.1 2025-08-27 00:21:51 +01:00
Finagolfin
bfac55b009 [build] Change Foundation macro checks because of #83422
I missed that `build-script` passes back `false` instead, so use the `true_false`
function for broader checking.
2025-08-19 18:46:02 +05:30
Finagolfin
8a9ae8d789 [build] Make the new --cross-compile-build-swift-tools flag public
This new flag makes it easy to build Swift cross-compilation toolchains, by
disabling cross-compilation of all host tools, like the Swift compiler and
various macros, building on prior pulls #38441 and #82163.

Also, add two class methods to the Testing macros product so it works with #83260.
2025-08-19 18:45:49 +05:30
finagolfin
2de7f9427a [build][android] Use a CMake toolchain file to cross-compile Testing (#83260)
Also, disable a recently failing test for Android armv7.
2025-08-19 18:45:31 +05:30
Finagolfin
c7529a04b6 Only bring over supporting change of generate_linux_toolchain_file() from fcc03898c,
specifically the change that makes the following possible on linux:

    "* under Linux, do not cross compile LLVM when building for the host
     architecture -- that will ensure that the compiler-rt build will use
    the just built compiler and not the system one (which may not be
    new enough for this purpose);"
2025-08-19 18:45:15 +05:30
Marc Prud'hommeaux
5212e0f023 Support 16 KB page sizes on Android (#81596)
Android 15+ requires that native libraries be compiled with a linker
flag to support 16 KB page sizes. See:
https://developer.android.com/guide/practices/page-sizes#compile-r26-lower
2025-08-19 18:44:57 +05:30
Mishal Shah
32e10149dd Merge pull request #83749 from swiftlang/bump-version-6.2.1
Bump the Swift version to 6.2.1
2025-08-15 09:11:33 -07:00
Mishal Shah
1082d64b06 Bump the Swift version to 6.2.1 2025-08-14 23:21:36 -07:00
Mishal Shah
3ef2ee6518 [update-checkout] Add support for Swift 6.2.0 and 6.2.1
(cherry picked from commit f906535bec)
(cherry picked from commit 94d331d23e)
2025-08-14 22:42:41 -07:00
Yuta Saito
e25995ac5d [wasm] Fix installation paths for libxml2.a
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
2025-07-27 23:07:42 +00:00
Slava Pestov
95baef19df Merge pull request #83300 from slavapestov/update-availability-macros-26-6.0
[6.2] Update utils/availability-macros.def
2025-07-26 10:47:45 -04:00
Max Desiatov
ab7cd238fd [6.2] test/CMakeLists.txt: run Embedded Swift for Wasm tests (#83287)
Cherry-pick of #83128, #82399, and #82878, merged as ea6ca2b5db, 0c4e56174b, and e34eb3331f respectively.

**Explanation**: Currently `test/CMakeLists.txt` can only set `SWIFT_LIT_ARGS` for all tests uniformly. This means that we can't have tests for Embedded Swift with a different set of `lit.py` arguments.

Also, create 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`.

**Scope**: Limited to Embedded Swift test suite.
**Risk**: Low, due to limited scope.
**Testing**: #82878 was incubated on `main` for 2 weeks, #82399 for 3 weeks with no disruption, #83128 merged this week, but enables all these tests on CI, which are consistently passing.
**Issue**: rdar://156585717
**Reviewer**: @bnbarham
2025-07-26 09:48:47 +01:00
Slava Pestov
7fabd38ed0 Update utils/availability-macros.def 2025-07-25 15:45:44 -04:00
Charles Zablit
5954a7c07d Merge pull request #83202 from charles-zablit/charles-zablit/windows/fix-wrong-LLVM_HOST_TRIPLE-to-6.2
🍒 [windows][lldb] fix incorrect LLVM_HOST_TRIPLE when cross-compiling
2025-07-23 14:35:35 +01:00
Yuta Saito
a1a8d73ea2 [6.2][wasm] Build and install XCTest for Wasm Swift SDK (#83200)
- **Explanation**: Install static XCTest library and its Swift module files into Swift SDK for Wasm
- **Scope**: Narrow, only affects Wasm Swift SDK.
- **Original PRs**: https://github.com/swiftlang/swift/pull/83191
- **Risk**: Low, just a change to Wasm Swift SDK
- **Testing**: CI
- **Reviewers**: @MaxDesiatov
2025-07-22 23:06:50 +01:00
Yuta Saito
b7c3ceac0f [6.2][wasm] Rename wasm32-unknown-wasi to wasm32-unknown-wasip1 (#83199)
- **Explanation**: Renames the WebAssembly target triple from `wasm32-unknown-wasi` to `wasm32-unknown-wasip1` to align with the broader WebAssembly ecosystem's naming conventions. It's important to include this in 6.2, which is going to be the first stable release of Swift SDK for Wasm, so that we won't introduce a breaking triple change in the stable version series later.

  The WebAssembly ecosystem has been migrating from the generic wasi target name to more explicit version-specific names like `wasip1` and `wasip2`. This change has been adopted across multiple toolchains and language ecosystems:

  - Rust: Renamed `wasm32-wasi` to `wasm32-wasip1` (https://github.com/rust-lang/compiler-team/issues/607)
  - wasi-sdk: Renamed `wasm32-wasi` to `wasm32-wasip1` (https://github.com/WebAssembly/wasi-sdk/pull/386)
  - Go: Already uses `wasip1` naming convention (https://github.com/golang/go/issues/58141)

  The "p1" suffix explicitly indicates WASI Preview 1, which helps distinguish it from the newer WASI Preview 2 (wasip2) and provides clarity about which version of the WASI specification is being targeted.

  Also we already use `wasm32-unknown-wasip1` for Embedded WASI target, and having different names for Embedded and non-Embedded is confusing users.

- **Scope**: Narrow, only affects Wasm Swift SDK.
- **Original PRs**: https://github.com/swiftlang/swift/pull/83167
- **Risk**: Low, just a change to Wasm Swift SDK
- **Testing**: CI.
- **Reviewers**: @MaxDesiatov
2025-07-22 11:23:07 -07:00
Ben Barham
315de8dd74 Merge pull request #82516 from bnbarham/6.2-use-compiler-version
[6.2] Use SWIFT_COMPILER_VERSION before SWIFT_TOOLCHAIN_VERSION if it exists
2025-07-21 15:07:21 -07:00
Charles Zablit
56193998f5 [windows][lldb] fix incorrect LLVM_HOST_TRIPLE when cross-compiling 2025-07-21 13:00:13 +02:00
finagolfin
d746436d94 Merge pull request #82986 from finagolfin/droid
[6.2][android] Small test and build tweaks
2025-07-18 15:22:47 +05:30
Max Desiatov
ba7944b743 6.2: Build and install Testing and Foundation for Wasm Swift SDK (#83059)
Cherry-pick of #82285, merged as 05204bdf63

**Explanation**: Include Swift Testing Foundation and libxml2 into the Swift SDK for WebAssembly
**Scope**: Limited to Swift SDK for Wasm
**Risk**: Low, due to limited scope. Changes were incubated on `main` for 2 weeks with no known issues. Swift Testing changes were incubated for more than a month.
**Testing**: Manual testing with Swift SDKs produced off `main`.
**Issue**: rdar://155865189
**Reviewer**: @MaxDesiatov

---------

Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
2025-07-17 15:53:19 -07:00
Saleem Abdulrasool
8bf3af09a6 Merge pull request #82166 from Steelskin/fabrice/6.2-line-directive
🍒 [6.2] line-directive: Stop expanding response files
2025-07-15 11:40:13 -07:00
Alastair Houghton
eefdd69c8d Merge pull request #82915 from al45tair/eng/PR-151147606-take2
[Concurrency] Remove custom global executors from 6.2.
2025-07-14 16:20:57 +01:00
Ben Barham
919bc88a31 Use SWIFT_COMPILER_VERSION before SWIFT_TOOLCHAIN_VERSION if it exists
We should eventually split these, but for now SWIFT_COMPILER_VERSION
matches SWIFT_TOOLCHAIN_VERSION when it's actually set. Just use it in
preference to SWIFT_TOOLCHAIN_VERSION.

(cherry picked from commit ec46a4f026)
2025-07-11 15:24:08 -07:00
Finagolfin
91360ab37b [build] Fix libcurl for typos and correct name of build target 2025-07-11 16:24:30 +05:30
Finagolfin
0bdc26a7a7 [build] Set CMAKE_Swift_COMPILER_TARGET when cross-compiling corelibs 2025-07-11 16:23:55 +05:30
finagolfin
43970ac2f0 [android] Fix an install path and the displayed NDK in the build log (#82620)
I just noticed the install issue when cross-compiling Testing with a
freshly-built compiler, which I'd never done before. Also, fix the NDK
path shown in the CMake output.
2025-07-11 16:21:18 +05:30
Doug Gregor
958e74c48c Merge pull request #82852 from DougGregor/span-back-deployment-version-fixes-6.2
[6.2] Fix deployment version for Span back-deployment library
2025-07-08 16:09:03 -07:00
Ben Barham
3abc025579 Merge pull request #82018 from al45tair/fix-freestanding-deployment-version
[Build] Fix the minimal-stdlib build by setting a deployment version.
2025-07-08 11:25:17 +01:00
Doug Gregor
6391d3df6b Fix deployment version for Span back-deployment library
Part of rdar://155252653.
2025-07-07 13:56:11 -07:00
Saleem Abdulrasool
dc4302e65d utils: avoid redirection and use pipes for output redirection
When the output is directly redirected, the output is re-encoded. This
is particularly important as `Write-PList` uses `Invoke-Program` to
invoke `python.exe` to write the plist. However, because it is writing
to a file, while the output from Python is in UTF-8, the redirection
re-encodes the output to UTF16LE (BOM). Adjust the invocation to use
PS7+ `2|` and pipe both stdout and stderr as appropriate into files with
UTF-8 encoding restoring the encoding for the file.
2025-07-07 15:44:37 -04:00
Alastair Houghton
8eb879831c Merge pull request #81940 from al45tair/eng/PR-152498657
Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget.
2025-07-07 12:04:38 +01:00
Alastair Houghton
0813e95569 Merge pull request #81440 from al45tair/currentos-availability
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
2025-07-07 12:04:00 +01:00
wti
ea734e2c22 [6.2] Update wasmkit toolchain build to emit universal on macOS to fix #82390 (#82406)
- **Explanation**: Build wasmkit, a new toolchain executable, as universal binary on macOS using SwiftPM --arch flags. (Cherry picked from commit 6530236)
- **Scope**: WasmKit is new, and users targeting Wasm (and preferring WasmKit over other Wasm runtimes) might be few. WasmKit can be invoked directly by users and indirectly via `swift run` when using the official Swift SDKs for Wasm.
- **Issues**: Resolves #82390
- **Original PRs**:  #82393
- **Risk**: The new configuration only affects macOS targets. The binary is output to a new location, but the code already introspects the location correctly. The bug and fix impacts users of WasmKit binary newly added to toolchain, directly and via `swift run`. Risk of no-fix: The Swift.org wasm "Getting Started" [1] refers explicitly to this (unreleased) 6.2 toolchain WasmKit binary. Without this fix, users on Apple Silicon following those instructions get an obscure "bad CPU" error because it is built only for the host x86_64 arch.
- **Testing**: @kateinoigakukun verified WasmKit is universal after change in `main`. To verify, run shell `file usr/bin/wasmkit` and verify outputs include x86_64 and arm64 arch. An outstanding question is whether to add a check that toolchain executables are universal binaries on macOS. Currently they are, except for `docc`.
- **Reviewers**: @kateinoigakukun 

[1] https://www.swift.org/documentation/articles/wasm-getting-started.html
2025-06-26 10:32:26 +01:00
Tim Kientzle
3bacc327e9 Merge pull request #82186 from finagolfin/droid
[6.2][android] Fix the remaining tests and add a build flag that enables standalone cross-compilation SDKs
2025-06-23 11:41:14 -07:00
Andrew Kaster
78f9dc678c utils: Add llvm-symbolizer to install_components_with_clang presets
llvm-symbolizer is critical to ASAN/LSAN properly reading and applying
allowlists and suppressions. Without properly symbolized backtraces,
the tools cannot match stack traces to suppression lists, leading to
false negatives in leak detection and other issues.

Ensure that it's installed in the toolchain presets.
2025-06-16 10:19:29 -06:00
Owen Voorhees
8ddcd619cf [update-checkout] Update swift-system to 1.5.0 2025-06-12 12:59:26 -07:00
finagolfin
6065c13a23 [build] Switch over to new --cross-compile-build-swift-tools flag when cross-compiling Foundation macros (#82163)
Follow-on to #38441, missed this there.
2025-06-11 22:00:05 +05:30
finagolfin
2e5e72baa2 [build] Add a new --cross-compile-build-swift-tools flag to disable cross-compiling the compiler (#38441)
This is useful when building cross-compilation toolchains where you want
the stdlib and corelibs cross-compiled but don't want the Swift compiler
cross-compiled too with `--cross-compile-hosts`.
2025-06-11 21:59:52 +05:30
Joe Groff
a89f9de96a Merge pull request #82028 from Steelskin/fabrice/line-directive-stop-expanding-response-files
line-directive: Actually stop expanding response files
2025-06-10 14:31:53 -07:00
Saleem Abdulrasool
c4a2e681f4 Merge pull request #82023 from Steelskin/fabrice/line-directive-update-comment
line-directive: Update outdated comment
2025-06-10 14:31:42 -07:00
Saleem Abdulrasool
3407cecfaf Merge pull request #81996 from Steelskin/fabrice/line-directive-stop-expanding-rsp
line-directive: Stop expanding response files
2025-06-10 14:31:15 -07:00
Ben Barham
849cd8ee9a [Build] Pass the toolchain version through to Swift's compilation
Passes the value of the environment variable `TOOLCHAIN_VERSION` through
to Swift's `SWIFT_TOOLCHAIN_VERSION` for use in eg.
`-print-target-info` (and some day, `--version`).

(cherry picked from commit 3982ebbbb3)
2025-06-08 17:18:36 -07:00
Evan Wilde
91c92922fd Merge pull request #81788 from etcwilde/ewilde/6.2-wmo-swift-testing
Build Swift-Testing with WMO
2025-06-03 11:15:44 -07:00