From 3fab712c1ea2e1261273bb11c48024b876f8556a Mon Sep 17 00:00:00 2001 From: Mikhail Koliada <88318005+mikhailkoliada@users.noreply.github.com> Date: Mon, 19 Sep 2022 15:36:04 +0200 Subject: [PATCH] [Ubuntu] Install gcc@12 from brew (#6258) --- images/linux/scripts/installers/homebrew.sh | 6 ++++++ images/linux/scripts/tests/Tools.Tests.ps1 | 16 +++++++++++----- images/linux/toolsets/toolset-1804.json | 9 ++++++++- images/linux/toolsets/toolset-2004.json | 9 ++++++++- images/linux/toolsets/toolset-2204.json | 5 ++++- 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/images/linux/scripts/installers/homebrew.sh b/images/linux/scripts/installers/homebrew.sh index cb81167e..1396b60c 100644 --- a/images/linux/scripts/installers/homebrew.sh +++ b/images/linux/scripts/installers/homebrew.sh @@ -27,6 +27,12 @@ echo "Validate the installation reloading /etc/environment" reloadEtcEnvironment # Install additional brew packages + +# brew GCC installation needed because the default Ubuntu components +# are too old for current brew software +# See: +# https://github.com/Homebrew/homebrew-core/issues/110877 + brew_packages=$(get_toolset_value .brew[].name) for package in $brew_packages; do echo "Install $package" diff --git a/images/linux/scripts/tests/Tools.Tests.ps1 b/images/linux/scripts/tests/Tools.Tests.ps1 index 97a364b1..5d7c5a85 100644 --- a/images/linux/scripts/tests/Tools.Tests.ps1 +++ b/images/linux/scripts/tests/Tools.Tests.ps1 @@ -257,16 +257,22 @@ Describe "HHVM" -Skip:(Test-IsUbuntu22) { } Describe "Homebrew" { + $brewToolset = (Get-ToolsetContent).brew + $testCases = $brewToolset | ForEach-Object { @{brewName = $_.name; brewCommand = $_.command} } + It "homebrew" { "brew --version" | Should -ReturnZeroExitCode } - Context "Packages" { - $testCases = (Get-ToolsetContent).brew | ForEach-Object { @{ ToolName = $_.name } } + It "zstd has /usr/local/bin symlink" { + "/usr/local/bin/zstd" | Should -Exist + } - It "" -TestCases $testCases { - "$ToolName --version" | Should -Not -BeNullOrEmpty - } + It "homebrew package " -TestCases $testCases { + $brewPrefix = brew --prefix $brewName + $brewPackage = Join-Path $brewPrefix "bin" $brewCommand + + "$brewPackage --version" | Should -ReturnZeroExitCode } } diff --git a/images/linux/toolsets/toolset-1804.json b/images/linux/toolsets/toolset-1804.json index 264c6d96..7e6c8261 100644 --- a/images/linux/toolsets/toolset-1804.json +++ b/images/linux/toolsets/toolset-1804.json @@ -217,7 +217,14 @@ ] }, "brew": [ - {"name": "zstd"} + { + "name": "gcc@12", + "command": "gcc-12" + }, + { + "name": "zstd", + "command": "zstd" + } ], "docker": { "images": [ diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index df9434cd..bb02ac68 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -217,7 +217,14 @@ ] }, "brew": [ - {"name": "zstd"} + { + "name": "gcc@12", + "command": "gcc-12" + }, + { + "name": "zstd", + "command": "zstd" + } ], "docker": { "images": [ diff --git a/images/linux/toolsets/toolset-2204.json b/images/linux/toolsets/toolset-2204.json index 3c3c4bb0..f16f0ec6 100644 --- a/images/linux/toolsets/toolset-2204.json +++ b/images/linux/toolsets/toolset-2204.json @@ -201,7 +201,10 @@ ] }, "brew": [ - {"name": "zstd"} + { + "name": "zstd", + "command": "zstd" + } ], "docker": { "images": [