Skip to content

Commit 76ae4ed

Browse files
committed
utils: add a workaround for the nightly toolchains
The nightly toolchains on Windows improperly versioned the installation to 6.0.0 (which would collide with an official 6.0.0 release 😱). In order to use the toolchain as a pinned toolchain we need to account for the path change. Add a workaround to allow using the extracted toolchain snapshot.
1 parent 725bd91 commit 76ae4ed

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utils/build.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,16 @@ function Fetch-Dependencies {
934934
}
935935

936936
function Get-PinnedToolchainTool() {
937+
# NOTE: add a workaround for the main snapshots that used the wrong version
938+
# when building that was not noticed. This allows use of the nightly snapshot
939+
# as a pinned toolchain.
940+
if ((Get-PinnedToolchainVersion) -eq "0.0.0") {
941+
if (-not (Test-Path "$BinaryCache\toolchains\${PinnedToolchain}\LocalApp\Programs\Swift\Toolchains\0.0.0+Asserts\usr\bin")) {
942+
if (Test-Path "$BinaryCache\toolchains\${PinnedToolchain}\LocalApp\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin") {
943+
return "$BinaryCache\toolchains\${PinnedToolchain}\LocalApp\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin"
944+
}
945+
}
946+
}
937947
if (Test-Path "$BinaryCache\toolchains\${PinnedToolchain}\LocalApp\Programs\Swift\Toolchains\$(Get-PinnedToolchainVersion)+Asserts\usr\bin") {
938948
return "$BinaryCache\toolchains\${PinnedToolchain}\LocalApp\Programs\Swift\Toolchains\$(Get-PinnedToolchainVersion)+Asserts\usr\bin"
939949
}

0 commit comments

Comments
 (0)