Commit Graph

8992 Commits

Author SHA1 Message Date
Saleem Abdulrasool
3e72be9582 build.ps1: use SDKOOT rather than recompute paths
Rather than re-compute the SDKROOT to form the path, use the environment
variable that we setup for the `SDKROOT` to make SDKROOT relative paths.
2025-08-07 16:48:17 -07:00
Saleem Abdulrasool
475bdd2b0b build.ps1: correct platform handling in Build-SPMProject
Ensure that we use the `$Platform.OS` rather than the hardcoded
`Windows` value, which allows us to be setup for building for
non-Windows hosts.
2025-08-07 16:47:08 -07:00
Saleem Abdulrasool
e50caba4d1 build.ps1: adjust Build-SPMProject debug info handling
CodeView is only available on Windows, ensure that we restrict it to
that. Default to DWARF even if the user requested codeview to ensure
that we generate debug info for non-Windows hosts.
2025-08-07 16:46:11 -07:00
Saleem Abdulrasool
1417ce498f build.ps1: correct indentation (NFC) 2025-08-07 16:44:46 -07:00
Alex Hoppen
2d2adfb017 Merge pull request #82947 from ahoppen/compress-index
[Index] Add an option to compress the record and unit files
2025-08-07 21:12:39 +02:00
Saleem Abdulrasool
e1d7c70545 Merge pull request #83546 from Steelskin/fabrice/utils-build-ps1-ps-core
utils: Make build.ps1 work with PowerShell Core
2025-08-06 12:58:47 -07:00
Ben Barham
5b9d70d030 Revert "Revert "[Build] Temporarily add -j 1 to swift-corelibs-foundation Windows build"" 2025-08-06 10:27:42 -07:00
Saleem Abdulrasool
21c331ab30 utils: update build-windows-toolchain.bat for renamed parameters 2025-08-06 09:18:41 -07:00
Saleem Abdulrasool
d29fad8d47 build.ps1: make -Android explicitly required
Default values for the Android environment should be the complete set.
The top-level `-Android` flag controls whether the Android SDKs are
built.
2025-08-06 09:13:04 -07:00
Saleem Abdulrasool
af39352174 build.ps1: wire up the new AndroidSDKVersions, WindowsSDKsVersion parameters
Wire up the ability to select the SDKs to build into the actual build
process.
2025-08-06 09:12:44 -07:00
Saleem Abdulrasool
93b2167850 build.ps1: introduce new -AndroidSDKVersions and -WindowsSDKVersions
Re-create the old named parameter with the new purpose of control over
the SDKs to generate.
2025-08-06 09:11:14 -07:00
Saleem Abdulrasool
a7921bb54b build.ps1: rename WindowsSDKs and AndroidSDKs
Rename these parameters to `WindowsSDKArchitectures` and
`AndroidSDKArchitectures`. This frees up `WindowsSDKs` and `AndroidSDKs`
to allow multiple SDKs per-OS.
2025-08-06 09:10:09 -07:00
Saleem Abdulrasool
2ecf87398b build.ps1: rename WindowsSDKPlatforms and AndroidSDKPlatforms
Rename these to `WindowsSDKBuilds` and `AndroidSDKBuilds`. This prepares
for the new parameter/terminology:
  - `WindowsSDKs` {default, experimental}`
  - `WindowsSDKArchitectures` {arm64, x64, x86}
  - `AndroidSDKs` {default, experimental}`
  - `AndroidSDKArchitectures` {aarch64, armv7, i686, x86_64}
2025-08-06 09:10:09 -07:00
Mishal Shah
f30f5231f1 Update the swift-collection version 1.1.6 2025-08-05 22:12:46 -07:00
Fabrice de Gans
347e5f47fc Remove Write-Progress cleanup
It does not actually work.
2025-08-05 16:49:07 -07:00
Evan Wilde
22b1205cf2 Merge pull request #83494 from etcwilde/ewilde/update-freebsd-build-preset
FreeBSD: Update build preset
2025-08-05 16:20:19 -07:00
Fabrice de Gans
e774ff1e3e utils: Make build.ps1 work with PowerShell Core
Windows PowerShell (version 5) and PowerShell Core (versions 6+) do not
handle escaping parameters for external programs invocation in the same
manner. In order to keep the script compatible with both editions of
PowerShell, these changes use the appropriate quote escaping style
depending on the PowerShell edition.

