Skip to content

Commit 71573ff

Browse files
Merge remote-tracking branch 'upstream/main' into macos-arm64-pipx
2 parents 38047c6 + c910aa4 commit 71573ff

17 files changed

+141
-105
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ To build a VM machine from this repo's source, see the [instructions](docs/creat
1919

2020
## Available Images
2121

22-
| Image | YAML Label | Included Software |
23-
| --------------------|---------------------|--------------------|
24-
| Ubuntu 22.04 | `ubuntu-latest` or `ubuntu-22.04` | [ubuntu-22.04] |
25-
| Ubuntu 20.04 | `ubuntu-20.04` | [ubuntu-20.04] |
26-
| macOS 14 [beta] | `macos-14-large`| [macOS-14] |
27-
| macOS 14 Arm64 [beta] | `macos-14` or `macos-14-xlarge`| [macOS-14-arm64] |
28-
| macOS 13 | `macos-13`, `macos-13-large` or `macos-latest-large` | [macOS-13] |
29-
| macOS 13 Arm64 | `macos-13-xlarge` | [macOS-13-arm64] |
30-
| macOS 12 | `macos-latest`,`macos-12` or`macos-12-large`| [macOS-12] |
31-
| macOS 11 [deprecated] | `macos-11`| [macOS-11] |
32-
| Windows Server 2022 | `windows-latest` or `windows-2022` | [windows-2022] |
33-
| Windows Server 2019 | `windows-2019` | [windows-2019] |
22+
| Image | YAML Label | Included Software | Rollout Status of Latest Image Release |
23+
| --------------------|---------------------|--------------------|--------------------|
24+
| Ubuntu 22.04 | `ubuntu-latest` or `ubuntu-22.04` | [ubuntu-22.04] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2Fubuntu22.json) |
25+
| Ubuntu 20.04 | `ubuntu-20.04` | [ubuntu-20.04] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2Fubuntu20.json) |
26+
| macOS 14 [beta] | `macos-14-large`| [macOS-14] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2Fmacos-14.json) |
27+
| macOS 14 Arm64 [beta] | `macos-14` or `macos-14-xlarge`| [macOS-14-arm64] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2Fmacos-14-arm64.json) |
28+
| macOS 13 | `macos-13`, `macos-13-large` or `macos-latest-large` | [macOS-13] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2Fmacos-13.json) |
29+
| macOS 13 Arm64 | `macos-13-xlarge` | [macOS-13-arm64] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2Fmacos-13-arm64.json) |
30+
| macOS 12 | `macos-latest`,`macos-12` or`macos-12-large`| [macOS-12] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2FmacOS-12.json) |
31+
| macOS 11 [deprecated] | `macos-11`| [macOS-11] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2FmacOS-11.json) |
32+
| Windows Server 2022 | `windows-latest` or `windows-2022` | [windows-2022] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2Fwin22.json) |
33+
| Windows Server 2019 | `windows-2019` | [windows-2019] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fmikhailkoliada%2F35b243dd6e217d041fe3dfa5b4e2e2ed%2Fraw%2Fwin19.json) |
3434

