From 5dc0404dee0f64e801761080e06d8ba5324ab29f Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Mon, 15 Jan 2018 05:17:40 -0600 Subject: [PATCH 01/11] Fix for #398 (#451) * Fix for #398 * Updated fix for #398 --- src/nimblepkg/publish.nim | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/src/nimblepkg/publish.nim b/src/nimblepkg/publish.nim index 96251d9b..c597aa37 100644 --- a/src/nimblepkg/publish.nim +++ b/src/nimblepkg/publish.nim @@ -11,8 +11,7 @@ import tools, common, cli, config, options type Auth = object user: string - pw: string - token: string ## base64 encoding of user:pw + token: string ## Github access token http: HttpClient ## http client for doing API requests const @@ -50,8 +49,9 @@ proc requestNewToken(cfg: Config): string = sleep(3000) return token -proc getGithubAuth(cfg: Config): Auth = - result.http = newHttpClient() +proc getGithubAuth(o: Options): Auth = + let cfg = o.config + result.http = newHttpClient(proxy = getProxy(o)) # always prefer the environment variable to asking for a new one if existsEnv(ApiTokenEnvironmentVariable): result.token = getEnv(ApiTokenEnvironmentVariable) @@ -150,21 +150,9 @@ proc editJson(p: PackageInfo; url, tags, downloadMethod: string) = }) writeFile("packages.json", contents.pretty.cleanupWhitespace) -proc getPackageOriginUrl(a: Auth): string = - ## Adds 'user:pw' to the URL so that the user is not asked *again* for it. - ## We need this for 'git push'. - let (output, exitCode) = doCmdEx("git ls-remote --get-url") - result = "origin" - if exitCode == 0: - result = output.string.strip - if result.endsWith(".git"): result.setLen(result.len - 4) - if result.startsWith("https://"): - result = "https://" & a.user & ':' & a.pw & '@' & - result["https://".len .. ^1] - proc publish*(p: PackageInfo, o: Options) = ## Publishes the package p. - let auth = getGithubAuth(o.config) + let auth = getGithubAuth(o) var pkgsDir = getTempDir() / "nimble-packages-fork" if not forkExists(auth): createFork(auth) @@ -177,13 +165,17 @@ proc publish*(p: PackageInfo, o: Options) = display("Removing", "old packages fork git directory.", priority = LowPriority) removeDir(pkgsDir) - display("Cloning", "packages into: " & pkgsDir, priority = HighPriority) - doCmd("git clone git@github.com:" & auth.user & "/packages " & pkgsDir) - # Make sure to update the clone. - display("Updating", "the fork", priority = HighPriority) + createDir(pkgsDir) cd pkgsDir: + # Avoid git clone to prevent token from being stored in repo + # https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and-oauth + display("Copying", "packages fork into: " & pkgsDir, priority = HighPriority) + doCmd("git init") + doCmd("git pull https://github.com/" & auth.user & "/packages") + # Make sure to update the fork + display("Updating", "the fork", priority = HighPriority) doCmd("git pull https://github.com/nim-lang/packages.git master") - doCmd("git push origin master") + doCmd("git push https://" & auth.token & "@github.com/" & auth.user & "/packages master") if not dirExists(pkgsDir): raise newException(NimbleError, @@ -227,6 +219,6 @@ proc publish*(p: PackageInfo, o: Options) = doCmd("git checkout -B " & branchName) doCmd("git commit packages.json -m \"Added package " & p.name & "\"") display("Pushing", "to remote of fork.", priority = HighPriority) - doCmd("git push " & getPackageOriginUrl(auth) & " " & branchName) + doCmd("git push https://" & auth.token & "@github.com/" & auth.user & "/packages " & branchName) createPullRequest(auth, p.name, branchName) display("Success:", "Pull request successful.", Success, HighPriority) \ No newline at end of file From fd84b139bd35d77834ce144668351d7f50d109e8 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sat, 27 Jan 2018 15:36:45 +0000 Subject: [PATCH 02/11] Fixes breaking changes in 0.18.0. --- src/nimblepkg/packageinfo.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimblepkg/packageinfo.nim b/src/nimblepkg/packageinfo.nim index 0428d2aa..9c384ff5 100644 --- a/src/nimblepkg/packageinfo.nim +++ b/src/nimblepkg/packageinfo.nim @@ -463,7 +463,7 @@ proc iterFilesWithExt(dir: string, pkgInfo: PackageInfo, if kind == pcDir: iterFilesWithExt(path, pkgInfo, action) else: - if path.splitFile.ext[1 .. ^1] in pkgInfo.installExt: + if path.splitFile.ext.substr(1) in pkgInfo.installExt: action(path) proc iterFilesInDir(dir: string, action: proc (f: string)) = From 2b9215256bade9d7846c9bcbba56e470b91b5182 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sat, 27 Jan 2018 15:37:19 +0000 Subject: [PATCH 03/11] Show friendly error message when stdlib is outdated. --- src/nimblepkg/nimscriptsupport.nim | 45 +++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/nimblepkg/nimscriptsupport.nim b/src/nimblepkg/nimscriptsupport.nim index f86eb695..02229802 100644 --- a/src/nimblepkg/nimscriptsupport.nim +++ b/src/nimblepkg/nimscriptsupport.nim @@ -16,7 +16,7 @@ from compiler/astalgo import strTableGet import compiler/options as compiler_options import common, version, options, packageinfo, cli -import os, strutils, strtabs, tables, times, osproc, sets +import os, strutils, strtabs, tables, times, osproc, sets, pegs when not declared(resetAllModulesHard): import compiler/modulegraphs @@ -214,6 +214,33 @@ proc getNimPrefixDir(options: Options): string = # the code responsible for this. result = "" +proc getLibVersion(lib: string): Version = + ## This is quite a hacky procedure, but there is no other way to extract + ## this out of the ``system`` module. We could evaluate it, but that would + ## cause an error if the stdlib is out of date. The purpose of this + ## proc is to give a nice error message to the user instead of a confusing + ## Nim compile error. + let systemPath = lib / "system.nim" + if not fileExists(systemPath): + raiseNimbleError("system module not found in stdlib path: " & lib) + + let systemFile = readFile(systemPath) + let majorPeg = peg"'NimMajor' @ '=' \s* {\d*}" + let minorPeg = peg"'NimMinor' @ '=' \s* {\d*}" + let patchPeg = peg"'NimPatch' @ '=' \s* {\d*}" + + var majorMatches: array[1, string] + let major = find(systemFile, majorPeg, majorMatches) + var minorMatches: array[1, string] + let minor = find(systemFile, minorPeg, minorMatches) + var patchMatches: array[1, string] + let patch = find(systemFile, patchPeg, patchMatches) + + if major != -1 and minor != -1 and patch != -1: + return newVersion(majorMatches[0] & "." & minorMatches[0] & "." & patchMatches[0]) + else: + return system.NimVersion.newVersion() + when declared(ModuleGraph): var graph: ModuleGraph @@ -249,6 +276,22 @@ proc execScript(scriptName: string, flags: Flags, options: Options): PSym = "more info." raiseNimbleError(msg, hint) + # Verify that the stdlib that was found isn't older than the stdlib that Nimble + # was compiled with. + let libVersion = getLibVersion(compiler_options.libpath) + if NimVersion.newVersion() > libVersion: + let msg = ("Nimble cannot use an older stdlib than the one it was compiled " & + "with.\n Stdlib in '$#' has version: $#.\n Nimble needs at least: $#.") % + [compiler_options.libpath, $libVersion, NimVersion] + let hint = "You may be running a newer version of Nimble than you intended " & + "to. Run an older version of Nimble that is compatible with " & + "the stdlib that Nimble is attempting to use or set the environment variable " & + "NIM_LIB_PREFIX to where a different stdlib's `lib` directory is located as " & + "a workaround." & + "See https://github.com/nim-lang/nimble#troubleshooting for " & + "more info." + raiseNimbleError(msg, hint) + let pkgName = scriptName.splitFile.name # Ensure that "nimblepkg/nimscriptapi" is in the PATH. From d00f59708a532a9c841361b325b2654cf36798b6 Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Tue, 30 Jan 2018 17:01:31 +0200 Subject: [PATCH 04/11] Fixed nimble path --- src/nimble.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nimble.nim b/src/nimble.nim index a6d52abc..407b207f 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -625,7 +625,7 @@ proc listPaths(options: Options) = var installed: seq[VersionAndPath] = @[] # There may be several, list all available ones and sort by version. for kind, path in walkDir(options.getPkgsDir): - if kind != pcDir or not path.startsWith(options.getPkgsDir / name): + if kind != pcDir or not path.startsWith(options.getPkgsDir / name & "-"): continue var nimbleFile = findNimbleFile(path, false) @@ -634,7 +634,7 @@ proc listPaths(options: Options) = var v: VersionAndPath v.version = newVersion(pkgInfo.specialVersion) v.path = pkgInfo.getRealDir() - installed = @[v] + installed.add(v) else: display("Warning:", "No .nimble file found for " & path, Warning, MediumPriority) From 383e4fd7bc0c9182d6b89b8ec2fb7c2183431dbd Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Wed, 21 Feb 2018 19:06:42 +0000 Subject: [PATCH 05/11] Merges #450 manually with some adjustments. --- src/nimblepkg/options.nim | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/nimblepkg/options.nim b/src/nimblepkg/options.nim index b220b423..b1591b09 100644 --- a/src/nimblepkg/options.nim +++ b/src/nimblepkg/options.nim @@ -221,11 +221,17 @@ proc renameBabelToNimble(options: Options) {.deprecated.} = removeFile(nimbleDir / "babeldata.json") proc getNimbleDir*(options: Options): string = - result = - if options.nimbleDir.len == 0: - options.config.nimbleDir - else: - options.nimbleDir + result = options.config.nimbleDir + if options.nimbleDir.len != 0: + # --nimbleDir: takes priority... + result = options.nimbleDir + else: + # ...followed by the environment variable. + let env = getEnv("NIMBLE_DIR") + if env.len != 0: + display("Warning:", "Using the environment variable: NIMBLE_DIR='" & + env & "'", Warning) + result = env return expandTilde(result) @@ -319,7 +325,7 @@ proc parseFlag*(flag, val: string, result: var Options, kind = cmdLongOption) = proc initOptions*(): Options = result.action.typ = actionNil result.pkgInfoCache = newTable[string, PackageInfo]() - result.nimbleDir = getEnv("NIMBLE_DIR") + result.nimbleDir = "" result.verbosity = HighPriority proc parseMisc(options: var Options) = @@ -366,11 +372,6 @@ proc parseCmdLine*(): Options = if result.action.typ == actionNil and not result.showVersion: result.showHelp = true - # Inform user that we use their environment variables. - if result.getNimbleDir == getEnv("NIMBLE_DIR"): - display("Info:", "Using the 'NIMBLE_DIR' environment variable.", - priority = HighPriority) - proc getProxy*(options: Options): Proxy = ## Returns ``nil`` if no proxy is specified. var url = "" From 7d3f3f9127ed7f6df08b313467d444a1064d266e Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Wed, 21 Feb 2018 20:22:32 +0000 Subject: [PATCH 06/11] Fixes #445. --- src/nimblepkg/options.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nimblepkg/options.nim b/src/nimblepkg/options.nim index b1591b09..725b5ba0 100644 --- a/src/nimblepkg/options.nim +++ b/src/nimblepkg/options.nim @@ -253,9 +253,10 @@ proc parseArgument*(key: string, result: var Options) = # Parse pkg@verRange if '@' in key: let i = find(key, '@') - let pkgTup = (key[0 .. i-1], - key[i+1 .. key.len-1].parseVersionRange()) - result.action.packages.add(pkgTup) + let (pkgName, pkgVer) = (key[0 .. i-1], key[i+1 .. key.len-1]) + if pkgVer.len == 0: + raise newException(NimbleError, "Version range expected after '@'.") + result.action.packages.add((pkgName, pkgVer.parseVersionRange())) else: result.action.packages.add((key, VersionRange(kind: verAny))) of actionRefresh: From 25ffe273f7dce4016cbb329c07d2a4b8abe93e39 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Fri, 23 Feb 2018 22:27:14 +0000 Subject: [PATCH 07/11] Implements #421. --- src/nimble.nim | 19 ++++++----- src/nimblepkg/download.nim | 59 +++++++++++++++++++++-------------- src/nimblepkg/packageinfo.nim | 2 +- tests/tester.nim | 5 +++ 4 files changed, 54 insertions(+), 31 deletions(-) diff --git a/src/nimble.nim b/src/nimble.nim index 407b207f..edb3b3dd 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -434,13 +434,16 @@ proc installFromDir(dir: string, requestedVer: VersionRange, options: Options, Success, HighPriority) proc getDownloadInfo*(pv: PkgTuple, options: Options, - doPrompt: bool): (DownloadMethod, string) = + doPrompt: bool): (DownloadMethod, string, + Table[string, string]) = if pv.name.isURL: - return (checkUrlType(pv.name), pv.name) + let (url, metadata) = getUrlData(pv.name) + return (checkUrlType(url), url, metadata) else: var pkg: Package if getPackage(pv.name, options, pkg): - return (pkg.downloadMethod.getDownloadMethod(), pkg.url) + let (url, metadata) = getUrlData(pkg.url) + return (pkg.downloadMethod.getDownloadMethod(), url, metadata) else: # If package is not found give the user a chance to refresh # package.json @@ -464,9 +467,10 @@ proc install(packages: seq[PkgTuple], else: # Install each package. for pv in packages: - let (meth, url) = getDownloadInfo(pv, options, doPrompt) + let (meth, url, metadata) = getDownloadInfo(pv, options, doPrompt) + let subdir = metadata.getOrDefault("subdir") let (downloadDir, downloadVersion) = - downloadPkg(url, pv.ver, meth, options) + downloadPkg(url, pv.ver, meth, subdir, options) try: # Run pre-install hook in download directory now that package is downloaded cd downloadDir: @@ -1005,8 +1009,9 @@ proc develop(options: Options) = let hint = "Remove the directory, or run this command somewhere else." raiseNimbleError(msg, hint) - let (meth, url) = getDownloadInfo(pv, options, true) - discard downloadPkg(url, pv.ver, meth, options, downloadDir) + let (meth, url, metadata) = getDownloadInfo(pv, options, true) + let subdir = metadata.getOrDefault("subdir") + discard downloadPkg(url, pv.ver, meth, subdir, options, downloadDir) developFromDir(downloadDir, options) proc test(options: Options) = diff --git a/src/nimblepkg/download.nim b/src/nimblepkg/download.nim index 216c36e9..cad8d3d4 100644 --- a/src/nimblepkg/download.nim +++ b/src/nimblepkg/download.nim @@ -1,7 +1,7 @@ # Copyright (C) Dominik Picheta. All rights reserved. # BSD License. Look at license.txt for more info. -import parseutils, os, osproc, strutils, tables, pegs +import parseutils, os, osproc, strutils, tables, pegs, uri import packageinfo, packageparser, version, tools, common, options, cli @@ -132,13 +132,24 @@ proc checkUrlType*(url: string): DownloadMethod = elif doCmdEx("hg identify " & url).exitCode == QuitSuccess: return DownloadMethod.hg else: - raise newException(NimbleError, "Unable to identify url.") + raise newException(NimbleError, "Unable to identify url: " & url) + +proc getUrlData*(url: string): (string, Table[string, string]) = + var uri = parseUri(url) + # TODO: use uri.parseQuery once it lands... this code is quick and dirty. + var subdir = "" + if uri.query.startsWith("subdir="): + subdir = uri.query[7 .. ^1] + + uri.query = "" + return ($uri, {"subdir": subdir}.toTable()) proc isURL*(name: string): bool = name.startsWith(peg" @'://' ") -proc doDownload*(url: string, downloadDir: string, verRange: VersionRange, - downMethod: DownloadMethod, options: Options): Version = +proc doDownload(url: string, downloadDir: string, verRange: VersionRange, + downMethod: DownloadMethod, + options: Options): Version = ## Downloads the repository specified by ``url`` using the specified download ## method. ## @@ -159,16 +170,6 @@ proc doDownload*(url: string, downloadDir: string, verRange: VersionRange, # Result should already be set to #head here. assert(not result.isNil) - proc verifyClone() = - ## Makes sure that the downloaded package's version satisfies the requested - ## version range. - let pkginfo = getPkgInfo(downloadDir, options) - if pkginfo.version.newVersion notin verRange: - raise newException(NimbleError, - "Downloaded package's version does not satisfy requested version " & - "range: wanted $1 got $2." % - [$verRange, $pkginfo.version]) - removeDir(downloadDir) if verRange.kind == verSpecial: # We want a specific commit/branch/tag here. @@ -197,8 +198,6 @@ proc doDownload*(url: string, downloadDir: string, verRange: VersionRange, else: # If no commits have been tagged on the repo we just clone HEAD. doClone(downMethod, url, downloadDir) # Grab HEAD. - - verifyClone() of DownloadMethod.hg: doClone(downMethod, url, downloadDir) result = getHeadName(downMethod) @@ -210,10 +209,9 @@ proc doDownload*(url: string, downloadDir: string, verRange: VersionRange, priority = MediumPriority) doCheckout(downMethod, downloadDir, latest.tag) - verifyClone() - proc downloadPkg*(url: string, verRange: VersionRange, downMethod: DownloadMethod, + subdir: string, options: Options, downloadPath = ""): (string, Version) = ## Downloads the repository as specified by ``url`` and ``verRange`` using @@ -221,8 +219,8 @@ proc downloadPkg*(url: string, verRange: VersionRange, ## ## If `downloadPath` isn't specified a location in /tmp/ will be used. ## - ## Returns the directory where it was downloaded and the concrete version - ## which was downloaded. + ## Returns the directory where it was downloaded (subdir is appended) and + ## the concrete version which was downloaded. let downloadDir = if downloadPath == "": (getNimbleTempDir() / getDownloadDirName(url, verRange)) @@ -241,13 +239,28 @@ proc downloadPkg*(url: string, verRange: VersionRange, if modUrl.contains("github.com") and modUrl.endswith("/"): modUrl = modUrl[0 .. ^2] - display("Downloading", "$1 using $2" % [modUrl, $downMethod], - priority = HighPriority) + if subdir.len > 0: + display("Downloading", "$1 using $2 (subdir is '$3')" % + [modUrl, $downMethod, subdir], + priority = HighPriority) + else: + display("Downloading", "$1 using $2" % [modUrl, $downMethod], + priority = HighPriority) result = ( - downloadDir, + downloadDir / subdir, doDownload(modUrl, downloadDir, verRange, downMethod, options) ) + if verRange.kind != verSpecial: + ## Makes sure that the downloaded package's version satisfies the requested + ## version range. + let pkginfo = getPkgInfo(result[0], options) + if pkginfo.version.newVersion notin verRange: + raise newException(NimbleError, + "Downloaded package's version does not satisfy requested version " & + "range: wanted $1 got $2." % + [$verRange, $pkginfo.version]) + proc echoPackageVersions*(pkg: Package) = let downMethod = pkg.downloadMethod.getDownloadMethod() case downMethod diff --git a/src/nimblepkg/packageinfo.nim b/src/nimblepkg/packageinfo.nim index 9c384ff5..10e8bfae 100644 --- a/src/nimblepkg/packageinfo.nim +++ b/src/nimblepkg/packageinfo.nim @@ -304,7 +304,7 @@ proc findNimbleFile*(dir: string; error: bool): string = elif hits == 0: if error: raise newException(NimbleError, - "Specified directory does not contain a .nimble file.") + "Specified directory ($1) does not contain a .nimble file." % dir) else: display("Warning:", "No .nimble or .nimble-link file found for " & dir, Warning, HighPriority) diff --git a/tests/tester.nim b/tests/tester.nim index 68f2e08c..c907348b 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -675,3 +675,8 @@ suite "check command": check outp.processOutput.inLines("failure") check outp.processOutput.inLines("validation failed") check outp.processOutput.inLines("package 'x' has an incorrect structure") + +suite "multi": + test "can install package from git subdir": + let args = ["install", "-y", "https://github.com/nimble-test/multi?subdir=alpha"] + check execNimble(args).exitCode == QuitSuccess \ No newline at end of file From 7e3058657c4ff3ca70288595fc2a21f791c50f7c Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Fri, 23 Feb 2018 22:43:28 +0000 Subject: [PATCH 08/11] Fixes problem with subdirs and 'develop'. Documents package urls. --- readme.markdown | 16 ++++++++++++++-- src/nimble.nim | 2 +- tests/tester.nim | 5 +++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/readme.markdown b/readme.markdown index e1c80c9f..c4146847 100644 --- a/readme.markdown +++ b/readme.markdown @@ -183,8 +183,17 @@ the current working directory. This can be useful for developers who are testing locally their ``.nimble`` files before submitting them to the official package list. See the [Creating Packages](#creating-packages) section for more info on this. -A URL to a repository can also be specified, Nimble will automatically detect -the type of the repository that the url points to and install it. +#### Package URLs + +A valid URL to a Git or Merurial repository can also be specified, Nimble will +automatically detect the type of the repository that the url points to and +install it. + +For repositories containing the Nimble package in a subdirectory, you can +instruct Nimble about the location of your package using the ``?subdir=`` +query parameter. For example: + + $ nimble install https://github.com/nimble-test/multi?subdir=alpha ### nimble develop @@ -206,6 +215,9 @@ current working directory. The ``jester`` package will be cloned into ``./jester`` and it will be linked to your installation directory. +Just as with the ``install`` command, a package URL may also be specified +instead of a name. + ### nimble uninstall The ``uninstall`` command will remove an installed package. Attempting to remove diff --git a/src/nimble.nim b/src/nimble.nim index edb3b3dd..f51f7fdc 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -1012,7 +1012,7 @@ proc develop(options: Options) = let (meth, url, metadata) = getDownloadInfo(pv, options, true) let subdir = metadata.getOrDefault("subdir") discard downloadPkg(url, pv.ver, meth, subdir, options, downloadDir) - developFromDir(downloadDir, options) + developFromDir(downloadDir / subdir, options) proc test(options: Options) = ## Executes all tests. diff --git a/tests/tester.nim b/tests/tester.nim index c907348b..f94ec455 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -679,4 +679,9 @@ suite "check command": suite "multi": test "can install package from git subdir": let args = ["install", "-y", "https://github.com/nimble-test/multi?subdir=alpha"] + check execNimble(args).exitCode == QuitSuccess + + test "can develop package from git subdir": + removeDir("nimble-test/multi") + let args = ["develop", "-y", "https://github.com/nimble-test/multi?subdir=beta"] check execNimble(args).exitCode == QuitSuccess \ No newline at end of file From cf1b83792d1d46f9ae299847e0a28df2bc29895d Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Fri, 23 Feb 2018 22:44:57 +0000 Subject: [PATCH 09/11] Run travis tests against 0.17.2 instead of 0.17.0. --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc1bf7e8..f9acefc0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,16 +6,16 @@ language: c install: - | - wget https://nim-lang.org/download/nim-0.17.0.tar.xz - tar -xf nim-0.17.0.tar.xz - cd nim-0.17.0 + wget https://nim-lang.org/download/nim-0.17.2.tar.xz + tar -xf nim-0.17.2.tar.xz + cd nim-0.17.2 sh build.sh cd .. before_script: - set -e - set -x - - export PATH=`pwd`/nim-0.17.0/bin:$PATH + - export PATH=`pwd`/nim-0.17.2/bin:$PATH script: - cd tests From 6a2da5627c029460f6f714a44f5275762102fa4b Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Fri, 23 Feb 2018 23:15:12 +0000 Subject: [PATCH 10/11] Version 0.8.10. --- changelog.markdown | 32 ++++++++++++++++++++++++++++++++ src/nimblepkg/common.nim | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/changelog.markdown b/changelog.markdown index 9c487c6d..29c1bef2 100644 --- a/changelog.markdown +++ b/changelog.markdown @@ -3,6 +3,38 @@ # Nimble changelog +## 0.8.10 - 23/02/2018 + +The first release of 2018! Another fairly big release containing 40 commits. +This release fixes many +issues, with most being fixed by our brilliant contributors. Thanks a lot +everyone! + +One big new feature is the new support for multiple Nimble packages in a single +Git/Hg repository. You can now specify ``?subdir=`` at the end of your +repo's URL and Nimble will know to look in ```` for your package. + +* **Implemented support for multi-package repos.** See + [#421](https://github.com/nim-lang/nimble/issues/421) for the relevant issue. +* **Better error message when the user has an outdated stdlib version that confuses Nimble** +* **The validity of a Nimble package can now be checked using the new ``check`` command** +* Nimble no longer silently ignores an erroneous '@' in for example + ``nimble install compiler@``. +* Issues with the ``nimble path`` command have been fixed. +* The ``nimble publish`` command has been improved and stabilised. +* Messages for the ``NIM_LIB_PREFIX`` env var have been improved. +* ``before install`` is now called when packages are installed by their name. + See [#280](https://github.com/nim-lang/nimble/issues/280). +* Fixed issue with ``nimble init``. See [#446](https://github.com/nim-lang/nimble/issues/446). +* Nimble now rejects [reserved names on Windows](https://github.com/nim-lang/nimble/commit/74856a87084b73451254555b2c20ad932cf84270). +* The ``NIMBLE_DIR`` environment variable is now supported, in addition to the + command line flag and config setting. +* The ``init`` command has been improved significantly. + +---- + +Full changelog: https://github.com/nim-lang/nimble/compare/v0.8.8...v0.8.10 + ## 0.8.8 - 03/09/2017 This is a relatively big release containing 57 commits, with multiple new diff --git a/src/nimblepkg/common.nim b/src/nimblepkg/common.nim index 609432f4..436775e4 100644 --- a/src/nimblepkg/common.nim +++ b/src/nimblepkg/common.nim @@ -63,4 +63,4 @@ when not defined(nimscript): return (error, hint) const - nimbleVersion* = "0.8.8" + nimbleVersion* = "0.8.10" From 64eb27419862044fca0c8595a0bd0a522aaf083a Mon Sep 17 00:00:00 2001 From: k0pernicus Date: Mon, 26 Feb 2018 18:46:29 +0100 Subject: [PATCH 11/11] Add a new troubleshooting --- readme.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.markdown b/readme.markdown index c4146847..be1ea69a 100644 --- a/readme.markdown +++ b/readme.markdown @@ -881,6 +881,10 @@ flag to the file ```src/nimble.nim.cfg```. After that, you can run ```src/nimble install``` and overwrite the existing installation. +* ``Could not download: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure`` + +If you are on macOS, you need to set and export the ```DYLD_LIBRARY_PATH``` environment variable to the directory where your OpenSSL libraries are. For example, if you use OpenSSL, you have to set ```export DYLD_LIBRARY_PATH=/usr/local/opt/openssl/lib``` in your ```$HOME/.bashrc``` file. + * ``Error: ambiguous identifier: 'version' --use nimscriptapi.version or system.version`` Make sure that you are running at least version 0.16.0 of Nim (or the latest nightly).