diff --git a/koch.nim b/koch.nim index 3d52d6f380f9..a2c1f16736af 100644 --- a/koch.nim +++ b/koch.nim @@ -9,6 +9,9 @@ # See doc/koch.txt for documentation. # +const + NimbleStableCommit = "d15c8530cb7480ce39ffa85a2dd9819d2d4fc645" # 0.10.2 + when defined(gcc) and defined(windows): when defined(x86): {.link: "icons/koch.res".} @@ -118,31 +121,22 @@ proc csource(args: string) = "--main:compiler/nim.nim compiler/installer.ini $1") % [args, VersionAsString, compileNimInst]) -proc bundleNimbleSrc(latest: bool) = - ## bunldeNimbleSrc() bundles a specific Nimble commit with the tarball. We - ## always bundle the latest official release. - if not dirExists("dist/nimble/.git"): - exec("git clone https://github.com/nim-lang/nimble.git dist/nimble") - if not latest: - withDir("dist/nimble"): - exec("git checkout -f stable") - exec("git pull") - proc bundleC2nim() = if not dirExists("dist/c2nim/.git"): exec("git clone https://github.com/nim-lang/c2nim.git dist/c2nim") nimCompile("dist/c2nim/c2nim", options = "--noNimblePath --path:.") proc bundleNimbleExe(latest: bool) = - bundleNimbleSrc(latest) + if not dirExists("dist/nimble/.git"): + exec("git clone https://github.com/nim-lang/nimble.git dist/nimble") + if not latest: + withDir("dist/nimble"): + exec("git fetch") + exec("git checkout " & NimbleStableCommit) # installer.ini expects it under $nim/bin nimCompile("dist/nimble/src/nimble.nim", options = "-d:release --nilseqs:on") proc buildNimble(latest: bool) = - # old installations created nim/nimblepkg/*.nim files. We remove these - # here so that it cannot cause problems (nimble bug #306): - if dirExists("bin/nimblepkg"): - removeDir("bin/nimblepkg") # if koch is used for a tar.xz, build the dist/nimble we shipped # with the tarball: var installDir = "dist/nimble" @@ -162,7 +156,7 @@ proc buildNimble(latest: bool) = exec("git pull") else: exec("git fetch") - exec("git checkout tags/v0.10.2") + exec("git checkout " & NimbleStableCommit) nimCompile(installDir / "src/nimble.nim", options = "--noNimblePath --nilseqs:on -d:release") proc bundleNimsuggest() = @@ -200,9 +194,6 @@ proc ensureCleanGit() = proc xz(latest: bool; args: string) = ensureCleanGit() - bundleNimbleSrc(latest) - when false: - bundleNimsuggest() nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" % [VersionAsString, compileNimInst]) exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim xz compiler/installer.ini" % @@ -383,7 +374,7 @@ proc winReleaseArch(arch: string) = inFold "winrelease koch": nimexec "c --cpu:$# koch" % cpu kochExecFold("winrelease boot", "boot -d:release --cpu:$#" % cpu) - kochExecFold("winrelease zip", "--latest zip -d:release") + kochExecFold("winrelease zip", "zip -d:release") overwriteFile r"build\nim-$#.zip" % VersionAsString, r"web\upload\download\nim-$#_x$#.zip" % [VersionAsString, arch] @@ -545,7 +536,7 @@ proc testUnixInstall(cmdLineRest: string) = # check the docs build: execCleanPath("./koch docs", destDir / "bin") # check nimble builds: - execCleanPath("./koch --latest tools") + execCleanPath("./koch tools") # check the tests work: putEnv("NIM_EXE_NOT_IN_PATH", "NOT_IN_PATH") execCleanPath("./koch tests --nim:./bin/nim cat megatest", destDir / "bin")