Skip to content

[windows] add a parameter to skip building experimental SDKs in build.ps1 #83455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions utils/build-windows-toolchain.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ mkdir %TEMP% 2>&1 1>nul
echo set PYTHON_HOME=%PYTHON_HOME%> %TEMP%\call-build.cmd
echo set SKIP_TESTS=%SKIP_TESTS%>> %TEMP%\call-build.cmd
echo set SKIP_PACKAGING=%SKIP_PACKAGING%>> %TEMP%\call-build.cmd
echo set SKIP_EXPERIMENTAL_SDK=%SKIP_EXPERIMENTAL_SDK%>> %TEMP%\call-build.cmd
echo set SKIP_UPDATE_CHECKOUT=%SKIP_UPDATE_CHECKOUT%>> %TEMP%\call-build.cmd
echo set REPO_SCHEME=%REPO_SCHEME%>> %TEMP%\call-build.cmd
echo set WINDOWS_SDKS=%WINDOWS_SDKS%>> %TEMP%\call-build.cmd
Expand Down Expand Up @@ -73,6 +74,10 @@ if not "%SKIP_PACKAGING%"=="1" set "SkipPackagingArg= "
set "WindowsSDKsArg= "
if not "%WINDOWS_SDKS%"=="" set "WindowsSDKsArg=-WindowsSDKs %WINDOWS_SDKS%"

:: Build the -SkipExperimentalSDK argument, if any
set SkipExperimentalSDKArg=-SkipExperimentalSDK
if not "%SKIP_EXPERIMENTAL_SDK%"=="1" set "SkipExperimentalSDKArg= "

call :CloneRepositories || (exit /b 1)

:: We only have write access to BuildRoot, so use that as the image root.
Expand All @@ -81,6 +86,7 @@ powershell.exe -ExecutionPolicy RemoteSigned -File %~dp0build.ps1 ^
-BinaryCache %BuildRoot% ^
-ImageRoot %BuildRoot% ^
%SkipPackagingArg% ^
%SkipExperimentalSDKArg% ^
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we cannot skip these in this test. This is used for the PR testing and we want to maintain that these are tested - they build differently and are very easy to regress because they are building static libraries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify: we would only deactivate this when running the lldb specific bots. The current Swift PR bots would still run those tests. Nothing would change for the current bots, it would only affect the new bots.

%WindowsSDKsArg% ^
%TestArg% ^
-Stage %PackageRoot% ^
Expand Down
9 changes: 8 additions & 1 deletion utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ This component is currently only supported in Android builds.
If set, does not run the build phase.

.PARAMETER SkipPackaging
If set, skips building the msi's and installer
If set, skips building the msi's and installer.

.PARAMETER SkipExperimentalSDK
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this should be another parameter. Perhaps we can handle this uniformly with -SDK; this does however make testing harder.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking a bit about this - it would actually be helpful to have this functionality more generically: we should be able to disable the non-experimental SDK bits more than the experimental SDK bits. The experimental SDK is what will become the default. That would also help with testing; perhaps we can have something clever as the specifier in the -WindowsSDKs and -AndroidSDKs to control which SDK and architectures we support. I would be open to renaming the options btw, they currently control the architectures in the SDK, not the SDKs. If we can simplify the logic for the handling, perhaps something like:

-AndroidSDKs experimental -AndroidSDKArchitectures aarch64 -WindowsSDKs default,experimental -WindowsSDKArchitectures arm64,x64

If set, skips building the experimental SDKs.

.PARAMETER DebugInfo
If set, debug information will be generated for the builds.
Expand Down Expand Up @@ -137,6 +140,7 @@ param
[switch] $Android = $false,
[switch] $SkipBuild = $false,
[switch] $SkipPackaging = $false,
[switch] $SkipExperimentalSDK = $false,
[switch] $IncludeDS2 = $false,
[string[]] $Test = @(),
[string] $Stage = "",
Expand Down Expand Up @@ -2942,6 +2946,9 @@ function Build-SDK([Hashtable] $Platform, [switch] $IncludeMacros = $false) {
}

function Build-ExperimentalSDK([Hashtable] $Platform) {
if ($SkipExperimentalSDK) {
return
}
# TODO(compnerd) we currently build the experimental SDK with just the static
# variant. We should aim to build both dynamic and static variants.
Invoke-BuildStep Build-ExperimentalRuntime $Platform -Static
Expand Down