From 8a8e9077bd941d4b5172d500c8376fcf6c28fe51 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Sun, 14 Jun 2020 16:53:24 -0500 Subject: Handle bad conan uri, test Windows static --- nimterop/conan.nim | 16 +++++++--------- tests/getheader.nims | 3 +++ tests/zlib.nim | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/nimterop/conan.nim b/nimterop/conan.nim index 872d138..95ab24f 100644 --- a/nimterop/conan.nim +++ b/nimterop/conan.nim @@ -40,12 +40,6 @@ const conanPackage = "conan_package.tgz" conanManifest = "conanmanifest.txt" -# https://github.com/kdheepak/binary-builder-downloader/blob/master/src/bbd.nim -# https://bintray.com/conan/conan-center -# https://bintray.com/bincrafters/public-conan/ - -# https://docs.conan.io/en/latest/howtos/manage_shared_libraries.html#manage-shared - var # Bintray download URL for explicit `user/channel` baseAltUrl {.compiletime.} = { @@ -73,7 +67,10 @@ proc jsonGet(url: string): JsonNode = file downloadUrl(url, temp, quiet = true) - result = readFile(file).parseJson() + try: + result = readFile(file).parseJson() + except JsonParsingError: + discard rmFile(file) proc `==`*(pkg1, pkg2: ConanPackage): bool = @@ -352,10 +349,11 @@ proc downloadConan*(pkg: ConanPackage, outdir: string, clean = true) = elif clean: cleanDir(outdir) - echo &"# Downloading {pkg.name} v{pkg.version} from Conan" - pkg.getConanBuilds() + doAssert pkg.recipes.len != 0, &"# Failed to download {pkg.name} v{pkg.version} from Conan - check https://conan.io/center" + + echo &"# Downloading {pkg.name} v{pkg.version} from Conan" for recipe, builds in pkg.recipes: for build in builds: if pkg.bhash.len == 0 or pkg.bhash == build.bhash: diff --git a/tests/getheader.nims b/tests/getheader.nims index 55d00f1..349b9bb 100644 --- a/tests/getheader.nims +++ b/tests/getheader.nims @@ -39,6 +39,9 @@ when defined(posix): # conan static testCall(cmd & " -d:libssh2Conan -d:libssh2SetVer=1.9.0 -d:libssh2Static" & sshcmd, zexp, 0) +else: + # conan static for Windows + testCall(cmd & " -d:zlibConan -d:zlibSetVer=1.2.11 -d:zlibStatic" & zrcmd, zexp, 0) # git testCall(cmd & " -d:envTest" & zrcmd, zexp, 0) diff --git a/tests/zlib.nim b/tests/zlib.nim index 852dca9..15400d4 100644 --- a/tests/zlib.nim +++ b/tests/zlib.nim @@ -27,6 +27,7 @@ getHeader( "zlib.h", giturl = "https://github.com/madler/zlib", dlurl = "http://zlib.net/zlib-$1.tar.gz", + conanuri = "zlib/$1", outdir = baseDir, altNames = "z,zlib" ) -- cgit v1.2.3