Skip to content

Commit 9f81916

Browse files
macos-13: update XCode-15 to Beta 6 (#8076)
1 parent 982d4ab commit 9f81916

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

images/macos/helpers/Common.Helpers.psm1

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,38 @@ function Invoke-RestMethodWithRetry {
8686
function Invoke-ValidateCommand {
8787
param(
8888
[Parameter(Mandatory)]
89-
[string]$Command
89+
[string]$Command,
90+
[Uint] $Timeout = 0
9091
)
9192

92-
$output = Invoke-Expression -Command $Command
93-
if ($LASTEXITCODE -ne 0) {
94-
throw "Command '$Command' has finished with exit code $LASTEXITCODE"
93+
if ($Timeout -eq 0)
94+
{
95+
$output = Invoke-Expression -Command $Command
96+
if ($LASTEXITCODE -ne 0) {
97+
throw "Command '$Command' has finished with exit code $LASTEXITCODE"
98+
}
99+
return $output
100+
}
101+
else
102+
{
103+
$job = $command | Start-Job -ScriptBlock {
104+
$output = Invoke-Expression -Command $input
105+
if ($LASTEXITCODE -ne 0) {
106+
throw 'Command failed'
107+
}
108+
return $output
109+
}
110+
$waitObject = $job | Wait-Job -Timeout $Timeout
111+
if(-not $waitObject)
112+
{
113+
throw "Command '$Command' has timed out"
114+
}
115+
if($waitObject.State -eq 'Failed')
116+
{
117+
throw "Command '$Command' has failed"
118+
}
119+
Receive-Job -Job $job
95120
}
96-
return $output
97121
}
98122

99123
function Start-DownloadWithRetry {

images/macos/helpers/Xcode.Installer.psm1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,7 @@ function Approve-XcodeLicense {
129129
$XcodeRootPath = Get-XcodeRootPath -Version $Version
130130
Write-Host "Approving Xcode license for '$XcodeRootPath'..."
131131
$xcodeBuildPath = Get-XcodeToolPath -XcodeRootPath $XcodeRootPath -ToolName "xcodebuild"
132-
try {
133-
Invoke-Expression -Command "sudo $xcodeBuildPath -license accept" 2>&1 | Out-Null
134-
} catch { }
135-
132+
Invoke-ValidateCommand -Command "sudo $xcodeBuildPath -license accept" -Timeout 15
136133
}
137134

138135
function Install-XcodeAdditionalPackages {

images/macos/toolsets/toolset-13.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"default": "14.2",
44
"x64": {
55
"versions": [
6-
{ "link": "15.0", "version": "15.0.0-Beta.5+15A5209g" },
6+
{ "link": "15.0", "version": "15.0.0-Beta.6+15A5219j" },
77
{ "link": "14.3.1", "version": "14.3.1+14E300c" },
88
{ "link": "14.3", "version": "14.3.0+14E222b" },
99
{ "link": "14.2", "version": "14.2.0+14C18" },
@@ -12,7 +12,7 @@
1212
},
1313
"arm64":{
1414
"versions": [
15-
{ "link": "15.0", "version": "15.0.0-Beta.5+15A5209g" },
15+
{ "link": "15.0", "version": "15.0.0-Beta.6+15A5219j" },
1616
{ "link": "14.3.1", "version": "14.3.1+14E300c" },
1717
{ "link": "14.3", "version": "14.3.0+14E222b" },
1818
{ "link": "14.2", "version": "14.2.0+14C18" },

0 commit comments

Comments
 (0)