Skip to content

Commit 62ff7d8

Browse files
Merge pull request #86109 from charles-zablit/charles-zablit/windows/fix-sccache-arm64
[windows] fix build.ps1 sccache expansion on ARM64
2 parents 09a1294 + 5380e7f commit 62ff7d8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

utils/build.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,7 @@ function Get-Dependencies {
12231223
param
12241224
(
12251225
[string]$SourceName,
1226+
[string]$BinaryCache,
12261227
[string]$DestinationName
12271228
)
12281229
$Source = Join-Path -Path $BinaryCache -ChildPath $SourceName
@@ -1369,12 +1370,14 @@ function Get-Dependencies {
13691370

13701371
if ($EnableCaching) {
13711372
$SCCache = Get-SCCache
1372-
$FileExtension = [System.IO.Path]::GetExtension($SCCache.URL)
1373-
DownloadAndVerify $SCCache.URL "$BinaryCache\sccache-$SCCacheVersion.$FileExtension" $SCCache.SHA256
1374-
if ($FileExtension -eq "tar.gz") {
1375-
Expand-TapeArchive sccache-$SCCacheVersion.$FileExtension $BinaryCache sccache-$SCCacheVersion
1373+
$FileExtension = if ($SCCache.URL -match '/[^/]+(\..+)$') { $Matches[1] } else {
1374+
throw "Invalid sccache URL"
1375+
}
1376+
DownloadAndVerify $SCCache.URL "$BinaryCache\sccache-$SCCacheVersion$FileExtension" $SCCache.SHA256
1377+
if ($FileExtension -eq ".tar.gz") {
1378+
Expand-TapeArchive "sccache-$SCCacheVersion$FileExtension" $BinaryCache "sccache-$SCCacheVersion"
13761379
} else {
1377-
Expand-ZipFile sccache-$SCCacheVersion.$FileExtension $BinaryCache sccache-$SCCacheVersion
1380+
Expand-ZipFile "sccache-$SCCacheVersion$FileExtension" $BinaryCache "sccache-$SCCacheVersion"
13781381
}
13791382
Write-Success "sccache $SCCacheVersion"
13801383
}

0 commit comments

Comments
 (0)