diff --git a/images/macos/scripts/build/configure-system.sh b/images/macos/scripts/build/configure-system.sh index 12545c7b4..6f945bfef 100644 --- a/images/macos/scripts/build/configure-system.sh +++ b/images/macos/scripts/build/configure-system.sh @@ -19,11 +19,12 @@ fi # Put documentation to $HOME root cp $HOME/image-generation/output/software-report/systeminfo.* $HOME/ -# Put build vm assets scripts to proper directory -mkdir -p /usr/local/opt/$USER/scripts -mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts - -find /usr/local/opt/$USER/scripts -type f -name "*\.sh" -exec chmod +x {} \; +# Put build vm assets (xamarin-selector) scripts to proper directory +if is_Monterey || is_Sonoma || is_Ventura; then + mkdir -p /usr/local/opt/$USER/scripts + mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts + find /usr/local/opt/$USER/scripts -type f -name "*\.sh" -exec chmod +x {} \; +fi # Remove fastlane cached cookie rm -rf ~/.fastlane diff --git a/images/macos/scripts/build/configure-tccdb-macos.sh b/images/macos/scripts/build/configure-tccdb-macos.sh index 66f046082..b9063d038 100644 --- a/images/macos/scripts/build/configure-tccdb-macos.sh +++ b/images/macos/scripts/build/configure-tccdb-macos.sh @@ -32,7 +32,7 @@ systemValuesArray=( "'kTCCServiceSystemPolicyNetworkVolumes','com.apple.Terminal',0,2,4,1,X'fade0c000000003000000001000000060000000200000012636f6d2e6170706c652e5465726d696e616c000000000003',NULL,0,'UNUSED',NULL,0,1678990068" ) for values in "${systemValuesArray[@]}"; do - if is_Sonoma; then + if is_Sonoma || is_Sequoia; then # TCC access table in Sonoma has extra 4 columns: pid, pid_version, boot_uuid, last_reminded configure_system_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}" else @@ -66,7 +66,7 @@ userValuesArray=( "'kTCCServiceAppleEvents','/usr/local/opt/runner/provisioner/provisioner',1,2,3,1,NULL,NULL,0,'com.apple.systemevents',X'fade0c000000003400000001000000060000000200000016636f6d2e6170706c652e73797374656d6576656e7473000000000003',NULL,1592919552" ) for values in "${userValuesArray[@]}"; do - if is_Sonoma; then + if is_Sonoma || is_Sequoia; then # TCC access table in Sonoma has extra 4 columns: pid, pid_version, boot_uuid, last_reminded configure_user_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}" else diff --git a/images/macos/scripts/build/install-bicep.sh b/images/macos/scripts/build/install-bicep.sh index 6a5a3ddb2..0ab263ed6 100644 --- a/images/macos/scripts/build/install-bicep.sh +++ b/images/macos/scripts/build/install-bicep.sh @@ -6,6 +6,11 @@ source ~/utils/utils.sh +if is_Sequoia; then + sudo rm -rf /Library/Developer/CommandLineTools + sudo xcode-select --install +fi + echo "Installing bicep cli..." brew tap azure/bicep brew_smart_install bicep diff --git a/images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1 b/images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1 index ff3bb0118..149793732 100644 --- a/images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1 +++ b/images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1 @@ -38,32 +38,34 @@ $languageAndRuntime.AddToolVersion("Bash", $(Get-BashVersion)) $languageAndRuntime.AddNodes($(Get-ClangLLVMVersions)) $languageAndRuntime.AddNodes($(Get-GccVersions)) $languageAndRuntime.AddNodes($(Get-FortranVersions)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $languageAndRuntime.AddToolVersion("Julia", $(Get-JuliaVersion)) } $languageAndRuntime.AddToolVersion("Kotlin", $(Get-KotlinVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $languageAndRuntime.AddToolVersion("Go", $(Get-GoVersion)) } -$languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion)) +if ((-not $os.IsSequoia)) { + $languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion)) +} $languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $languageAndRuntime.AddToolVersion("MSBuild", $(Get-MSBuildVersion)) $languageAndRuntime.AddToolVersion("NVM", $(Get-NVMVersion)) $languageAndRuntime.AddToolVersionsListInline("NVM - Cached node versions", $(Get-NVMNodeVersionList), '^\d+') } $languageAndRuntime.AddToolVersion("Perl", $(Get-PerlVersion)) -if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) { +if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) { $languageAndRuntime.AddToolVersion("PHP", $(Get-PHPVersion)) } -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $languageAndRuntime.AddToolVersion("Python", $(Get-PythonVersion)) } $languageAndRuntime.AddToolVersion("Python3", $(Get-Python3Version)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $languageAndRuntime.AddToolVersion("R", $(Get-RVersion)) } @@ -74,16 +76,18 @@ $packageManagement = $installedSoftware.AddHeader("Package Management") $packageManagement.AddToolVersion("Bundler", $(Get-BundlerVersion)) $packageManagement.AddToolVersion("Carthage", $(Get-CarthageVersion)) $packageManagement.AddToolVersion("CocoaPods", $(Get-CocoaPodsVersion)) -if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) { +if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) { $packageManagement.AddToolVersion("Composer", $(Get-ComposerVersion)) } $packageManagement.AddToolVersion("Homebrew", $(Get-HomebrewVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $packageManagement.AddToolVersion("Miniconda", $(Get-CondaVersion)) } $packageManagement.AddToolVersion("NPM", $(Get-NPMVersion)) -$packageManagement.AddToolVersion("NuGet", $(Get-NuGetVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsSequoia)) { + $packageManagement.AddToolVersion("NuGet", $(Get-NuGetVersion)) +} +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $packageManagement.AddToolVersion("Pip", $(Get-PipVersion -Version 2)) } @@ -91,12 +95,12 @@ $packageManagement.AddToolVersion("Pip3", $(Get-PipVersion -Version 3)) $packageManagement.AddToolVersion("Pipx", $(Get-PipxVersion)) $packageManagement.AddToolVersion("RubyGems", $(Get-RubyGemsVersion)) -if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $packageManagement.AddToolVersion("Vcpkg", $(Get-VcpkgVersion)) } $packageManagement.AddToolVersion("Yarn", $(Get-YarnVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $packageManagement.AddNode($(Build-PackageManagementEnvironmentTable)) } # Project Management @@ -104,7 +108,7 @@ $projectManagement = $installedSoftware.AddHeader("Project Management") $projectManagement.AddToolVersion("Apache Ant", $(Get-ApacheAntVersion)) $projectManagement.AddToolVersion("Apache Maven", $(Get-MavenVersion)) $projectManagement.AddToolVersion("Gradle", $(Get-GradleVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $projectManagement.AddToolVersion("Sbt", $(Get-SbtVersion)) } @@ -123,18 +127,18 @@ $utilities.AddToolVersion("GitHub CLI", $(Get-GitHubCLIVersion)) $utilities.AddToolVersion("GNU Tar", $(Get-GnuTarVersion)) $utilities.AddToolVersion("GNU Wget", $(Get-WgetVersion)) $utilities.AddToolVersion("gpg (GnuPG)", $(Get-GPGVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $utilities.AddToolVersion("ImageMagick", $(Get-ImageMagickVersion)) } $utilities.AddToolVersion("jq", $(Get-JqVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $utilities.AddToolVersion("mongo", $(Get-MongoVersion)) $utilities.AddToolVersion("mongod", $(Get-MongodVersion)) } $utilities.AddToolVersion("OpenSSL", $(Get-OpenSSLVersion)) $utilities.AddToolVersion("Packer", $(Get-PackerVersion)) $utilities.AddToolVersion("pkg-config", $(Get-PKGConfigVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $utilities.AddToolVersion("PostgreSQL", $(Get-PostgresServerVersion)) $utilities.AddToolVersion("psql (PostgreSQL)", $(Get-PostgresClientVersion)) $utilities.AddToolVersion("Sox", $(Get-SoxVersion)) @@ -150,7 +154,7 @@ $utilities.AddToolVersion("zstd", $(Get-ZstdVersion)) # Tools $tools = $installedSoftware.AddHeader("Tools") -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $tools.AddToolVersion("App Center CLI", $(Get-AppCenterCLIVersion)) } $tools.AddToolVersion("AWS CLI", $(Get-AWSCLIVersion)) @@ -159,7 +163,7 @@ $tools.AddToolVersion("AWS Session Manager CLI", $(Get-AWSSessionManagerCLIVersi $tools.AddToolVersion("Azure CLI", $(Get-AzureCLIVersion)) $tools.AddToolVersion("Azure CLI (azure-devops)", $(Get-AzureDevopsVersion)) $tools.AddToolVersion("Bicep CLI", $(Get-BicepVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $tools.AddToolVersion("Cabal", $(Get-CabalVersion)) } $tools.AddToolVersion("Cmake", $(Get-CmakeVersion)) @@ -168,14 +172,14 @@ if ($os.IsMonterey) { $tools.AddToolVersion("Colima", $(Get-ColimaVersion)) } $tools.AddToolVersion("Fastlane", $(Get-FastlaneVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $tools.AddToolVersion("GHC", $(Get-GHCVersion)) $tools.AddToolVersion("GHCup", $(Get-GHCupVersion)) $tools.AddToolVersion("Jazzy", $(Get-JazzyVersion)) $tools.AddToolVersion("Stack", $(Get-StackVersion)) } $tools.AddToolVersion("SwiftFormat", $(Get-SwiftFormatVersion)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $tools.AddToolVersion("Swig", $(Get-SwigVersion)) } $tools.AddToolVersion("Xcbeautify", $(Get-XcbeautifyVersion)) @@ -184,10 +188,10 @@ $tools.AddToolVersion("Xcodes", $(Get-XcodesVersion)) # Linters $linters = $installedSoftware.AddHeader("Linters") -if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) { +if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) { $linters.AddToolVersion("SwiftLint", $(Get-SwiftLintVersion)) } -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $linters.AddToolVersion("Yamllint", $(Get-YamllintVersion)) } @@ -201,7 +205,6 @@ $java = $installedSoftware.AddHeader("Java") $java.AddTable($(Get-JavaVersions)) # Toolcache - $toolcache = $installedSoftware.AddHeader("Cached Tools") $toolcache.AddNodes($(Build-ToolcacheSection)) @@ -213,7 +216,7 @@ $rust.AddToolVersion("Rustdoc", $(Get-RustdocVersion)) $rust.AddToolVersion("Rustup", $(Get-RustupVersion)) $rustPackages = $rust.AddHeader("Packages") -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $rustPackages.AddToolVersion("Bindgen", $(Get-Bindgen)) $rustPackages.AddToolVersion("Cargo-audit", $(Get-Cargoaudit)) $rustPackages.AddToolVersion("Cargo-outdated", $(Get-Cargooutdated)) @@ -230,13 +233,13 @@ $powerShellModules = $powerShell.AddHeader("PowerShell Modules") $powerShellModules.AddNodes($(Get-PowerShellModules)) # Web Servers -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $webServers = $installedSoftware.AddHeader("Web Servers") $webServers.AddTable($(Build-WebServersSection)) } # Xamarin section -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $xamarin = $installedSoftware.AddHeader("Xamarin") $vsForMac = $xamarin.AddHeader("Visual Studio for Mac") $vsForMac.AddTable($(Build-VSMacTable)) @@ -263,7 +266,7 @@ Get-XcodeInfoList | Out-Null $xcodeInfo = Get-XcodeInfoList $xcode.AddTable($(Build-XcodeTable $xcodeInfo)) -if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) { +if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $xcodeTools = $xcode.AddHeader("Xcode Support Tools") $xcodeTools.AddNodes($(Build-XcodeSupportToolsSection)) } @@ -290,7 +293,7 @@ if ($os.IsMonterey) { $miscellaneous.AddToolVersion("Zlib", $(Get-ZlibVersion)) } -if ($os.IsSonomaX64 -or $os.IsVenturaX64) { +if ($os.IsSonomaX64 -or $os.IsVenturaX64 -or $os.IsSequoiaX64) { $miscellaneous = $installedSoftware.AddHeader("Miscellaneous") } if ($os.IsMonterey -or $os.IsSonomaX64 -or $os.IsVenturaX64) { diff --git a/images/macos/scripts/docs-gen/SoftwareReport.Browsers.psm1 b/images/macos/scripts/docs-gen/SoftwareReport.Browsers.psm1 index f99a90be4..837c331df 100644 --- a/images/macos/scripts/docs-gen/SoftwareReport.Browsers.psm1 +++ b/images/macos/scripts/docs-gen/SoftwareReport.Browsers.psm1 @@ -11,7 +11,7 @@ function Build-BrowserSection { [ToolVersionNode]::new("ChromeDriver", $(Get-ChromeDriverVersion)) ) - if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) { + if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) { $nodes += @( [ToolVersionNode]::new("Microsoft Edge", $(Get-EdgeVersion)) [ToolVersionNode]::new("Microsoft Edge WebDriver", $(Get-EdgeDriverVersion)) @@ -79,7 +79,7 @@ function Get-GeckodriverVersion { function Get-SeleniumVersion { $os = Get-OSVersion - if ($os.IsVenturaArm64 -or $os.IsSonomaArm64) { + if ($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { $cellarPath = "/opt/homebrew/Cellar" } else { $cellarPath = "/usr/local/Cellar" diff --git a/images/macos/scripts/docs-gen/SoftwareReport.Java.psm1 b/images/macos/scripts/docs-gen/SoftwareReport.Java.psm1 index 41b591694..af762405b 100644 --- a/images/macos/scripts/docs-gen/SoftwareReport.Java.psm1 +++ b/images/macos/scripts/docs-gen/SoftwareReport.Java.psm1 @@ -2,7 +2,7 @@ function Get-JavaVersions { $defaultJavaPath = (Get-Item env:JAVA_HOME).value $os = Get-OSVersion - if ($os.IsVenturaArm64 -or $os.IsSonomaArm64) { + if ($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { $javaVersions = Get-Item env:JAVA_HOME_*_arm64 } else { $javaVersions = Get-Item env:JAVA_HOME_*_X64 diff --git a/images/macos/scripts/docs-gen/SoftwareReport.Toolcache.psm1 b/images/macos/scripts/docs-gen/SoftwareReport.Toolcache.psm1 index 18fc1bdf3..40c028c83 100644 --- a/images/macos/scripts/docs-gen/SoftwareReport.Toolcache.psm1 +++ b/images/macos/scripts/docs-gen/SoftwareReport.Toolcache.psm1 @@ -37,12 +37,12 @@ function Build-ToolcacheSection { $nodes = @() - if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonoma)) { + if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) { $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) -and (-not $os.IsSequoiaArm64)) { $nodes += @( [ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List") ) diff --git a/images/macos/scripts/helpers/Common.Helpers.psm1 b/images/macos/scripts/helpers/Common.Helpers.psm1 index c476edc1c..359f5974e 100644 --- a/images/macos/scripts/helpers/Common.Helpers.psm1 +++ b/images/macos/scripts/helpers/Common.Helpers.psm1 @@ -36,6 +36,9 @@ function Get-OSVersion { IsSonoma = $($osVersion.Version.Major -eq "14") IsSonomaArm64 = $($osVersion.Version.Major -eq "14" -and $processorArchitecture -eq "arm64") IsSonomaX64 = $($osVersion.Version.Major -eq "14" -and $processorArchitecture -ne "arm64") + IsSequoia = $($osVersion.Version.Major -eq "15") + IsSequoiaArm64 = $($osVersion.Version.Major -eq "15" -and $processorArchitecture -eq "arm64") + IsSequoiaX64 = $($osVersion.Version.Major -eq "15" -and $processorArchitecture -ne "arm64") } } diff --git a/images/macos/scripts/helpers/utils.sh b/images/macos/scripts/helpers/utils.sh index b8e51ee20..6dbb23102 100644 --- a/images/macos/scripts/helpers/utils.sh +++ b/images/macos/scripts/helpers/utils.sh @@ -45,6 +45,18 @@ is_Arm64() { [ "$(arch)" = "arm64" ] } +is_Sequoia() { + [ "$OSTYPE" = "darwin24" ] +} + +is_SequoiaArm64() { + is_Sequoia && is_Arm64 +} + +is_SequoiaX64() { + is_Sequoia && ! is_Arm64 +} + is_Sonoma() { [ "$OSTYPE" = "darwin23" ] } diff --git a/images/macos/scripts/tests/BasicTools.Tests.ps1 b/images/macos/scripts/tests/BasicTools.Tests.ps1 index 5fc84bf7b..add654733 100644 --- a/images/macos/scripts/tests/BasicTools.Tests.ps1 +++ b/images/macos/scripts/tests/BasicTools.Tests.ps1 @@ -26,7 +26,7 @@ Describe "cmake" { } } -Describe "Subversion" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Subversion" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Subversion" { "svn --version" | Should -ReturnZeroExitCode } @@ -111,7 +111,7 @@ Describe "bazel" { } } -Describe "Julia" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Julia" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Julia" { "julia --version" | Should -ReturnZeroExitCode } @@ -135,19 +135,19 @@ Describe "wget" { } } -Describe "vagrant" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "vagrant" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "vagrant" { "vagrant --version" | Should -ReturnZeroExitCode } } -Describe "virtualbox" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "virtualbox" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "virtualbox" { "vboxmanage -v" | Should -ReturnZeroExitCode } } -Describe "R" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "R" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "R" { "R --version" | Should -ReturnZeroExitCode } @@ -167,7 +167,7 @@ Describe "Kotlin" { } } -Describe "sbt" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "sbt" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "sbt" { "sbt -version" | Should -ReturnZeroExitCode } @@ -179,7 +179,7 @@ Describe "yq" { } } -Describe "imagemagick" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "imagemagick" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "imagemagick" { "magick -version" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/Browsers.Tests.ps1 b/images/macos/scripts/tests/Browsers.Tests.ps1 index 95545a50f..192339a5e 100644 --- a/images/macos/scripts/tests/Browsers.Tests.ps1 +++ b/images/macos/scripts/tests/Browsers.Tests.ps1 @@ -41,7 +41,7 @@ Describe "Selenium server" { } } -Describe "Edge" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) { +Describe "Edge" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { It "Microsoft Edge" { $edgeLocation = "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" $edgeLocation | Should -Exist @@ -53,7 +53,7 @@ Describe "Edge" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) { } } -Describe "Firefox" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) { +Describe "Firefox" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { It "Firefox" { $firefoxLocation = "/Applications/Firefox.app/Contents/MacOS/firefox" $firefoxLocation | Should -Exist diff --git a/images/macos/scripts/tests/Common.Tests.ps1 b/images/macos/scripts/tests/Common.Tests.ps1 index 6ecf158a6..92591437d 100644 --- a/images/macos/scripts/tests/Common.Tests.ps1 +++ b/images/macos/scripts/tests/Common.Tests.ps1 @@ -33,7 +33,7 @@ Describe "GCC" { } } -Describe "vcpkg" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSonoma) { +Describe "vcpkg" -Skip:($os.IsVenturaArm64 -or $os.IsSonoma -or $os.IsSequoia) { It "vcpkg" { "vcpkg version" | Should -ReturnZeroExitCode } @@ -58,7 +58,7 @@ Describe "AzCopy" { } } -Describe "Miniconda" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Miniconda" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Conda" { [System.Environment]::GetEnvironmentVariable("CONDA") | Should -Not -BeNullOrEmpty $condaBinPath = Join-Path $env:CONDA "bin" "conda" @@ -66,7 +66,7 @@ Describe "Miniconda" -Skip:($os.IsVentura -or $os.IsSonoma) { } } -Describe "Stack" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Stack" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Stack" { "stack --version" | Should -ReturnZeroExitCode } @@ -78,7 +78,7 @@ Describe "CocoaPods" { } } -Describe "VSMac" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "VSMac" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { $vsMacVersions = (Get-ToolsetContent).xamarin.vsmac.versions $defaultVSMacVersion = (Get-ToolsetContent).xamarin.vsmac.default @@ -105,7 +105,7 @@ Describe "VSMac" -Skip:($os.IsVentura -or $os.IsSonoma) { } } -Describe "Swig" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Swig" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Swig" { "swig -version" | Should -ReturnZeroExitCode } @@ -117,13 +117,13 @@ Describe "Bicep" { } } -Describe "Go" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Go" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Go" { "go version" | Should -ReturnZeroExitCode } } -Describe "VirtualBox" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "VirtualBox" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Check kext kernel modules" { kextstat | Out-String | Should -Match "org.virtualbox.kext" } @@ -141,7 +141,7 @@ Describe "CodeQL Bundle" { } } -Describe "Colima" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Colima" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Colima" { "colima version" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/Databases.Tests.ps1 b/images/macos/scripts/tests/Databases.Tests.ps1 index 0c8a7e7d7..38539136b 100644 --- a/images/macos/scripts/tests/Databases.Tests.ps1 +++ b/images/macos/scripts/tests/Databases.Tests.ps1 @@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" $os = Get-OSVersion -Describe "MongoDB" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "MongoDB" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "" -TestCases @( @{ ToolName = "mongo" } @{ ToolName = "mongod" } @@ -12,7 +12,7 @@ Describe "MongoDB" -Skip:($os.IsVentura -or $os.IsSonoma) { } } -Describe "PostgreSQL" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "PostgreSQL" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "PostgreSQL version should correspond to the version in the toolset" { $toolsetVersion = (Get-ToolsetContent).postgresql.version # Client version diff --git a/images/macos/scripts/tests/Haskell.Tests.ps1 b/images/macos/scripts/tests/Haskell.Tests.ps1 index bc2b6e507..c4ff72992 100644 --- a/images/macos/scripts/tests/Haskell.Tests.ps1 +++ b/images/macos/scripts/tests/Haskell.Tests.ps1 @@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" $os = Get-OSVersion -Describe "Haskell" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Haskell" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { Context "GHCup" { It "GHCup" { "ghcup --version" | Should -ReturnZeroExitCode diff --git a/images/macos/scripts/tests/Linters.Tests.ps1 b/images/macos/scripts/tests/Linters.Tests.ps1 index 987abc988..93ac37e0e 100644 --- a/images/macos/scripts/tests/Linters.Tests.ps1 +++ b/images/macos/scripts/tests/Linters.Tests.ps1 @@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/Helpers.psm1" -DisableNameChecking $os = Get-OSVersion -Describe "SwiftLint" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) { +Describe "SwiftLint" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { It "SwiftLint" { "swiftlint version" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/Node.Tests.ps1 b/images/macos/scripts/tests/Node.Tests.ps1 index aa68e83cb..a48008ef3 100644 --- a/images/macos/scripts/tests/Node.Tests.ps1 +++ b/images/macos/scripts/tests/Node.Tests.ps1 @@ -21,7 +21,7 @@ Describe "Node.js" { } } -Describe "nvm" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "nvm" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { BeforeAll { $nvmPath = Join-Path $env:HOME ".nvm" "nvm.sh" $nvmInitCommand = ". $nvmPath > /dev/null 2>&1 || true" diff --git a/images/macos/scripts/tests/PHP.Tests.ps1 b/images/macos/scripts/tests/PHP.Tests.ps1 index c87b36bb4..2a4ff8774 100644 --- a/images/macos/scripts/tests/PHP.Tests.ps1 +++ b/images/macos/scripts/tests/PHP.Tests.ps1 @@ -3,7 +3,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" $os = Get-OSVersion Describe "PHP" { - Context "PHP" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) { + Context "PHP" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { It "PHP Path" { Get-ToolPath "php" | Should -Not -BeLike "/usr/bin/php*" } @@ -14,7 +14,7 @@ Describe "PHP" { } } - Context "Composer" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) { + Context "Composer" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { It "Composer" { "composer --version" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/PipxPackages.Tests.ps1 b/images/macos/scripts/tests/PipxPackages.Tests.ps1 index bb7bdc10e..8a7cb0dcb 100644 --- a/images/macos/scripts/tests/PipxPackages.Tests.ps1 +++ b/images/macos/scripts/tests/PipxPackages.Tests.ps1 @@ -3,7 +3,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" $os = Get-OSVersion -Describe "PipxPackages" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "PipxPackages" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { $pipxToolset = (Get-ToolsetContent).pipx $testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} } It "" -TestCases $testCases { diff --git a/images/macos/scripts/tests/Python.Tests.ps1 b/images/macos/scripts/tests/Python.Tests.ps1 index 4179d6233..079f76ba3 100644 --- a/images/macos/scripts/tests/Python.Tests.ps1 +++ b/images/macos/scripts/tests/Python.Tests.ps1 @@ -8,7 +8,7 @@ Describe "Python3" { "python3 --version" | Should -ReturnZeroExitCode } - if ($os.IsVenturaArm64 -or $os.IsSonomaArm64) { + if ($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { It "Python 3 is installed under /opt/homebrew/bin/" { Get-ToolPath "python3" | Should -BeLike "/opt/homebrew/bin/*" } @@ -34,7 +34,7 @@ Describe "Python3" { } -Describe "Python2" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Python2" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Python 2 is available" { "/Library/Frameworks/Python.framework/Versions/2.7/bin/python --version" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/RubyGem.Tests.ps1 b/images/macos/scripts/tests/RubyGem.Tests.ps1 index 2dc611e59..13a3a6f2c 100644 --- a/images/macos/scripts/tests/RubyGem.Tests.ps1 +++ b/images/macos/scripts/tests/RubyGem.Tests.ps1 @@ -20,25 +20,19 @@ Describe "Bundler" { } } -Describe "Nomad shenzhen CLI" -Skip:($os.IsMonterey -or $os.IsVentura -or $os.IsSonoma) { - It "Nomad shenzhen CLI" { - "ipa --version" | Should -ReturnZeroExitCode - } -} - Describe "Fastlane" { It "Fastlane" { "fastlane --version" | Should -ReturnZeroExitCode } } -Describe "xcpretty" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "xcpretty" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "xcpretty" { "xcpretty --version" | Should -ReturnZeroExitCode } } -Describe "jazzy" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "jazzy" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "jazzy" { "jazzy --version" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/Rust.Tests.ps1 b/images/macos/scripts/tests/Rust.Tests.ps1 index b5c1c53fc..34eab1220 100644 --- a/images/macos/scripts/tests/Rust.Tests.ps1 +++ b/images/macos/scripts/tests/Rust.Tests.ps1 @@ -18,7 +18,7 @@ Describe "Rust" { "cargo --version" | Should -ReturnZeroExitCode } } - Context "Cargo dependencies" -Skip:($os.IsVentura -or $os.IsSonoma) { + Context "Cargo dependencies" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "bindgen" { "bindgen --version" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/System.Tests.ps1 b/images/macos/scripts/tests/System.Tests.ps1 index ae6fbd1d4..bc0fd72c9 100644 --- a/images/macos/scripts/tests/System.Tests.ps1 +++ b/images/macos/scripts/tests/System.Tests.ps1 @@ -25,7 +25,7 @@ Describe "Certificate" { } } -Describe "Audio device" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Audio device" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Sox is installed" { "sox --version" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/Toolcache.Tests.ps1 b/images/macos/scripts/tests/Toolcache.Tests.ps1 index 623a41632..6a07313b6 100644 --- a/images/macos/scripts/tests/Toolcache.Tests.ps1 +++ b/images/macos/scripts/tests/Toolcache.Tests.ps1 @@ -57,7 +57,7 @@ Describe "Toolcache" { } } - Context "Ruby" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) { + Context "Ruby" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) { $rubyDirectory = Join-Path $toolcacheDirectory "Ruby" $rubyPackage = $packages | Where-Object { $_.ToolName -eq "Ruby" } | Select-Object -First 1 $testCase = @{ RubyDirectory = $rubyDirectory } @@ -99,7 +99,7 @@ Describe "Toolcache" { } } } - Context "PyPy" -Skip:($os.IsVenturaArm64 -or $os.IsSonoma) { + Context "PyPy" -Skip:($os.IsVenturaArm64 -or $os.IsSonoma -or $os.IsSequoia) { $pypyDirectory = Join-Path $toolcacheDirectory "PyPy" $pypyPackage = $packages | Where-Object { $_.ToolName -eq "pypy" } | Select-Object -First 1 $testCase = @{ PypyDirectory = $pypyDirectory } diff --git a/images/macos/scripts/tests/WebServers.Tests.ps1 b/images/macos/scripts/tests/WebServers.Tests.ps1 index 18c6bbb26..303fa3842 100644 --- a/images/macos/scripts/tests/WebServers.Tests.ps1 +++ b/images/macos/scripts/tests/WebServers.Tests.ps1 @@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" $os = Get-OSVersion -Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Apache CLI" { "httpd -v" | Should -ReturnZeroExitCode } @@ -13,7 +13,7 @@ Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma) { } } -Describe "Nginx" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Nginx" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Nginx CLI" { "nginx -v" | Should -ReturnZeroExitCode } diff --git a/images/macos/scripts/tests/Xamarin.Tests.ps1 b/images/macos/scripts/tests/Xamarin.Tests.ps1 index 93de1cd34..3b808fd03 100644 --- a/images/macos/scripts/tests/Xamarin.Tests.ps1 +++ b/images/macos/scripts/tests/Xamarin.Tests.ps1 @@ -13,6 +13,8 @@ if ($os.IsVentura -or $os.IsSonoma) { $XAMARIN_IOS_VERSIONS = (Get-ToolsetContent).xamarin.ios_versions $XAMARIN_MAC_VERSIONS = (Get-ToolsetContent).xamarin.mac_versions $XAMARIN_ANDROID_VERSIONS = (Get-ToolsetContent).xamarin.android_versions +} elseif ($os.IsSequoia) { + Write-Host "Skipping all the Mono and Xamarin tests as deprecated" } BeforeAll { @@ -26,7 +28,7 @@ BeforeAll { } } -Describe "Mono" { +Describe "Mono" -Skip:($os.IsSequoia) { $MONO_VERSIONS | ForEach-Object { Context "$_" { $MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions" @@ -90,7 +92,7 @@ Describe "Mono" { } } -Describe "Xamarin.iOS" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Xamarin.iOS" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { $XAMARIN_IOS_VERSIONS | ForEach-Object { Context "$_" { $XAMARIN_IOS_VERSIONS_PATH = "/Library/Frameworks/Xamarin.iOS.framework/Versions" @@ -123,7 +125,7 @@ Describe "Xamarin.iOS" -Skip:($os.IsVentura -or $os.IsSonoma) { } } -Describe "Xamarin.Mac" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Xamarin.Mac" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { $XAMARIN_MAC_VERSIONS | ForEach-Object { Context "$_" { $XAMARIN_MAC_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Mac.framework/Versions" @@ -156,7 +158,7 @@ Describe "Xamarin.Mac" -Skip:($os.IsVentura -or $os.IsSonoma) { } } -Describe "Xamarin.Android" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Xamarin.Android" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { $XAMARIN_ANDROID_VERSIONS | ForEach-Object { Context "$_" { $XAMARIN_ANDROID_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions" @@ -196,7 +198,7 @@ Describe "Xamarin.Android" -Skip:($os.IsVentura -or $os.IsSonoma) { } } -Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { BeforeAll { $MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions" $XAMARIN_IOS_VERSIONS_PATH = "/Library/Frameworks/Xamarin.iOS.framework/Versions" @@ -303,7 +305,7 @@ Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsSonoma) { } } -Describe "Nuget" -Skip:($os.IsVentura -or $os.IsSonoma) { +Describe "Nuget" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) { It "Nuget config contains nuget.org feed" { Get-Content $env:HOME/.config/NuGet/NuGet.Config | Out-String | Should -Match "nuget.org" } diff --git a/images/macos/scripts/tests/Xcode.Tests.ps1 b/images/macos/scripts/tests/Xcode.Tests.ps1 index 912fccb7f..4228f1a2b 100644 --- a/images/macos/scripts/tests/Xcode.Tests.ps1 +++ b/images/macos/scripts/tests/Xcode.Tests.ps1 @@ -28,6 +28,13 @@ Describe "Xcode" { $defaultXcodeTestCase = @{ DefaultXcode = $defaultXcode } It "Default Xcode is " -TestCases $defaultXcodeTestCase { "xcodebuild -version" | Should -ReturnZeroExitCode + If ($DefaultXcode -ilike "*beta*") { + Write-Host "Beta version detected" + $DefaultXcode = $DefaultXcode.split("_")[0] + If ($DefaultXcode -notlike "*.*") { + $DefaultXcode = "${DefaultXcode}.0" + } + } (Get-CommandResult "xcodebuild -version").Output | Should -BeLike "Xcode ${DefaultXcode}*" } diff --git a/images/macos/templates/macOS-14.anka.pkr.hcl b/images/macos/templates/macOS-14.anka.pkr.hcl index d0ac071ed..752583862 100644 --- a/images/macos/templates/macOS-14.anka.pkr.hcl +++ b/images/macos/templates/macOS-14.anka.pkr.hcl @@ -250,7 +250,6 @@ build { "${path.root}/../scripts/build/install-chrome.sh", "${path.root}/../scripts/build/install-edge.sh", "${path.root}/../scripts/build/install-firefox.sh", - "${path.root}/../scripts/build/install-pypy.sh", "${path.root}/../scripts/build/install-bicep.sh", "${path.root}/../scripts/build/install-codeql-bundle.sh" ] diff --git a/images/macos/templates/macOS-15.anka.pkr.hcl b/images/macos/templates/macOS-15.anka.pkr.hcl new file mode 100644 index 000000000..1bd3aefb3 --- /dev/null +++ b/images/macos/templates/macOS-15.anka.pkr.hcl @@ -0,0 +1,293 @@ +packer { + required_plugins { + veertu-anka = { + version = ">= v3.2.0" + source = "github.com/veertuinc/veertu-anka" + } + } +} + +locals { + image_folder = "/Users/${var.vm_username}/image-generation" +} + +variable "builder_type" { + type = string + default = "veertu-anka-vm-clone" + validation { + condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type) + error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]." + } +} + +variable "source_vm_name" { + type = string +} + +variable "source_vm_port" { + type = number + default = 22 +} + +variable "source_vm_tag" { + type = string + default = "" +} + +variable "socks_proxy" { + type = string + default = "" +} + +variable "build_id" { + type = string +} + +variable "vm_username" { + type = string + sensitive = true +} + +variable "vm_password" { + type = string + sensitive = true +} + +variable "github_api_pat" { + type = string + sensitive = true + default = "" +} + +variable "xcode_install_storage_url" { + type = string + sensitive = true +} + +variable "xcode_install_sas" { + type = string + sensitive = true +} + +variable "vcpu_count" { + type = string + default = "6" +} + +variable "ram_size" { + type = string + default = "8G" +} + +variable "image_os" { + type = string + default = "macos15" +} + +source "veertu-anka-vm-clone" "template" { + vm_name = "${var.build_id}" + source_vm_name = "${var.source_vm_name}" + source_vm_tag = "${var.source_vm_tag}" + vcpu_count = "${var.vcpu_count}" + ram_size = "${var.ram_size}" + stop_vm = "true" +} + +source "null" "template" { + ssh_host = "${var.source_vm_name}" + ssh_port = "${var.source_vm_port}" + ssh_username = "${var.vm_username}" + ssh_password = "${var.vm_password}" + ssh_proxy_host = "${var.socks_proxy}" +} + +build { + sources = ["source.${var.builder_type}.template"] + + provisioner "shell" { + inline = ["mkdir ${local.image_folder}"] + } + + provisioner "file" { + destination = "${local.image_folder}/" + sources = [ + "${path.root}/../scripts/tests", + "${path.root}/../scripts/docs-gen", + "${path.root}/../scripts/helpers" + ] + } + + provisioner "file" { + destination = "${local.image_folder}/docs-gen/" + source = "${path.root}/../../../helpers/software-report-base" + } + + provisioner "file" { + destination = "${local.image_folder}/add-certificate.swift" + source = "${path.root}/../assets/add-certificate.swift" + } + + provisioner "file" { + destination = ".bashrc" + source = "${path.root}/../assets/bashrc" + } + + provisioner "file" { + destination = ".bash_profile" + source = "${path.root}/../assets/bashprofile" + } + + provisioner "shell" { + inline = ["mkdir ~/bootstrap"] + } + + provisioner "file" { + destination = "bootstrap" + source = "${path.root}/../assets/bootstrap-provisioner/" + } + + provisioner "file" { + destination = "${local.image_folder}/toolset.json" + source = "${path.root}/../toolsets/toolset-15.json" + } + + provisioner "shell" { + execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'" + inline = [ + "mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report", + "mkdir ~/utils", + "mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils", + "mv ${local.image_folder}/helpers/utils.sh ~/utils" + ] + } + + provisioner "shell" { + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/install-xcode-clt.sh", + "${path.root}/../scripts/build/install-homebrew.sh" + ] + } + + provisioner "shell" { + environment_vars = ["PASSWORD=${var.vm_password}", "USERNAME=${var.vm_username}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/configure-tccdb-macos.sh", + "${path.root}/../scripts/build/configure-auto-updates.sh", + "${path.root}/../scripts/build/configure-ntpconf.sh", + "${path.root}/../scripts/build/configure-shell.sh" + ] + } + + provisioner "shell" { + environment_vars = ["IMAGE_VERSION=${var.build_id}", "IMAGE_OS=${var.image_os}", "PASSWORD=${var.vm_password}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/configure-preimagedata.sh", + "${path.root}/../scripts/build/configure-ssh.sh", + "${path.root}/../scripts/build/configure-machine.sh" + ] + } + + provisioner "shell" { + execute_command = "source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}" + expect_disconnect = true + inline = ["echo 'Reboot VM'", "shutdown -r now"] + } + + provisioner "shell" { + environment_vars = ["API_PAT=${var.github_api_pat}", "USER_PASSWORD=${var.vm_password}", "IMAGE_FOLDER=${local.image_folder}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + pause_before = "30s" + scripts = [ + "${path.root}/../scripts/build/install-powershell.sh", + "${path.root}/../scripts/build/install-dotnet.sh", + "${path.root}/../scripts/build/install-python.sh", + "${path.root}/../scripts/build/install-azcopy.sh", + "${path.root}/../scripts/build/install-openssl.sh", + "${path.root}/../scripts/build/install-ruby.sh", + "${path.root}/../scripts/build/install-rubygems.sh", + "${path.root}/../scripts/build/install-git.sh", + "${path.root}/../scripts/build/install-node.sh", + "${path.root}/../scripts/build/install-common-utils.sh" + ] + } + + provisioner "shell" { + environment_vars = ["XCODE_INSTALL_STORAGE_URL=${var.xcode_install_storage_url}", "XCODE_INSTALL_SAS=${var.xcode_install_sas}", "IMAGE_FOLDER=${local.image_folder}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}" + script = "${path.root}/../scripts/build/Install-Xcode.ps1" + } + + provisioner "shell" { + execute_command = "source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}" + expect_disconnect = true + inline = ["echo 'Reboot VM'", "shutdown -r now"] + } + + provisioner "shell" { + environment_vars = ["API_PAT=${var.github_api_pat}", "IMAGE_FOLDER=${local.image_folder}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/install-actions-cache.sh", + "${path.root}/../scripts/build/install-llvm.sh", + "${path.root}/../scripts/build/install-swiftlint.sh", + "${path.root}/../scripts/build/install-openjdk.sh", + "${path.root}/../scripts/build/install-php.sh", + "${path.root}/../scripts/build/install-aws-tools.sh", + "${path.root}/../scripts/build/install-rust.sh", + "${path.root}/../scripts/build/install-gcc.sh", + "${path.root}/../scripts/build/install-cocoapods.sh", + "${path.root}/../scripts/build/install-android-sdk.sh", + "${path.root}/../scripts/build/install-safari.sh", + "${path.root}/../scripts/build/install-chrome.sh", + "${path.root}/../scripts/build/install-edge.sh", + "${path.root}/../scripts/build/install-firefox.sh", + "${path.root}/../scripts/build/install-bicep.sh", + "${path.root}/../scripts/build/install-codeql-bundle.sh" + ] + } + + 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" { + environment_vars = ["IMAGE_FOLDER=${local.image_folder}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}" + script = "${path.root}/../scripts/build/Configure-Xcode-Simulators.ps1" + } + + provisioner "shell" { + environment_vars = ["IMAGE_FOLDER=${local.image_folder}"] + execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + 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}/tests/RunAll-Tests.ps1\"" + ] + } + + provisioner "file" { + destination = "${path.root}/../../image-output/" + direction = "download" + source = "${local.image_folder}/output/" + } + + provisioner "shell" { + inline = ["rm -rf \"$(brew --cache)\""] + } + + provisioner "shell" { + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/configure-hostname.sh", + "${path.root}/../scripts/build/configure-system.sh" + ] + } +} diff --git a/images/macos/templates/macOS-15.arm64.anka.pkr.hcl b/images/macos/templates/macOS-15.arm64.anka.pkr.hcl new file mode 100644 index 000000000..50b34dcca --- /dev/null +++ b/images/macos/templates/macOS-15.arm64.anka.pkr.hcl @@ -0,0 +1,285 @@ +packer { + required_plugins { + veertu-anka = { + version = ">= v3.2.0" + source = "github.com/veertuinc/veertu-anka" + } + } +} + +locals { + image_folder = "/Users/${var.vm_username}/image-generation" +} + +variable "builder_type" { + type = string + default = "veertu-anka-vm-clone" + validation { + condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type) + error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]." + } +} + +variable "source_vm_name" { + type = string +} + +variable "source_vm_port" { + type = number + default = 22 +} + +variable "source_vm_tag" { + type = string + default = "" +} + +variable "socks_proxy" { + type = string + default = "" +} + +variable "build_id" { + type = string +} + +variable "vm_username" { + type = string + sensitive = true +} + +variable "vm_password" { + type = string + sensitive = true +} + +variable "github_api_pat" { + type = string + sensitive = true + default = "" +} + +variable "xcode_install_storage_url" { + type = string + sensitive = true +} + +variable "xcode_install_sas" { + type = string + sensitive = true +} + +variable "vcpu_count" { + type = string + default = "6" +} + +variable "ram_size" { + type = string + default = "8G" +} + +variable "image_os" { + type = string + default = "macos15" +} + +source "veertu-anka-vm-clone" "template" { + vm_name = "${var.build_id}" + source_vm_name = "${var.source_vm_name}" + source_vm_tag = "${var.source_vm_tag}" + vcpu_count = "${var.vcpu_count}" + ram_size = "${var.ram_size}" + stop_vm = "true" + log_level = "debug" +} + +source "null" "template" { + ssh_host = "${var.source_vm_name}" + ssh_port = "${var.source_vm_port}" + ssh_username = "${var.vm_username}" + ssh_password = "${var.vm_password}" + ssh_proxy_host = "${var.socks_proxy}" +} + +build { + sources = ["source.${var.builder_type}.template"] + + provisioner "shell" { + inline = ["mkdir ${local.image_folder}"] + } + + provisioner "file" { + destination = "${local.image_folder}/" + sources = [ + "${path.root}/../scripts/tests", + "${path.root}/../scripts/docs-gen", + "${path.root}/../scripts/helpers" + ] + } + + provisioner "file" { + destination = "${local.image_folder}/docs-gen/" + source = "${path.root}/../../../helpers/software-report-base" + } + + provisioner "file" { + destination = "${local.image_folder}/add-certificate.swift" + source = "${path.root}/../assets/add-certificate.swift" + } + + provisioner "file" { + destination = ".bashrc" + source = "${path.root}/../assets/bashrc" + } + + provisioner "file" { + destination = ".bash_profile" + source = "${path.root}/../assets/bashprofile" + } + + provisioner "shell" { + inline = ["mkdir ~/bootstrap"] + } + + provisioner "file" { + destination = "bootstrap" + source = "${path.root}/../assets/bootstrap-provisioner/" + } + + provisioner "file" { + destination = "${local.image_folder}/toolset.json" + source = "${path.root}/../toolsets/toolset-15.json" + } + + provisioner "shell" { + execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'" + inline = [ + "mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report", + "mkdir ~/utils", + "mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils", + "mv ${local.image_folder}/helpers/utils.sh ~/utils" + ] + } + + provisioner "shell" { + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/install-xcode-clt.sh", + "${path.root}/../scripts/build/install-homebrew.sh", + "${path.root}/../scripts/build/install-rosetta.sh" + ] + } + + provisioner "shell" { + environment_vars = ["PASSWORD=${var.vm_password}", "USERNAME=${var.vm_username}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/configure-tccdb-macos.sh", + "${path.root}/../scripts/build/configure-auto-updates.sh", + "${path.root}/../scripts/build/configure-ntpconf.sh", + "${path.root}/../scripts/build/configure-shell.sh" + ] + } + + provisioner "shell" { + environment_vars = ["IMAGE_VERSION=${var.build_id}", "IMAGE_OS=${var.image_os}", "PASSWORD=${var.vm_password}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/configure-preimagedata.sh", + "${path.root}/../scripts/build/configure-ssh.sh", + "${path.root}/../scripts/build/configure-machine.sh" + ] + } + + provisioner "shell" { + execute_command = "source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}" + expect_disconnect = true + inline = ["echo 'Reboot VM'", "shutdown -r now"] + } + + provisioner "shell" { + environment_vars = ["API_PAT=${var.github_api_pat}", "USER_PASSWORD=${var.vm_password}", "IMAGE_FOLDER=${local.image_folder}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + pause_before = "30s" + scripts = [ + "${path.root}/../scripts/build/configure-windows.sh", + "${path.root}/../scripts/build/install-powershell.sh", + "${path.root}/../scripts/build/install-dotnet.sh", + "${path.root}/../scripts/build/install-python.sh", + "${path.root}/../scripts/build/install-azcopy.sh", + "${path.root}/../scripts/build/install-openssl.sh", + "${path.root}/../scripts/build/install-ruby.sh", + "${path.root}/../scripts/build/install-rubygems.sh", + "${path.root}/../scripts/build/install-git.sh", + "${path.root}/../scripts/build/install-node.sh", + "${path.root}/../scripts/build/install-common-utils.sh" + ] + } + + provisioner "shell" { + environment_vars = ["XCODE_INSTALL_STORAGE_URL=${var.xcode_install_storage_url}", "XCODE_INSTALL_SAS=${var.xcode_install_sas}", "IMAGE_FOLDER=${local.image_folder}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}" + script = "${path.root}/../scripts/build/Install-Xcode.ps1" + } + + provisioner "shell" { + execute_command = "source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}" + expect_disconnect = true + inline = ["echo 'Reboot VM'", "shutdown -r now"] + } + + provisioner "shell" { + environment_vars = ["API_PAT=${var.github_api_pat}", "IMAGE_FOLDER=${local.image_folder}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + scripts = [ + "${path.root}/../scripts/build/install-actions-cache.sh", + "${path.root}/../scripts/build/install-llvm.sh", + "${path.root}/../scripts/build/install-openjdk.sh", + "${path.root}/../scripts/build/install-aws-tools.sh", + "${path.root}/../scripts/build/install-rust.sh", + "${path.root}/../scripts/build/install-gcc.sh", + "${path.root}/../scripts/build/install-cocoapods.sh", + "${path.root}/../scripts/build/install-android-sdk.sh", + "${path.root}/../scripts/build/install-safari.sh", + "${path.root}/../scripts/build/install-chrome.sh", + "${path.root}/../scripts/build/install-bicep.sh", + "${path.root}/../scripts/build/install-codeql-bundle.sh" + ] + } + + 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" { + environment_vars = ["IMAGE_FOLDER=${local.image_folder}"] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}" + script = "${path.root}/../scripts/build/Configure-Xcode-Simulators.ps1" + } + + provisioner "shell" { + environment_vars = ["IMAGE_FOLDER=${local.image_folder}"] + execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + 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}/tests/RunAll-Tests.ps1\"" + ] + } + + provisioner "file" { + destination = "${path.root}/../../image-output/" + direction = "download" + source = "${local.image_folder}/output/" + } + + provisioner "shell" { + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + scripts = ["${path.root}/../scripts/build/configure-hostname.sh"] + } +} diff --git a/images/macos/toolsets/toolset-15.json b/images/macos/toolsets/toolset-15.json new file mode 100644 index 000000000..38a8ca082 --- /dev/null +++ b/images/macos/toolsets/toolset-15.json @@ -0,0 +1,204 @@ +{ + "xcode": { + "default": "16.1_beta", + "x64": { + "versions": [ + { "link": "16.1_beta", "version": "16.1.0-Beta+16B5001e", "symlinks": ["16.1"], "install_runtimes": "true", "sha256": "8848aacb32bdc0abbd7e14e4b712e07c98f4b6e5a23a8d77db03ab21dcb3c777"}, + { "link": "16_beta_6", "version": "16.0.0-Beta.6+16A5230g", "symlinks": ["16.0"], "install_runtimes": "true", "sha256": "ab0b9a4f6d723420ee0e39ff1cf6a628665dfe832053f66b6b72e013a6bbb244"}, + { "link": "15.4", "version": "15.4.0+15F31d", "install_runtimes": "true", "sha256": "82d3d61804ff3f4c7c82085e91dc701037ddaa770e542848b2477e22f4e8aa7a"} + ] + }, + "arm64":{ + "versions": [ + { "link": "16.1_beta", "version": "16.1.0-Beta+16B5001e", "symlinks": ["16.1"], "install_runtimes": "true", "sha256": "8848aacb32bdc0abbd7e14e4b712e07c98f4b6e5a23a8d77db03ab21dcb3c777"}, + { "link": "16_beta_6", "version": "16.0.0-Beta.6+16A5230g", "symlinks": ["16.0"], "install_runtimes": "true", "sha256": "ab0b9a4f6d723420ee0e39ff1cf6a628665dfe832053f66b6b72e013a6bbb244"}, + { "link": "15.4", "version": "15.4.0+15F31d", "install_runtimes": "true", "sha256": "82d3d61804ff3f4c7c82085e91dc701037ddaa770e542848b2477e22f4e8aa7a"} + ] + } + }, + "java": { + "x64": { + "default": "21", + "versions": [ "11", "17", "21"] + }, + "arm64": { + "default": "21", + "versions": [ "11", "17", "21"] + } + }, + "android": { + "cmdline-tools": "commandlinetools-mac-12172612_latest.zip", + "sdk-tools": "sdk-tools-darwin-4333796.zip", + "platform_min_version": "35", + "build_tools_min_version": "35.0.2", + "extras": [ + "android;m2repository", "google;m2repository", "google;google_play_services" + ], + "addons": [], + "additional_tools": [ + "cmake;3.22.1" + ], + "ndk": { + "default": "27", + "versions": [ + "25", "26", "27" + ] + } + }, + "powershellModules": [ + { "name": "Az" }, + { "name": "Pester" }, + { "name": "PSScriptAnalyzer" } + ], + "brew": { + "common_packages": [ + "ant", + "aria2", + "azure-cli", + "bazelisk", + "carthage", + "cmake", + "gh", + "gnupg", + "gnu-tar", + "kotlin", + "libpq", + "libsodium", + "p7zip", + "packer", + "perl", + "pkg-config", + "swiftformat", + "zstd", + "gmp", + "yq", + "unxip", + "xcbeautify", + "xcodes" + ], + "cask_packages": [ + "" + ] + }, + "gcc": { + "versions": [ + "12", + "13", + "14" + ] + }, + "dotnet": { + "arch":{ + "x64": { + "versions": [ + "7.0", + "8.0" + ] + }, + "arm64": { + "versions": [ + "7.0", + "8.0" + ] + } + } + }, + "ruby": { + "default": "3.3", + "rubygems": [ + "cocoapods", + "bundler", + "fastlane" + ] + }, + "toolcache": [ + { + "name": "Python", + "url" : "https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json", + "platform" : "darwin", + "arch": { + "x64": { + "versions": [ + "3.9.*", + "3.10.*", + "3.11.*", + "3.12.*" + ] + }, + "arm64": { + "versions": [ + "3.9.*", + "3.10.*", + "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.21.*", + "1.22.*", + "1.23.*" + ] + }, + "arm64": { + "variable_template" : "GOROOT_{0}_{1}_ARM64", + "versions": [ + "1.21.*", + "1.22.*", + "1.23.*" + ] + } + } + }, + { + "name": "Ruby", + "arch": { + "x64": { + "versions": [ + "3.1.*", + "3.2.*" + ] + } + } + } + ], + "node": { + "default": "22" + }, + "llvm": { + "version": "18" + }, + "php": { + "version": "8.3" + }, + "pwsh": { + "version": "7.4" + } +}