3535
### Label scheme
3636

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
################################################################################
2+
## File: Configure-Xcode-Simulators.ps1
3+
## Team: CI-Build
4+
## Desc: CHeck and remove duplicate simulators
5+
################################################################################
6+
7+
Import-Module "~/image-generation/helpers/Common.Helpers.psm1"
8+
Import-Module "~/image-generation/helpers/Xcode.Helpers.psm1"
9+
$arch = Get-Architecture
10+
$xcodeVersions = (Get-ToolsetContent).xcode.${arch}.versions
11+
12+
# Switch to each Xcode version
13+
foreach ($xcodeVersion in $xcodeVersions.link) {
14+
write-host "Switching to Xcode $xcodeVersion"
15+
Switch-Xcode -Version $XcodeVersion
16+
17+
# Make object of all simulators
18+
$devicesList = $(xcrun simctl list -j devices | ConvertFrom-Json)
19+
$devicesObject = [System.Collections.ArrayList]@()
20+
foreach ($runtime in $devicesList.devices.psobject.Properties.name) {
21+
foreach ($device in $devicesList.devices.$runtime) {
22+
$devicesObject += [PSCustomObject]@{
23+
runtime = $runtime
24+
DeviceName = $($device.name)
25+
DeviceId = $($device.udid)
26+
DeviceCreationTime = (Get-Item $HOME/Library/Developer/CoreSimulator/Devices/$($device.udid)).CreationTime
27+
}
28+
}
29+
}
30+
31+
# Remove duplicates
32+
foreach ($simRuntume in $devicesObject.runtime | Sort-Object -Unique) {
33+
[System.Collections.ArrayList]$sameRuntimeDevices = [array]$($devicesObject | Where-Object {$_.runtime -eq $simRuntume} | Sort-Object -Property DeviceName)
34+
Write-Host "///////////////////////////////////////////////////////////////////"
35+
Write-Host "// Checking for duplicates in $simRuntume "
36+
$devicesAsHashTable = $sameRuntimeDevices | Group-Object -Property DeviceName -AsHashTable -AsString
37+
foreach ($key in $devicesAsHashTable.Keys) {
38+
if ( $devicesAsHashTable[$key].count -gt 1) {
39+
Write-Host "// Duplicates for $key - $($devicesAsHashTable[$key].count)"
40+
}
41+
}
42+
Write-Host "///////////////////////////////////////////////////////////////////"
43+
for ($i = 0; $i -lt $sameRuntimeDevices.Count; $i++) {
44+
if ( [string]::IsNullOrEmpty($($sameRuntimeDevices[$i+1].DeviceName)) ){
45+
Write-Host "No more devices to compare in $simRuntume"
46+
Write-Host "-------------------------------------------------------------------"
47+
continue
48+
}
49+
Write-Host "$($sameRuntimeDevices[$i].DeviceName) - DeviceId $($sameRuntimeDevices[$i].DeviceId) comparing with"
50+
Write-Host "$($sameRuntimeDevices[$i+1].DeviceName) - DeviceId $($sameRuntimeDevices[$i+1].DeviceId)"
51+
Write-Host "-------------------------------------------------------------------"
52+
if ($sameRuntimeDevices[$i].DeviceName -eq $sameRuntimeDevices[$i+1].DeviceName) {
53+
write-host "*******************************************************************"
54+
write-host "** Duplicate found"
55+
if ($sameRuntimeDevices[$i].DeviceCreationTime -lt $sameRuntimeDevices[$i+1].DeviceCreationTime) {
56+
Write-Host "** will be removed $($sameRuntimeDevices[$i+1].DeviceName) with id $($sameRuntimeDevices[$i+1].DeviceId)"
57+
xcrun simctl delete $sameRuntimeDevices[$i+1].DeviceId
58+
$sameRuntimeDevices.RemoveAt($i+1)
59+
} else {
60+
Write-Host "** will be removed $($sameRuntimeDevices[$i].DeviceName) with id $($sameRuntimeDevices[$i].DeviceId)"
61+
xcrun simctl delete $sameRuntimeDevices[$i].DeviceId
62+
$sameRuntimeDevices.RemoveAt($i)
63+
}
64+
write-host "*******************************************************************"
65+
}
66+
}
67+
}
68+
}

images/macos/scripts/build/install-audiodevice.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,4 @@ brew_smart_install "switchaudio-osx"
1212
echo "install sox"
1313
brew_smart_install "sox"
1414

