diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index ba6197d26..ccfdf0cc0 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -612,7 +612,8 @@ { "type": "powershell", "environment_vars": [ - "ROOT_FOLDER={{user `root_folder`}}" + "ROOT_FOLDER={{user `root_folder`}}", + "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ], "scripts":[ "{{ template_dir }}/scripts/Installers/Install-Boost.ps1" @@ -782,15 +783,6 @@ "{{ template_dir }}/scripts/Installers/Validate-Go.ps1" ] }, - { - "type": "powershell", - "environment_vars": [ - "ROOT_FOLDER={{user `root_folder`}}" - ], - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Boost.ps1" - ] - }, { "type": "powershell", "scripts":[ diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 3b5ba9d79..77935fd76 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -573,7 +573,8 @@ { "type": "powershell", "environment_vars": [ - "ROOT_FOLDER={{user `root_folder`}}" + "ROOT_FOLDER={{user `root_folder`}}", + "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ], "scripts":[ "{{ template_dir }}/scripts/Installers/Install-Boost.ps1" @@ -767,15 +768,6 @@ "{{ template_dir }}/scripts/Installers/Validate-Go.ps1" ] }, - { - "type": "powershell", - "environment_vars": [ - "ROOT_FOLDER={{user `root_folder`}}" - ], - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Boost.ps1" - ] - }, { "type": "powershell", "scripts":[ diff --git a/images/win/scripts/Installers/Install-Boost.ps1 b/images/win/scripts/Installers/Install-Boost.ps1 index d46a150c8..a11013fe3 100644 --- a/images/win/scripts/Installers/Install-Boost.ps1 +++ b/images/win/scripts/Installers/Install-Boost.ps1 @@ -8,11 +8,11 @@ Import-Module -Name ImageHelpers $SoftwareName = "Boost" $BoostDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName -$BoostVersions = (Get-ToolsByName -SoftwareName $SoftwareName).Versions | Foreach-Object {"{0}.0" -f $_} +$BoostVersions = (Get-ToolsetContent | Select-Object -ExpandProperty toolcache | Where-Object { $_.Name -eq "Boost"}).Versions foreach($BoostVersion in $BoostVersions) { - $BoostInstallationDir = Join-Path -Path $BoostDirectory -ChildPath $BoostVersion + $BoostInstallationDir = Join-Path -Path $BoostDirectory -ChildPath "$BoostVersion\X86_64" $EnvBoostPath = "BOOST_ROOT_{0}" -f ($BoostVersion.Replace('.', '_')) setx $EnvBoostPath $BoostInstallationDir /M | Out-Null diff --git a/images/win/scripts/Installers/Install-Toolset.ps1 b/images/win/scripts/Installers/Install-Toolset.ps1 index bc2aa59d2..197c52684 100644 --- a/images/win/scripts/Installers/Install-Toolset.ps1 +++ b/images/win/scripts/Installers/Install-Toolset.ps1 @@ -15,7 +15,13 @@ Function Install-Asset { $assetArchivePath = Start-DownloadWithRetry -Url $ReleaseAsset.download_url -Name $ReleaseAsset.filename Write-Host "Extract $($ReleaseAsset.filename) content..." - 7z.exe x $assetArchivePath -o"$assetFolderPath" -y | Out-Null + if ($assetArchivePath.EndsWith(".tar.gz")) { + $assetTarPath = $assetArchivePath.TrimEnd(".tar.gz") + Extract-7Zip -Path $assetArchivePath -DestinationPath $assetTarPath + Extract-7Zip -Path $assetTarPath -DestinationPath $assetFolderPath + } else { + Extract-7Zip -Path $assetArchivePath -DestinationPath $assetFolderPath + } Write-Host "Invoke installation script..." Push-Location -Path $assetFolderPath @@ -48,7 +54,7 @@ $ErrorActionPreference = "Stop" Import-Module -Name ImageHelpers -Force # Get toolcache content from toolset -$ToolsToInstall = @("Python", "Node") +$ToolsToInstall = @("Python", "Node", "Boost") $tools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache | Where {$ToolsToInstall -contains $_.Name} foreach ($tool in $tools) { @@ -60,7 +66,7 @@ foreach ($tool in $tools) { $asset = $assets | Where-Object version -like $toolVersion ` | Sort-Object -Property {[version]$_.version} -Descending ` | Select-Object -ExpandProperty files ` - | Where-Object { ($_.platform -eq $tool.platform) -and ($_.arch -eq $tool.arch) } ` + | Where-Object { ($_.platform -eq $tool.platform) -and ($_.arch -eq $tool.arch) -and ($_.toolset -eq $tool.toolset) } ` | Select-Object -First 1 Write-Host "Installing $($tool.name) $toolVersion $($tool.arch)..." diff --git a/images/win/scripts/Installers/Validate-Boost.ps1 b/images/win/scripts/Installers/Validate-Boost.ps1 deleted file mode 100644 index 83bf3d083..000000000 --- a/images/win/scripts/Installers/Validate-Boost.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -################################################################################ -## File: Validate-Boost.ps1 -## Desc: Validate Boost -################################################################################ - -Import-Module -Name ImageHelpers - -function Validate-BoostVersion -{ - Param - ( - [String]$BoostRootPath, - [String]$BoostRelease - ) - - $ReleasePath = Join-Path -Path $BoostRootPath -ChildPath $BoostRelease - - if (Test-Path "$ReleasePath\b2.exe") - { - Write-Host "Boost.Build $BoostRelease is successfully installed" - return - } - - Write-Host "$BoostRelease not found" - exit 1 -} - -$SoftwareName = 'Boost' -$BoostRootDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName -$BoostTools = Get-ToolsByName -SoftwareName $SoftwareName - -foreach ($BoostTool in $BoostTools) -{ - $BoostVersionsToInstall = $BoostTool.Versions | Foreach-Object {"{0}.0" -f $_} - foreach($BoostVersion in $BoostVersionsToInstall) - { - Validate-BoostVersion -BoostRootPath $BoostRootDirectory -BoostRelease $BoostVersion - } -} diff --git a/images/win/scripts/Installers/Validate-Toolset.ps1 b/images/win/scripts/Installers/Validate-Toolset.ps1 index c54600531..ad0ce41b1 100644 --- a/images/win/scripts/Installers/Validate-Toolset.ps1 +++ b/images/win/scripts/Installers/Validate-Toolset.ps1 @@ -67,8 +67,8 @@ foreach($tool in $tools) { foreach ($version in $tool.versions) { # Add wildcard if missing - if (-not $version.Contains('*')) { - $version += '.*' + if ($version.Split(".").Length -lt 3) { + $version += ".*" } # Check if version folder exists @@ -90,8 +90,10 @@ foreach($tool in $tools) { exit 1 } - Write-Host "Run validation test for $($tool.name)($($tool.arch)) $($foundVersion.name) executables..." - Run-ExecutableTests -Executables $toolExecs -ToolPath $foundVersionArchPath + if ($toolExecs) { + Write-Host "Run validation test for $($tool.name)($($tool.arch)) $($foundVersion.name) executables..." + Run-ExecutableTests -Executables $toolExecs -ToolPath $foundVersionArchPath + } } if (-not ([string]::IsNullOrEmpty($tool.default))) { diff --git a/images/win/toolcache-2016.json b/images/win/toolcache-2016.json index 449be64fa..b3f9c3c02 100644 --- a/images/win/toolcache-2016.json +++ b/images/win/toolcache-2016.json @@ -1,8 +1,5 @@ { "@actions/toolcache-ruby-windows-x64": [ "2.4", "2.5", "2.6", "2.7" - ], - "@actions/toolcache-boost-windows-msvc-14.1-x32-x64": [ - "1.69", "1.72" ] } \ No newline at end of file diff --git a/images/win/toolcache-2019.json b/images/win/toolcache-2019.json index 354f518f6..b3f9c3c02 100644 --- a/images/win/toolcache-2019.json +++ b/images/win/toolcache-2019.json @@ -1,11 +1,5 @@ { "@actions/toolcache-ruby-windows-x64": [ "2.4", "2.5", "2.6", "2.7" - ], - "@actions/toolcache-boost-windows-msvc-14.1-x32-x64": [ - "1.69" - ], - "@actions/toolcache-boost-windows-msvc-14.2-x32-x64": [ - "1.72" ] } \ No newline at end of file diff --git a/images/win/toolset-2016.json b/images/win/toolset-2016.json index 9eb2be40a..edc8dde25 100644 --- a/images/win/toolset-2016.json +++ b/images/win/toolset-2016.json @@ -47,6 +47,17 @@ "12.*", "14.*" ] + }, + { + "name": "Boost", + "url" : "https://raw.githubusercontent.com/actions/boost-versions/master/versions-manifest.json", + "arch": "x86_64", + "platform" : "win32", + "toolset": "msvc14.1", + "versions": [ + "1.69.0", + "1.72.0" + ] } ] } \ No newline at end of file diff --git a/images/win/toolset-2019.json b/images/win/toolset-2019.json index 9eb2be40a..ff5fef6ba 100644 --- a/images/win/toolset-2019.json +++ b/images/win/toolset-2019.json @@ -47,6 +47,26 @@ "12.*", "14.*" ] + }, + { + "name": "Boost", + "url" : "https://raw.githubusercontent.com/akv-platform/boost-hostedtoolcache/master/versions-manifest.json", + "arch": "x86_64", + "platform" : "win32", + "toolset": "msvc14.1", + "versions": [ + "1.69.0" + ] + }, + { + "name": "Boost", + "url" : "https://raw.githubusercontent.com/actions/boost-versions/master/versions-manifest.json", + "arch": "x86_64", + "platform" : "win32", + "toolset": "msvc14.2", + "versions": [ + "1.72.0" + ] } ] } \ No newline at end of file