Skip to content

Commit

Permalink
[macOS] Introduce macOS-15 code (actions#10535)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexey-Ayupov <[email protected]>
  • Loading branch information
erik-bershel and Alexey-Ayupov authored Sep 3, 2024
1 parent ff516bd commit ab15087
Show file tree
Hide file tree
Showing 30 changed files with 897 additions and 89 deletions.
11 changes: 6 additions & 5 deletions images/macos/scripts/build/configure-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions images/macos/scripts/build/configure-tccdb-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions images/macos/scripts/build/install-bicep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
61 changes: 32 additions & 29 deletions images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand All @@ -74,37 +76,39 @@ $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))
}

$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
$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))
}

Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
}

Expand All @@ -201,7 +205,6 @@ $java = $installedSoftware.AddHeader("Java")
$java.AddTable($(Get-JavaVersions))

# Toolcache

$toolcache = $installedSoftware.AddHeader("Cached Tools")
$toolcache.AddNodes($(Build-ToolcacheSection))

Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
}
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions images/macos/scripts/docs-gen/SoftwareReport.Browsers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion images/macos/scripts/docs-gen/SoftwareReport.Java.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions images/macos/scripts/docs-gen/SoftwareReport.Toolcache.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down
3 changes: 3 additions & 0 deletions images/macos/scripts/helpers/Common.Helpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down
12 changes: 12 additions & 0 deletions images/macos/scripts/helpers/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
Expand Down
14 changes: 7 additions & 7 deletions images/macos/scripts/tests/BasicTools.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down
Loading

0 comments on commit ab15087

Please sign in to comment.