15-
# Big Sur doesn't support soundflower installation without user interaction https://github.com/mattingalls/Soundflower/releases/tag/2.0b2
16-
# Install blackhole-2ch for Big Sur instead
17-
18-
echo "install blackhole-2ch"
19-
brew_smart_install "blackhole-2ch"
20-
21-
echo "set BlackHole 2ch as input/output device"
22-
SwitchAudioSource -s "BlackHole 2ch" -t input
23-
SwitchAudioSource -s "BlackHole 2ch" -t output
24-
2515
invoke_tests "System" "Audio Device"

images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ $packageManagement.AddToolVersion("Pip3", $(Get-PipVersion -Version 3))
9090
$packageManagement.AddToolVersion("Pipx", $(Get-PipxVersion))
9191

9292
$packageManagement.AddToolVersion("RubyGems", $(Get-RubyGemsVersion))
93-
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) {
93+
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSonoma)) {
9494
$packageManagement.AddToolVersion("Vcpkg", $(Get-VcpkgVersion))
9595
}
9696
$packageManagement.AddToolVersion("Yarn", $(Get-YarnVersion))

images/macos/scripts/tests/Common.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Describe "GCC" {
3333
}
3434
}
3535

36-
Describe "vcpkg" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
36+
Describe "vcpkg" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSonoma) {
3737
It "vcpkg" {
3838
"vcpkg version" | Should -ReturnZeroExitCode
3939
}

images/macos/scripts/tests/System.Tests.ps1

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ Describe "Audio device" -Skip:($os.IsVentura -or $os.IsSonoma) {
3333
It "SwitchAudioSource is installed" {
3434
"SwitchAudioSource -c" | Should -ReturnZeroExitCode
3535
}
36-
37-
It "Audio channel BlackHole 2ch" {
38-
SwitchAudioSource -c | Should -BeLikeExactly "BlackHole 2ch"
39-
}
4036
}
4137

4238
Describe "Screen Resolution" -Skip:(isVeertu) {

images/macos/templates/macOS-13.anka.pkr.hcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,9 @@ build {
260260
}
261261

262262
provisioner "shell" {
263-
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
264-
script = "${path.root}/../scripts/build/configure-xcode-simulators.rb"
263+
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
264+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
265+
script = "${path.root}/../scripts/build/Configure-Xcode-Simulators.ps1"
265266
}
266267

267268
provisioner "shell" {

images/macos/templates/macOS-13.arm64.anka.pkr.hcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ build {
256256
}
257257

258258
provisioner "shell" {
259-
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
260-
script = "${path.root}/../scripts/build/configure-xcode-simulators.rb"
259+
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
260+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
261+
script = "${path.root}/../scripts/build/Configure-Xcode-Simulators.ps1"
261262
}
262263

263264
provisioner "shell" {

images/macos/templates/macOS-14.anka.pkr.hcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ build {
239239
"${path.root}/../scripts/build/install-gcc.sh",
240240
"${path.root}/../scripts/build/install-cocoapods.sh",
241241
"${path.root}/../scripts/build/install-android-sdk.sh",
242-
"${path.root}/../scripts/build/install-vcpkg.sh",
243242
"${path.root}/../scripts/build/install-safari.sh",
244243
"${path.root}/../scripts/build/install-chrome.sh",
245244
"${path.root}/../scripts/build/install-edge.sh",
@@ -260,8 +259,9 @@ build {
260259
}
261260

262261
provisioner "shell" {
263-
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
264-
script = "${path.root}/../scripts/build/configure-xcode-simulators.rb"
262+
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
263+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
264+
script = "${path.root}/../scripts/build/Configure-Xcode-Simulators.ps1"
265265
}
266266

267267
provisioner "shell" {

images/macos/templates/macOS-14.arm64.anka.pkr.hcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ build {
256256
}
257257

258258
provisioner "shell" {
259-
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
260-
script = "${path.root}/../scripts/build/configure-xcode-simulators.rb"
259+
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
260+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
261+
script = "${path.root}/../scripts/build/Configure-Xcode-Simulators.ps1"
261262
}
262263

263264
provisioner "shell" {

0 commit comments

Comments
 (0)