Commit Graph

474 Commits

Author SHA1 Message Date
Alastair Houghton
555c6f9b53 Merge pull request #80636 from al45tair/fix-windows-build-2025-04-08
[Windows] Fix build issues.
2025-04-24 11:32:22 +01:00
Saleem Abdulrasool
590e0ffb94 utils: remove LibraryRoot from the windows build
This is no longer used, preferring to stage the dependencies into the
toolchain image. The packaging step will simply ignore these files to
prevent shipping. This is important to support a multi-phase build as
well as a cross-compile for a host where the host binaries cannot run
on the build.
2025-04-23 16:26:43 -07:00
Saleem Abdulrasool
d3a141c5b8 utils: correct the host that we reference for the tools
We need to use the build for the tools rather than the host. This is to
help fix the cross-compilation scenarios.
2025-04-23 14:01:27 -07:00
Saleem Abdulrasool
a9df0bd302 Merge pull request #81008 from compnerd/clean
utils: make `-Clean` be fully clean
2025-04-23 09:39:05 -07:00
Saleem Abdulrasool
e444755785 utils: correct the logging for Get-Dependencies
`Fetch-Dependencies` was renamed but we did not fully rename the
references. Update the straggling instance of the old name which was
used in logging.
2025-04-22 14:58:29 -07:00
Saleem Abdulrasool
3f11375c12 utils: make -Clean be fully clean
`-Clean` has generally been a psuedo-clean operation. It will clear out
the build trees excluding the costly compiler build. With the ability to
use caching now, make `-Clean` a fully clean build.
2025-04-22 14:57:48 -07:00
Evan Wilde
3d43e1accc Merge pull request #80918 from etcwilde/ewilde/use-installed-cmake-ninja
Windows: Use pre-installed CMake and Ninja
2025-04-19 11:07:35 -07:00
Evan Wilde
b15303d1b4 Windows: Use pre-installed CMake and Ninja
Teach build.ps1 to search for a pre-installed CMake and Ninja from the
PATH instead of only using one installed in Visual Studio. If one is not
installed or on the path, the script will attempt to use one installed
in Visual Studio. Preference is given to the executable found in the
path environment variable.
2025-04-18 17:50:53 -07:00
Alastair Houghton
2bf57d7bc6 [Windows] Fix build issues.
Fix build.ps1 to work properly for the experimental runtime build on
platforms other than x86-64.

