Skip to content

Commit 0944fa4

Browse files
authored
Merge pull request #78933 from compnerd/cleanliness-and-order
utils: adjust the `-Clean` option to clean before execution
2 parents 9966e01 + 877c53a commit 0944fa4

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

utils/build.ps1

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,6 +2784,19 @@ try {
27842784

27852785
Fetch-Dependencies
27862786

2787+
if ($Clean) {
2788+
10..[HostComponent].getEnumValues()[-1] | ForEach-Object { Remove-Item -Force -Recurse "$BinaryCache\$_" -ErrorAction Ignore }
2789+
# In case of a previous test run, clear out the swiftmodules as they are not a stable format.
2790+
Remove-Item -Force -Recurse -Path "$($HostARch.ToolchainInstallRoot)\usr\lib\swift\windows\*.swiftmodule" -ErrorAction Ignore
2791+
foreach ($Arch in $WindowsSDKArchs) {
2792+
0..[TargetComponent].getEnumValues()[-1] | ForEach-Object { Remove-Item -Force -Recurse "$BinaryCache\$($Arch.BuildID + $_)" -ErrorAction Ignore }
2793+
}
2794+
foreach ($Arch in $AndroidSDKArchs) {
2795+
0..[TargetComponent].getEnumValues()[-1] | ForEach-Object { Remove-Item -Force -Recurse "$BinaryCache\$($Arch.BuildID + $_)" -ErrorAction Ignore }
2796+
}
2797+
}
2798+
2799+
27872800
if (-not $SkipBuild) {
27882801
if ($EnableCaching -And (-Not (Test-SCCacheAtLeast -Major 0 -Minor 7 -Patch 4))) {
27892802
throw "Minimum required sccache version is 0.7.4"
@@ -2804,18 +2817,6 @@ if (-not $SkipBuild) {
28042817
Invoke-BuildStep Build-Compilers $HostArch
28052818
}
28062819

2807-
if ($Clean) {
2808-
10..[HostComponent].getEnumValues()[-1] | ForEach-Object { Remove-Item -Force -Recurse "$BinaryCache\$_" -ErrorAction Ignore }
2809-
# In case of a previous test run, clear out the swiftmodules as they are not a stable format.
2810-
Remove-Item -Force -Recurse "$($HostARch.ToolchainInstallRoot)\usr\lib\swift\windows" -ErrorAction Ignore
2811-
foreach ($Arch in $WindowsSDKArchs) {
2812-
0..[TargetComponent].getEnumValues()[-1] | ForEach-Object { Remove-Item -Force -Recurse "$BinaryCache\$($Arch.BuildID + $_)" -ErrorAction Ignore }
2813-
}
2814-
foreach ($Arch in $AndroidSDKArchs) {
2815-
0..[TargetComponent].getEnumValues()[-1] | ForEach-Object { Remove-Item -Force -Recurse "$BinaryCache\$($Arch.BuildID + $_)" -ErrorAction Ignore }
2816-
}
2817-
}
2818-
28192820
if (-not $SkipBuild) {
28202821
foreach ($Arch in $WindowsSDKArchs) {
28212822
Invoke-BuildStep Build-ZLib Windows $Arch

0 commit comments

Comments
 (0)