From 176d9ce09c8abcc232a4bd5ebc2ac6d6413113af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 5 Mar 2020 13:19:10 +0100 Subject: Don't manually rerun conan Run-Conan-Install Modern conan will retry downloads on its own. Change default number of attempts to 5 for more reliability. Change-Id: Iafd4845b31c3e5fb296ba0b897cbf2030c412b04 Reviewed-by: Oliver Wolff --- coin/provisioning/common/windows/conan.ps1 | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/coin/provisioning/common/windows/conan.ps1 b/coin/provisioning/common/windows/conan.ps1 index c5984e26..e7e0de22 100644 --- a/coin/provisioning/common/windows/conan.ps1 +++ b/coin/provisioning/common/windows/conan.ps1 @@ -77,27 +77,20 @@ function Run-Conan-Install $manifestsDir = "$PSScriptRoot\conan_manifests" $buildinfoRoot = "C:\Utils\conanbuildinfos" + # Make up to 5 attempts for all download operations in conan + $env:CONAN_RETRY = "5" + Get-ChildItem -Path "$ConanfilesDir\*.txt" | ForEach-Object { $conanfile = $_.FullName $outpwd = "$buildinfoRoot\$BuildinfoDir\$($_.BaseName)" New-Item $outpwd -Type directory -Force | Out-Null - for ($i = 1; $i -le 5; $i++) { - try { - Push-Location $outpwd - Run-Executable "$scriptsPath\conan.exe" "install --no-imports --verify $manifestsDir", ` - '-s', ('compiler="' + $Compiler + '"'), ` - "-s os=Windows -s arch=$Arch -s compiler.version=$CompilerVersion $extraArgs $conanfile" - break; - } catch { - if ($i -eq 5) { - throw "Could not install conan content" - } - } finally { - Pop-Location - } - } + Push-Location $outpwd + Run-Executable "$scriptsPath\conan.exe" "install --no-imports --verify $manifestsDir", ` + '-s', ('compiler="' + $Compiler + '"'), ` + "-s os=Windows -s arch=$Arch -s compiler.version=$CompilerVersion $extraArgs $conanfile" + Pop-Location Copy-Item -Path $conanfile -Destination "$outpwd\conanfile.txt" } -- cgit v1.2.3