Install Metal toolchain for Xcode 26 and newer (#268)

* Install Metal toolchain when Xcode version is 26 or newer

* Define a variable rather than using a regex

* Provide the Xcode components as a list

* Use “shell” rather than “provisioner”

* Update .ci/cirrus.xcode.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Tony Arnold 2025-08-26 22:05:50 +10:00 committed by GitHub
parent 6f8ae07451
commit fe19dc9f17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View File

@ -5,6 +5,7 @@ task:
matrix:
- MACOS_VERSION: tahoe
XCODE_VERSION: 26-beta-6
XCODE_COMPONENTS: "MetalToolchain"
LATEST: true
- MACOS_VERSION: sequoia
XCODE_VERSION: 16.4
@ -32,7 +33,7 @@ task:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
build_xcode_script:
- packer init templates/xcode.pkr.hcl
- packer build -var macos_version="$MACOS_VERSION" -var xcode_version="[\"$XCODE_VERSION\"]" templates/xcode.pkr.hcl
- packer build -var macos_version="$MACOS_VERSION" -var xcode_version="[\"$XCODE_VERSION\"]" -var xcode_components="[\"$XCODE_COMPONENTS\"]" templates/xcode.pkr.hcl
push_script: |
if [[ -z "$LATEST" ]]
then

View File

@ -20,6 +20,12 @@ variable "additional_ios_builds" {
default = []
}
variable "xcode_components" {
type = list(string)
default = []
description = "Additional Xcode components to download."
}
variable "expected_runtimes_file" {
type = string
default = ""
@ -194,6 +200,15 @@ build {
)
}
dynamic "shell" {
inline = concat(
["source ~/.zprofile"],
[
for component in var.xcode_components : "xcodebuild -downloadComponent ${component}"
]
)
}
provisioner "shell" {
inline = [
"source ~/.zprofile",