Skip to content

Commit e33bf2a

Browse files
authored
Merge pull request #80012 from jeffdav/win-build-validate-pinned-params
utils: Validate Pinned params in build.ps1.
2 parents bb6dcef + 3178976 commit e33bf2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils/build.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ $env:SDKROOT = ""
184184

185185
$BuildArchName = if ($env:PROCESSOR_ARCHITEW6432) { $env:PROCESSOR_ARCHITEW6432 } else { $env:PROCESSOR_ARCHITECTURE }
186186

187-
if ($PinnedBuild -eq "") {
187+
# Validate that if one is set all are set.
188+
if (($PinnedBuild -or $PinnedSHA256 -or $PinnedVersion) -and -not ($PinnedBuild -and $PinnedSHA256 -and $PinnedVersion)) {
189+
throw "If any of PinnedBuild, PinnedSHA256, or PinnedVersion is set, all three must be set."
190+
}
191+
192+
if (-not $PinnedBuild) {
188193
switch ($BuildArchName) {
189194
"AMD64" {
190195
$PinnedBuild = "https://download.swift.org/swift-6.0.3-release/windows10/swift-6.0.3-RELEASE/swift-6.0.3-RELEASE-windows10.exe"

0 commit comments

Comments
 (0)