Retries, conan VS MD/14

This commit is contained in:
Ganesh Viswanathan 2020-06-19 13:32:01 -05:00
commit 7e0b0b1a2b
2 changed files with 8 additions and 4 deletions

View file

@ -129,7 +129,7 @@ proc execAction*(cmd: string, retry = 0, die = true, cache = false,
# On failure, retry or die as requested
if result.ret != 0:
if retry > 0:
sleep(500)
sleep(1000)
result = execAction(cmd, retry = retry - 1, die, cache, cacheKey)
elif die:
doAssert false, "Command failed: " & $result.ret & "\ncmd: " & ccmd &
@ -368,7 +368,7 @@ proc downloadUrl*(url, outdir: string, quiet = false) =
cmd = "powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget $# -OutFile $#"
else:
doAssert false, "No download tool available - curl, wget"
discard execAction(cmd % [url.quoteShell, (outdir/file).sanitizePath], retry = 1)
discard execAction(cmd % [url.quoteShell, (outdir/file).sanitizePath], retry = 3)
if ext == ".zip":
extractZip(file, outdir, quiet)
@ -436,12 +436,12 @@ proc gitPull*(url: string, outdir = "", plist = "", checkout = "", quiet = false
if checkout.len != 0:
if not quiet:
echo "# Checking out " & checkout
discard execAction(&"cd {outdirQ} && git fetch", retry = 1)
discard execAction(&"cd {outdirQ} && git fetch", retry = 3)
discard execAction(&"cd {outdirQ} && git checkout {checkout}")
else:
if not quiet:
echo "# Pulling repository"
discard execAction(&"cd {outdirQ} && git pull --depth=1 origin master", retry = 1)
discard execAction(&"cd {outdirQ} && git pull --depth=1 origin master", retry = 3)
proc gitTags*(outdir: string): seq[string] =
## Get all the git tags in the specified directory

View file

@ -208,6 +208,10 @@ proc getConanBuilds*(pkg: ConanPackage, filter = "") =
query &= &"&{filter}"
if "compiler=" notin filter and os != "windows":
query &= &"&compiler={compiler}&compiler.version=" & vfilter
if "compiler.runtime=" notin filter and os == "windows":
query &= &"&compiler.runtime=MD"
if "compiler.version=" notin filter and os == "windows":
query &= &"&compiler.version=14"
query.replace("&", "%20and%20")
else: ""