Switch provisioners to install Boost from GitHub releases on Windows (#972)

* switch provisioners to install boost from github releases

* minor fixes

* separate boosts by toolset versions

* minor fix

* switch provisioners for win16

* fix bugs

* fix validation

* minor fix

* fix validation

* fix validation

* fix validation

* minor fix

* change toolset version for win16

* minor fixes

* minor fix

* fix validation

* update links to toolset-json

* add arch to BoostInstallationDir
This commit is contained in:
Dibir Magomedsaygitov
2020-06-10 19:42:15 +03:00
committed by GitHub
parent a0b45fba7a
commit f33a870bf1
10 changed files with 52 additions and 77 deletions

View File

@@ -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

View File

@@ -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)..."

View File

@@ -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
}
}

View File

@@ -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))) {