Commit Graph

8542 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
c8a8183d26 [6.2][Concurrency][SE-review update] Task names update (#81132)
**Description**: This adds "task name" parameter to all task creating
functions.

This is done in a few ways, e.g. we can backdeploy this to 5.1 in APIs
which do not accept the `TaskExecutor` but it they do we provide a
version for 6.0+ etc. This was requested in the SE acceptable of this
proposal [Acceptance post
SE-0469](https://forums.swift.org/t/accepted-with-modifications-se-0469-task-naming/79438).

This moves all these declarations to gyb since going through them one by
one has become unmaintainable otherwise.

**Scope/Impact**: All task creation APIs now gain a new task name
parameter.
**Risk:** Medium, changes existing APIs rather than adding "even more
overloads" though this risk was discussed in the team and accepted. This
has a potential to be source breaking it someone used Task.init and
friends as function.
**Testing**: CI testing, source compatibility suite testing
**Reviewed by**: 

**Original PR:** 
- https://github.com/swiftlang/swift/pull/81107 build changes required
for this
- https://github.com/swiftlang/swift/pull/80984


**Radar:**

---------

Co-authored-by: Kuba Mracek <mracek@apple.com>
2025-05-29 07:52:33 +09:00
Evan Wilde
379e445238 Build Swift-Testing with WMO
This tells build-script to build Swift-testing with WMO.
This results in a faster build products, but is also necessary for
configurations using the legacy swift driver, which would emit an
invalid swift interface in non-WMO builds.

Fixes: rdar://151357567
(cherry picked from commit 5f2b0022d1)
2025-05-27 14:37:03 -07:00
Bassam (Sam) Khouri
245514cab3 Merge pull request #81513 from bkhouri/t/6.2/disable_assertion
[6.2] preset: build swift with no assertion for swiftpm on linux
2025-05-14 23:19:54 -04:00
Bassam (Sam) Khouri
236c0fe224 Merge pull request #81505 from bkhouri/t/6.2/update_presets
preset: treat swift testing the same as xctest
2025-05-14 20:02:15 -04:00
Sam Khouri
276937bd1f preset: build swift with no assertion for swiftpm on linux
To work around https://github.com/swiftlang/swift/issues/81144, do not
build swift with assertions for the SwiftPM on linux.

(cherry picked from commit 3c363d54ce)
2025-05-14 13:53:34 -04:00
Sam Khouri
c2615fc4ab preset: treat swift testing the same as xctest
Whenever XCtest is build and installed, do the same for swift-testing
and swift-testing macros.

(cherry picked from commit 2962ea2b31)
2025-05-14 11:01:08 -04:00
Max Desiatov
901885651e Set rpath correctly for installed wasmkit binary 2025-05-14 14:12:09 +01:00
Max Desiatov
25b60a5d25 Build WasmKit with the freshly-built SwiftPM 2025-05-14 14:12:09 +01:00
Max Desiatov
79e214f919 Rename wasmkit-cli to wasmkit when installing 2025-05-14 14:12:09 +01:00
Max Desiatov
b640e6c2cf Include wasmkit in mixin_osx_package_base preset 2025-05-14 14:12:09 +01:00
Max Desiatov
2cd7de4810 Copy WasmKit to install_destdir
This enables `swift run` and `swift test` to use WasmKit when cross-compiling to Wasm with Swift SDKs that have toolsets pointing to WasmKit.
2025-05-14 14:12:08 +01:00
Doug Schaefer
4e30d4927f Merge pull request #81443 from dschaefer2/6.2-sourcekit-asn1
[6.2] build.ps1 updates for new SwiftASN1 dependency
2025-05-12 19:29:45 -04:00
Rauhul Varma
f13cc03b72 Merge pull request #81371 from swiftlang/rauhul/embedded-tooling 2025-05-12 16:06:59 +01:00
Doug Schaefer
e41e191a84 Add ASN1 module to SourceKit-LSP Test
Super surprised to see the build for swift test hardcoded in
the build.ps1 script instead of in the sourcekit-lsp repo.
At any rate, looks like I need to add the dependency on ASN1
here too.

This is to support changes in SwiftPM that add the dependency
which translates through to sourcekit-lsp.

https://github.com/swiftlang/swift-package-manager/pull/8610
2025-05-12 10:08:12 -04:00
Doug Schaefer
8c5fd217f0 Add SwiftASN1 to sourcekit-lsp dependencies for Windows.
Updates the build.ps1 script to add the SwiftASN1 package support
to it's CMake build. This was caused by this dependency being added
to a module in SwiftPM that sourcekit-lsp imports.
2025-05-12 10:07:55 -04:00
Owen Voorhees
b2fa48d510 Define SwiftBuild_Dir when building SwiftPM in build.ps1 2025-05-05 09:15:40 -07:00
Evan Wilde
338e40a307 Bootstrap: Install dispatch in stage0
The concurrency runtimes require that dispatch is installed or it will
fail to load at launch. The C library is built as part of the
concurrency build but is not installed. We need to install a copy of
dispatch so that programs that link concurrency run.

(cherry picked from commit f36391d4c8)
2025-04-28 10:53:55 -07:00
Evan Wilde
323b37c4eb Bootstrap: Stage 2 preset
Adding a stage-2 preset. This preset adds SwiftPM and XCTest to the
built products. The stage-1 preset could likely build all of the
product, but because the stage-1 compiler was built without several
optimizations available in the stage-0 compiler, this compiler will not
be as performant as a separate stage-2 compiler.

(cherry picked from commit 4130bca088)
2025-04-26 13:40:14 -07:00
Evan Wilde
b516dba637 Build Swift Testing: Add build_subdir
Adding a build_subdir preset default for the stage 0 and stage 1 build
configurations.

(cherry picked from commit 838d69f0f4)
2025-04-25 16:50:34 -07:00
Evan Wilde
a1df381033 Bootstrap: Add stage-1 preset
Adding a stage-1 buildbot preset and updating the stage 0 preset to
install the stage0 bootstrap somewhere so that it can be used to
bootstrap the stage-1 toolchain.

(cherry picked from commit d168fc9683)
2025-04-25 16:50:31 -07:00
Mishal Shah
ad867864be Merge pull request #80805 from compnerd/62-installer
Windows: update build.ps1 to adjust the installer build
2025-04-23 23:09:40 -07:00
Slava Pestov
9dfe53e343 CompatibilitySpan: Fix stdlib build on visionOS
Swift CI tests visionOS, but PR testing does not. Oops.
2025-04-21 15:01:29 -04:00
Slava Pestov
24f06794e1 Add temporary 'SwiftCompatibilitySpan 6.2' availability macro 2025-04-21 15:01:28 -04:00
Slava Pestov
5133c7f216 Update 'SwiftStdlib 6.1' availability macro 2025-04-21 15:01:28 -04:00
Saleem Abdulrasool
967726183e utils: update the installer build invocation
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.
2025-04-14 15:22:20 -07:00
Saleem Abdulrasool
2ec532ecee utils: adjust the emission of SDKSettings.json
Address the feedback from @jakepetroules about cases.
2025-04-14 15:22:19 -07:00
Saleem Abdulrasool
eb945d2b5a utils: extract Build-SDK helper
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.
2025-04-14 15:22:19 -07:00
Mishal Shah
c9bdc6be7c [update-checkout] Swift 6.2 release branch support
(cherry picked from commit dbf648b172)
2025-04-03 23:44:52 -07:00
Doug Gregor
e49afc8797 Merge pull request #80389 from 3405691582/nobtcfi
Add a build flavor to opt-out of BTCFI on OpenBSD.
2025-04-03 13:29:04 -07:00
Brian Michel
c0c9116bd6 Remove cache configuration from EanbleCaching
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.
2025-04-01 11:13:06 -04:00
Brian Michel
09664ee7cb Add remote caching option
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.
2025-03-31 19:28:35 -04:00
Saleem Abdulrasool
36af875572 Merge pull request #80289 from jeffdav/win-build-compilers-test-split
utils: Breakup Build-Compilers into Build- and Test- steps.
2025-03-29 17:19:47 -07:00
3405691582
a341ce5570 Add a build flavor to opt-out of BTCFI on OpenBSD.
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.
2025-03-29 10:47:23 -04:00
Saleem Abdulrasool
f3329376ca Merge pull request #80341 from compnerd/new-currency
utils: enable swift_Concurrency on the new build
2025-03-28 13:47:35 -07:00
Jeff
4f8af6cc9c utils: Breakup Build-Compilers into Build- and Test- steps. 2025-03-27 18:27:40 -07:00
Saleem Abdulrasool
d644044c1c Merge pull request #80336 from jeffdav/win-build-summary-sort
utils: Fix build.ps1 summary sorting.
2025-03-27 13:26:05 -07:00
Saleem Abdulrasool
075b973f98 utils: enable swift_Concurrency on the new build
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.
2025-03-27 08:31:45 -07:00
Jeff
92b0849a56 utils: Fix build.ps1 summary sorting. 2025-03-26 22:02:42 -07:00
Saleem Abdulrasool
f042eb8755 Merge pull request #80323 from jeffdav/win-build-fix-android-os-enum-refs
utils: Fix Android OS enum usage in function params.
2025-03-26 20:05:39 -07:00
Jeff
f863570499 utils: Fix Android OS enum usage in function params. 2025-03-26 15:21:24 -07:00
Max Desiatov
eb1a2960b6 Enable _Concurrency for Embedded Swift with WASI (#79292)
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>
2025-03-26 21:14:05 +00:00
Jeff
828a3470e8 utils: Add back missing ToolchainInstallRoot properties. 2025-03-25 21:43:36 -07:00
Evan Wilde
521e2f66b2 Merge pull request #80276 from etcwilde/ewilde/build-cmake-before-ninja
[build-script] Build CMake before Ninja
2025-03-25 15:22:40 -07:00
Evan Wilde
813ed210b3 [build-script] Build CMake before Ninja
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.
2025-03-25 10:23:47 -07:00
Saleem Abdulrasool
0819b437ef Merge pull request #80181 from jeffdav/win-build-platforms
utils: Convert build.ps1 to use Platform definitions.
2025-03-25 08:28:45 -07:00
Jeff
f3c95329bc PR Feedback. 2025-03-24 13:28:44 -07:00
Evan Wilde
321c8208f5 [build-script] Create time log dir
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.
2025-03-24 08:33:35 -07:00
Evan Wilde
bbd412b0dc Revert "[build-script] Remove ninja build time tracking"
This reverts commit fb4799f5d1.
2025-03-24 08:30:29 -07:00
Evan Wilde
fb4799f5d1 [build-script] Remove ninja build time tracking
Logging the build time is failing because the build log time file
doesn't always exist by the time Ninja is getting brought up.
2025-03-24 08:09:11 -07:00
Jeff
498f8f7909 Add fixme. 2025-03-21 11:05:15 -07:00