From c97e29c514950b373e9b11f037b778edd33812f7 Mon Sep 17 00:00:00 2001 From: Henti Smith <28868601+henti@users.noreply.github.com> Date: Thu, 23 Sep 2021 09:52:11 +0100 Subject: [PATCH] Add LLVM via choco (#4056) --- .../scripts/SoftwareReport/SoftwareReport.Common.psm1 | 5 +++++ .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 1 + images/win/scripts/Tests/Tools.Tests.ps1 | 9 +++++++++ images/win/toolsets/toolset-2016.json | 1 + images/win/toolsets/toolset-2019.json | 1 + images/win/toolsets/toolset-2022.json | 1 + 6 files changed, 18 insertions(+) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 4bcf722b0..71adb7a96 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -94,6 +94,11 @@ function Get-JuliaVersion { return "Julia $juliaVersion" } +function Get-LLVMVersion { + $llvmVersion = [regex]::matches($(clang --version), "\d+\.\d+\.\d+").Value + return "LLVM $llvmVersion" +} + function Get-PerlVersion { ($(perl --version) | Out-String) -match "\(v(?\d+\.\d+\.\d+)\)" | Out-Null $perlVersion = $Matches.Version diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 167de2ce4..6a59ed3ae 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -35,6 +35,7 @@ $languageTools = @( (Get-BashVersion), (Get-GoVersion), (Get-JuliaVersion), + (Get-LLVMVersion), (Get-NodeVersion), (Get-PHPVersion), (Get-PythonVersion), diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index 8f18ecce3..e333e7d63 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -81,6 +81,15 @@ Describe "KubernetesTools" { } } +Describe "LLVM" { + It "" -TestCases @( + @{ ToolName = "clang" } + @{ ToolName = "clang++" } + ) { + "$ToolName --version" | Should -ReturnZeroExitCode + } +} + Describe "Mingw64" { It "" -TestCases @( @{ ToolName = "gcc" } diff --git a/images/win/toolsets/toolset-2016.json b/images/win/toolsets/toolset-2016.json index 944ab75c0..c85169ba6 100644 --- a/images/win/toolsets/toolset-2016.json +++ b/images/win/toolsets/toolset-2016.json @@ -390,6 +390,7 @@ { "name": "gitversion.portable" }, { "name": "innosetup" }, { "name": "jq" }, + { "name": "llvm" }, { "name": "NuGet.CommandLine" }, { "name": "openssl.light", diff --git a/images/win/toolsets/toolset-2019.json b/images/win/toolsets/toolset-2019.json index 87abcdd1c..de2b45b90 100644 --- a/images/win/toolsets/toolset-2019.json +++ b/images/win/toolsets/toolset-2019.json @@ -420,6 +420,7 @@ { "name": "gitversion.portable" }, { "name": "innosetup" }, { "name": "jq" }, + { "name": "llvm" }, { "name": "NuGet.CommandLine" }, { "name": "openssl.light", diff --git a/images/win/toolsets/toolset-2022.json b/images/win/toolsets/toolset-2022.json index cd5dae932..f5b2d1686 100644 --- a/images/win/toolsets/toolset-2022.json +++ b/images/win/toolsets/toolset-2022.json @@ -245,6 +245,7 @@ { "name": "azcopy10" }, { "name": "Bicep" }, { "name": "jq" }, + { "name": "llvm" }, { "name": "NuGet.CommandLine" }, { "name": "openssl.light",