This also clears out the progress bars that can ghost in following a
call to `Remove-Item` in PowerShell Core.
2025-08-05 13:15:31 -07:00
Saleem Abdulrasool
c316e9360f Merge pull request #83521 from Steelskin/fabrice/utils-update-debug-flags
utils: Update debug flags
2025-08-05 13:08:32 -07:00
Saleem Abdulrasool
e9f19fcc2c Merge pull request #83517 from charles-zablit/charles-zablit/windows/cleanup-named-arguments-build.ps1
[NFC][windows] add named arguments to Copy-Item calls in build.ps1
2025-08-05 10:51:16 -07:00
Saleem Abdulrasool
2b8c4a0e13 Merge pull request #83518 from compnerd/subprocess
utils: integrate swift-subprocess build into build.ps1
2025-08-05 08:22:59 -07:00
Charles Zablit
3c7384e4e0 [windows] add named arguments to Copy-Item calls in build.ps1 2025-08-05 11:54:56 +02:00
Fabrice de Gans
e2d82f1b3f Add missing compilers for Test-XCTest 2025-08-04 16:44:17 -07:00
Max Desiatov
32b97d0e85 utils/wasm: Add Node.js WASI runner (#83524)
This runner can be utilized as an alternative to WasmKit when running tests or executables from Swift packages compiled to Wasm, when better performance or improved coverage of WASI 0.1 ABI is needed.

This script is meant to be running only locally at this time and doesn't assume presence of Node.js on CI, since no CI scripts were changed.
2025-08-04 15:02:35 -07:00
Saleem Abdulrasool
b982f164cd Merge pull request #83447 from compnerd/volatile
Runtimes: add a build for _Volatile
2025-08-04 14:49:39 -07:00
Charles Zablit
289605c077 Merge pull request #83519 from charles-zablit/charles-zablit/windows/remove-unittest2-from-build.ps1
[windows] remove unittest2 from build.ps1
2025-08-04 21:51:27 +01:00
Eric Miotto
4de714fa51 Merge pull request #83464 from edymtt/edymtt/separate-deployment-version-for-tests
Test: allow different deployment target versions for tests on Darwin
2025-08-04 12:13:30 -07:00
Fabrice de Gans
4cd42a6ded Address review comments 2025-08-04 10:51:38 -07:00
Fabrice de Gans
767fc49a23 utils: Update debug flags
* Always build with debug information on Android, even when
  `CDebugFormat` is set to `codeview`
* Move the Windows ASM debug flags to the ASM section.
* Add the Windows linker flags in the common Windows section, and
  always add the common Windows linker flags.
* Add `-ffunction-sections` and `-fdata-sections` for Android.
2025-08-04 09:41:14 -07:00
Charles Zablit
edc930e0d6 [windows] remove unittest2 from build.ps1 2025-08-04 17:55:30 +02:00
Saleem Abdulrasool
097e783043 utils: integrate swift-subprocess build into build.ps1
This is in preparation for integrating swift-subprocess into
swift-build.
2025-08-04 08:52:26 -07:00
Ben Barham
dd5c029700 Merge pull request #83010 from swiftlang/revert-82794-foundation-j-1
Revert "[Build] Temporarily add -j 1 to swift-corelibs-foundation Windows build"
2025-08-04 08:29:15 -07:00
Saleem Abdulrasool
eacbcae05a Merge pull request #83495 from compnerd/android-cleanup
build.ps1: clean up some android related workarounds
2025-08-02 08:54:52 -07:00
Saleem Abdulrasool
36a44a9a97 Merge pull request #83467 from compnerd/sbom
utils: add SBoM to Windows toolchain builds
2025-08-02 08:54:19 -07:00
finagolfin
09a751f698 [build][android] Use a CMake toolchain file to cross-compile Testing (#83260)
Also, disable a recently failing test for Android armv7 and enable another one
that now passes.
2025-08-02 15:27:45 +05:30
Mishal Shah
2e99105f24 Merge pull request #83104 from compnerd/subprocess
update_checkout: add swift-subprocess to the checkout set
2025-08-01 15:58:12 -07:00
Saleem Abdulrasool
00f707f0d0 build.ps1: clean up BUILD_WITH_INSTALL_RPATH usage
This is not necessary. This would only be needed for ELF targets which
are able to be built properly with `chrpath` once you set the
`CMAKE_EXECUTABLE_FORMAT` property.
2025-08-01 15:46:59 -07:00
Saleem Abdulrasool
e74dd99bde build.ps1: workaround Android builds
This works around the fact that CMake does not realise that we are
building a target which uses ELF files and can use `chrpath` to rewrite
the RPATH.
2025-08-01 15:46:59 -07:00
Saleem Abdulrasool
b8062e5e47 build.ps1: attribute some additional clean up 2025-08-01 15:46:59 -07:00
Evan Wilde
89481cf436 FreeBSD: Update build preset
Include remaining products in the freebsd build pipeline.
2025-08-01 14:08:40 -07:00
Saleem Abdulrasool
12e351e8ce utils: add SBoM to Windows toolchain builds
This adds an additional bit of tooling to `build.ps1` to generate a SBoM
in SPDX (JSON) and cyclone (XML) formats. We also simultaneously
preserve the syft format for additional metadata. This is done in
preparation to ensure that we are able to track content beyond just the
manifest over time.
2025-08-01 11:19:15 -07:00
Saleem Abdulrasool
817e5cbb4c build.ps1: remove superfluous CMAKE_Swift_COMPILER_WORKS
This is implicitly passed in `Build-CMakeProject` and does not need to
be specified.
2025-08-01 08:26:59 -07:00
Saleem Abdulrasool
5fb4aa64db build.ps1: remove extraneous parenthesis (NFC) 2025-08-01 08:26:59 -07:00
Saleem Abdulrasool
fc38a453dc build.ps1: remove remaining CMAKE_SYSTEM_NAME parameters
We compute the system name in `Build-CMakeProject` and do not need to
explicitly pass this along.
2025-08-01 08:26:59 -07:00
Saleem Abdulrasool
61958d4c81 build.ps1: sink CMAKE_FIND_PACKAGE_PREFER_CONFIG into Build-CMakeProject
We always prefer the config format so that we are building against the
build tree rather than the installed image.
2025-08-01 08:26:57 -07:00
Fabrice de Gans
bb8d610950 utils: Remove obsolete CMake arguments
* Always get the Swift triple from the compiler.
* Remove the `CMAKE_[C|CXX]_COMPILER_WORKS` options.
* Only set the new linker if the built compiler is used on Android.
2025-07-31 14:41:43 -07:00
Saleem Abdulrasool
60fb1cd6a3 build.ps1: add build for experimental _Volatile module
This adds the `_Volatile` module to the experimental SDK.
2025-07-31 10:15:59 -07:00
Eric Miotto
4e854dea88 Do not require CMake to be in the path for build-script tests 2025-07-31 08:52:55 -07:00
Saleem Abdulrasool
19d5c64594 build.ps1: be more explicit about SwiftSDK for Differentiation
Ensure that we indicate that we are not using a Swift SDK when building
this module as part of the SDK.
2025-07-31 08:29:23 -07:00
Saleem Abdulrasool
eed7f6cc0d Merge pull request #83450 from compnerd/implicit-target
build.ps1: remove the specification of `CMAKE_Swift_COMPILER_TARGET`
2025-07-31 08:23:23 -07:00
Eric Miotto
0869919eca Test: allow different deployment target versions for tests on Darwin
Currently we are using the same versions we use to build compiler and
standard library. This is an unnecessary coupling especially when
testing the generation of backdeployed executables for macOS -- here
we have interest in being able to run the tests on previous OSes, not
the compiler itself.

To support this, add new `--darwin-test-deployment-version-<platform>`
flags to build-script, which by default take the same value as the
matching `--darwin-deployment-version-<platform>` ones.

Addresses rdar://156724078
2025-07-31 08:19:13 -07:00