Also fix the ToBatch option to mostly work.
2025-04-17 12:12:48 +01:00
Saleem Abdulrasool
37b35e8167 utils: remove -BuildTo feature from build.ps1
This feature never really was used in the CI systems as it was intended.
It was meant to allow doing partial builds for smoke testing. However,
we have a much better solution for that now: docker. Remove this feature
that is underutilized.
2025-04-16 14:19:33 -07:00
Mishal Shah
d8918ceab9 Merge pull request #80803 from compnerd/timing
utils: add `--time-tests` to lit invocation
2025-04-14 21:40:37 -07:00
Saleem Abdulrasool
81e034567d utils: add --time-tests to lit invocation
Try to extract more timing information about the tests to understand CI
times better.
2025-04-14 12:49:20 -07:00
Saleem Abdulrasool
3546c33ac8 Merge pull request #80752 from compnerd/staging
utils: correctly stage MSMs for Windows Runtime
2025-04-12 23:10:08 +03:00
Saleem Abdulrasool
1c2cc68891 utils: correctly stage MSMs for Windows Runtime
Ensure that we stage all the MSMs for the Windows Runtime distribution.
This enables us to consider online installers which would allow users to
select subsets of the installer to download when needed.
2025-04-11 16:05:45 -07:00
Saleem Abdulrasool
f6c63d4869 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-04-11 15:56:54 -07:00
Saleem Abdulrasool
96ccca62d5 utils: remove mimalloc workaround
Remove a workaround for the ARM64 toolchain when built with mimalloc
which would previously have an erroneous reference to the x64
interceptor.
2025-04-09 09:53:43 -07:00
Saleem Abdulrasool
b36cee28a6 Merge pull request #80611 from compnerd/installer
utils: update the installer build invocation
2025-04-09 17:39:05 +03:00
Saleem Abdulrasool
89091904d7 Merge pull request #80609 from compnerd/case
utils: adjust the emission of `SDKSettings.json`. Use lowercase spellings for the platform names to match SwiftBuild's expectations as pointed out by @jakepetroules.
2025-04-09 02:37:43 +03:00
Saleem Abdulrasool
b33be25549 Merge pull request #80441 from brianmichel/brian/always-restore-env-variables
Always restore old env variables
2025-04-08 10:35:23 +03:00
Brian Michel
07dac7b5c5 Update utils/build.ps1
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2025-04-07 17:01:28 -04:00
Saleem Abdulrasool
b264ff8a15 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-07 12:31:24 -07:00
Saleem Abdulrasool
c3d7c9dc5f utils: print SCCache summary in summary view
This prints the stats for SCCache in the build as well to help
understand cache utilisation.
2025-04-07 12:30:41 -07:00
Saleem Abdulrasool
5d5fff9fc0 utils: adjust the emission of SDKSettings.json
Address the feedback from @jakepetroules about cases.
2025-04-07 12:29:35 -07:00
Saleem Abdulrasool
a20b568c07 Merge pull request #80157 from compnerd/helper
utils: extract `Build-SDK` helper
2025-04-07 18:19:29 +03:00
Brian Michel
c9437b522b Always restore old env variables
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.
2025-04-01 12:32:19 -04: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
Saleem Abdulrasool
78a2057934 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-03-28 20:28:22 -07: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
Jeff
828a3470e8 utils: Add back missing ToolchainInstallRoot properties. 2025-03-25 21:43:36 -07:00
Jeff
f3c95329bc PR Feedback. 2025-03-24 13:28:44 -07:00
Jeff
498f8f7909 Add fixme. 2025-03-21 11:05:15 -07:00
Jeff
dd6f1c29b3 Fix missing param. 2025-03-21 10:18:44 -07:00
Jeff
b150d4c94e PR Feedback 2. 2025-03-20 21:57:27 -07:00
Jeff
3daeb9c7b9 PR Feedback. 2025-03-20 17:08:41 -07:00
Jeff
643f904353 utils: Handle additional args to Invoke-BuildStep in build.ps1. 2025-03-20 15:17:27 -07:00
Jeff
ad744421fd utils: Convert build.ps1 to use Platform definitions. 2025-03-20 15:17:25 -07:00
Saleem Abdulrasool
1289c9614e Merge pull request #80092 from compnerd/versioning
utils: version testing frameworks
2025-03-20 10:20:40 -07:00
Saleem Abdulrasool
1e74bdffa0 Merge branch 'main' into timing 2025-03-19 22:28:46 -07:00
Saleem Abdulrasool
8e10b00984 Merge pull request #80148 from weliveindetail/windrd-unblock-nightly
utils: temporarily ignore test failure for Android runtimes
2025-03-19 21:42:57 -07:00
Saleem Abdulrasool
1b1274f7c1 Merge pull request #80125 from hjyamauchi/foundationmacros
Fix FoundationMacro build failure in ARM64 cross-build
2025-03-19 20:13:36 -07:00
Saleem Abdulrasool
440ebee0bb utils: collect more build times
Add time collection for the test execution. This will allow us to
immediately see in the summary the time expenditure.
2025-03-19 16:54:43 -07:00
Saleem Abdulrasool
89e9681592 utils: remove extra timing data collection
The timing data collection is now homed under `Invoke-BuildStep`.
`Build-SPMProject` is an implementation detail of the build step and is
timed at a higher level.
2025-03-19 16:53:35 -07:00