[macOS] Add toolcache to the macOS 14 (#9274)

This commit is contained in:
Alexey-Ayupov
2024-02-05 18:16:30 +01:00
committed by GitHub
parent 3387580469
commit 33261492c5
6 changed files with 118 additions and 23 deletions

View File

@@ -216,27 +216,26 @@ $java = $installedSoftware.AddHeader("Java")
$java.AddTable($(Get-JavaVersions)) $java.AddTable($(Get-JavaVersions))
# Toolcache # Toolcache
if (-not $os.IsSonoma) {
$toolcache = $installedSoftware.AddHeader("Cached Tools")
$toolcache.AddNodes($(Build-ToolcacheSection))
# Rust $toolcache = $installedSoftware.AddHeader("Cached Tools")
$rust = $installedSoftware.AddHeader("Rust Tools") $toolcache.AddNodes($(Build-ToolcacheSection))
$rust.AddToolVersion("Cargo", $(Get-RustCargoVersion))
$rust.AddToolVersion("Rust", $(Get-RustVersion))
$rust.AddToolVersion("Rustdoc", $(Get-RustdocVersion))
$rust.AddToolVersion("Rustup", $(Get-RustupVersion))
$rustPackages = $rust.AddHeader("Packages") # Rust
if (-not $os.IsVentura) { $rust = $installedSoftware.AddHeader("Rust Tools")
$rustPackages.AddToolVersion("Bindgen", $(Get-Bindgen)) $rust.AddToolVersion("Cargo", $(Get-RustCargoVersion))
$rustPackages.AddToolVersion("Cargo-audit", $(Get-Cargoaudit)) $rust.AddToolVersion("Rust", $(Get-RustVersion))
$rustPackages.AddToolVersion("Cargo-outdated", $(Get-Cargooutdated)) $rust.AddToolVersion("Rustdoc", $(Get-RustdocVersion))
$rustPackages.AddToolVersion("Cbindgen", $(Get-Cbindgen)) $rust.AddToolVersion("Rustup", $(Get-RustupVersion))
}
$rustPackages.AddToolVersion("Clippy", $(Get-RustClippyVersion)) $rustPackages = $rust.AddHeader("Packages")
$rustPackages.AddToolVersion("Rustfmt", $(Get-RustfmtVersion)) if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
$rustPackages.AddToolVersion("Bindgen", $(Get-Bindgen))
$rustPackages.AddToolVersion("Cargo-audit", $(Get-Cargoaudit))
$rustPackages.AddToolVersion("Cargo-outdated", $(Get-Cargooutdated))
$rustPackages.AddToolVersion("Cbindgen", $(Get-Cbindgen))
} }
$rustPackages.AddToolVersion("Clippy", $(Get-RustClippyVersion))
$rustPackages.AddToolVersion("Rustfmt", $(Get-RustfmtVersion))
# PowerShell # PowerShell
$powerShell = $installedSoftware.AddHeader("PowerShell Tools") $powerShell = $installedSoftware.AddHeader("PowerShell Tools")

View File

@@ -37,10 +37,14 @@ function Build-ToolcacheSection {
$nodes = @() $nodes = @()
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonoma)) {
$nodes += @(
[ToolVersionsListNode]::new("PyPy", $(Get-ToolcachePyPyVersions), '^\d+\.\d+', "List")
)
}
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) { if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) {
$nodes += @( $nodes += @(
[ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List"), [ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List")
[ToolVersionsListNode]::new("PyPy", $(Get-ToolcachePyPyVersions), '^\d+\.\d+', "List")
) )
} }

View File

@@ -99,7 +99,7 @@ Describe "Toolcache" {
} }
} }
} }
Context "PyPy" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) { Context "PyPy" -Skip:($os.IsVenturaArm64 -or $os.IsSonoma) {
$pypyDirectory = Join-Path $toolcacheDirectory "PyPy" $pypyDirectory = Join-Path $toolcacheDirectory "PyPy"
$pypyPackage = $packages | Where-Object { $_.ToolName -eq "pypy" } | Select-Object -First 1 $pypyPackage = $packages | Where-Object { $_.ToolName -eq "pypy" } | Select-Object -First 1
$testCase = @{ PypyDirectory = $pypyDirectory } $testCase = @{ PypyDirectory = $pypyDirectory }

View File

@@ -228,6 +228,15 @@ build {
] ]
} }
provisioner "shell" {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/Install-Toolset.ps1",
"${path.root}/../scripts/build/Configure-Toolset.ps1"
]
}
provisioner "shell" { provisioner "shell" {
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}" execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
script = "${path.root}/../scripts/build/configure-xcode-simulators.rb" script = "${path.root}/../scripts/build/configure-xcode-simulators.rb"
@@ -237,7 +246,8 @@ build {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"] environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
inline = [ inline = [
"pwsh -File \"${local.image_folder}/software-report/Generate-SoftwareReport.ps1\" -OutputDirectory \"${local.image_folder}/output/software-report\" -ImageName ${var.build_id}" "pwsh -File \"${local.image_folder}/software-report/Generate-SoftwareReport.ps1\" -OutputDirectory \"${local.image_folder}/output/software-report\" -ImageName ${var.build_id}",
"pwsh -File \"${local.image_folder}/tests/RunAll-Tests.ps1\""
] ]
} }

View File

@@ -223,6 +223,15 @@ build {
] ]
} }
provisioner "shell" {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/Install-Toolset.ps1",
"${path.root}/../scripts/build/Configure-Toolset.ps1"
]
}
provisioner "shell" { provisioner "shell" {
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}" execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
script = "${path.root}/../scripts/build/configure-xcode-simulators.rb" script = "${path.root}/../scripts/build/configure-xcode-simulators.rb"
@@ -232,7 +241,8 @@ build {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"] environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
inline = [ inline = [
"pwsh -File \"${local.image_folder}/software-report/Generate-SoftwareReport.ps1\" -OutputDirectory \"${local.image_folder}/output/software-report\" -ImageName ${var.build_id}" "pwsh -File \"${local.image_folder}/software-report/Generate-SoftwareReport.ps1\" -OutputDirectory \"${local.image_folder}/output/software-report\" -ImageName ${var.build_id}",
"pwsh -File \"${local.image_folder}/tests/RunAll-Tests.ps1\""
] ]
} }

View File

@@ -112,6 +112,78 @@
"fastlane" "fastlane"
] ]
}, },
"toolcache": [
{
"name": "Python",
"url" : "https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json",
"platform" : "darwin",
"arch": {
"x64": {
"versions": [
"3.11.*",
"3.12.*"
]
},
"arm64": {
"versions": [
"3.11.*",
"3.12.*"
]
}
}
},
{
"name": "Node",
"url" : "https://raw.githubusercontent.com/actions/node-versions/main/versions-manifest.json",
"platform" : "darwin",
"arch": {
"x64": {
"versions": [
"18.*",
"20.*"
]
},
"arm64": {
"versions": [
"18.*",
"20.*"
]
}
}
},
{
"name": "Go",
"url" : "https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json",
"platform" : "darwin",
"arch": {
"x64": {
"variable_template" : "GOROOT_{0}_{1}_X64",
"versions": [
"1.20.*",
"1.21.*"
]
},
"arm64": {
"variable_template" : "GOROOT_{0}_{1}_ARM64",
"versions": [
"1.20.*",
"1.21.*"
]
}
}
},
{
"name": "Ruby",
"arch": {
"x64": {
"versions": [
"3.0.*",
"3.1.*"
]
}
}
}
],
"go": { "go": {
"default": "1.20" "default": "1.20"
}, },