From f68553311049ee9c72c71019fbc98d0bac200f60 Mon Sep 17 00:00:00 2001 From: Alexey-Ayupov <116575425+Alexey-Ayupov@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:05:14 +0100 Subject: [PATCH] [macOS] Remove Haskell and Cargo packages (#8775) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”> --- images/macos/provision/core/rust.sh | 5 ++++- .../software-report/SoftwareReport.Generator.ps1 | 16 ++++++++-------- images/macos/templates/macOS-13.anka.pkr.hcl | 1 - images/macos/templates/macOS-14.anka.pkr.hcl | 1 - images/macos/tests/Haskell.Tests.ps1 | 4 ++-- images/macos/tests/Rust.Tests.ps1 | 6 ++++-- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/images/macos/provision/core/rust.sh b/images/macos/provision/core/rust.sh index bf2a6160..d2cc3b64 100644 --- a/images/macos/provision/core/rust.sh +++ b/images/macos/provision/core/rust.sh @@ -12,7 +12,10 @@ CARGO_HOME=$HOME/.cargo echo Install common tools... rustup component add rustfmt clippy -cargo install --locked bindgen-cli cbindgen cargo-audit cargo-outdated + +if is_BigSur || is_Monterey; then + cargo install --locked bindgen-cli cbindgen cargo-audit cargo-outdated +fi echo Cleanup Cargo registry cached data... rm -rf $CARGO_HOME/registry/* diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index d58a2769..6cc47dc7 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -166,7 +166,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.IsVenturaArm64) { +if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64) -and (-not $os.IsSonoma)) { $tools.AddToolVersion("Cabal", $(Get-CabalVersion)) } $tools.AddToolVersion("Cmake", $(Get-CmakeVersion)) @@ -175,11 +175,9 @@ if ($os.IsMonterey) { $tools.AddToolVersion("Colima", $(Get-ColimaVersion)) } $tools.AddToolVersion("Fastlane", $(Get-FastlaneVersion)) -if (-not $os.IsVenturaArm64) { +if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64) -and (-not $os.IsSonoma)) { $tools.AddToolVersion("GHC", $(Get-GHCVersion)) $tools.AddToolVersion("GHCup", $(Get-GHCupVersion)) -} -if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64) -and (-not $os.IsSonoma)) { $tools.AddToolVersion("Jazzy", $(Get-JazzyVersion)) } if (-not $os.IsVenturaArm64) { @@ -222,10 +220,12 @@ if (-not $os.IsSonoma) { $rust.AddToolVersion("Rustup", $(Get-RustupVersion)) $rustPackages = $rust.AddHeader("Packages") - $rustPackages.AddToolVersion("Bindgen", $(Get-Bindgen)) - $rustPackages.AddToolVersion("Cargo-audit", $(Get-Cargoaudit)) - $rustPackages.AddToolVersion("Cargo-outdated", $(Get-Cargooutdated)) - $rustPackages.AddToolVersion("Cbindgen", $(Get-Cbindgen)) + if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) { + $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)) } diff --git a/images/macos/templates/macOS-13.anka.pkr.hcl b/images/macos/templates/macOS-13.anka.pkr.hcl index 3366d803..7756bba8 100644 --- a/images/macos/templates/macOS-13.anka.pkr.hcl +++ b/images/macos/templates/macOS-13.anka.pkr.hcl @@ -202,7 +202,6 @@ build { "./provision/core/aws.sh", "./provision/core/rust.sh", "./provision/core/gcc.sh", - "./provision/core/haskell.sh", "./provision/core/cocoapods.sh", "./provision/core/android-toolsets.sh", "./provision/core/apache.sh", diff --git a/images/macos/templates/macOS-14.anka.pkr.hcl b/images/macos/templates/macOS-14.anka.pkr.hcl index 580a2d88..8699a6f5 100644 --- a/images/macos/templates/macOS-14.anka.pkr.hcl +++ b/images/macos/templates/macOS-14.anka.pkr.hcl @@ -202,7 +202,6 @@ build { "./provision/core/aws.sh", "./provision/core/rust.sh", "./provision/core/gcc.sh", - "./provision/core/haskell.sh", "./provision/core/cocoapods.sh", "./provision/core/android-toolsets.sh", "./provision/core/apache.sh", diff --git a/images/macos/tests/Haskell.Tests.ps1 b/images/macos/tests/Haskell.Tests.ps1 index f1a342d7..b4e965b3 100644 --- a/images/macos/tests/Haskell.Tests.ps1 +++ b/images/macos/tests/Haskell.Tests.ps1 @@ -1,7 +1,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" $os = Get-OSVersion -Describe "Haskell" -Skip:($os.IsVenturaArm64) { +Describe "Haskell" -Skip:($os.IsVentura -or $os.IsVenturaArm64 -or $os.IsSonoma) { Context "GHCup" { It "GHCup" { "ghcup --version" | Should -ReturnZeroExitCode @@ -26,4 +26,4 @@ Describe "Haskell" -Skip:($os.IsVenturaArm64) { "$HOME/.stack/hooks/ghc-install.sh" | Should -Not -Exist } } -} \ No newline at end of file +} diff --git a/images/macos/tests/Rust.Tests.ps1 b/images/macos/tests/Rust.Tests.ps1 index 894ef443..3b5e5b8b 100644 --- a/images/macos/tests/Rust.Tests.ps1 +++ b/images/macos/tests/Rust.Tests.ps1 @@ -1,3 +1,6 @@ +Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" +$os = Get-OSVersion + Describe "Rust" { Context "Rust" { It "Rustup is installed" { @@ -14,8 +17,7 @@ Describe "Rust" { "cargo --version" | Should -ReturnZeroExitCode } } - - Context "Cargo dependencies" { + Context "Cargo dependencies" -Skip:($os.IsVentura -or $os.IsVenturaArm64 -or $os.IsSonoma) { It "bindgen" { "bindgen --version" | Should -ReturnZeroExitCode }