koch.nim: hotfix for nightly builds
This commit is contained in:
parent
abaa42fd8a
commit
e7471cebae
1 changed files with 12 additions and 21 deletions
33
koch.nim
33
koch.nim
|
|
@ -9,6 +9,9 @@
|
||||||
# See doc/koch.txt for documentation.
|
# See doc/koch.txt for documentation.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
const
|
||||||
|
NimbleStableCommit = "d15c8530cb7480ce39ffa85a2dd9819d2d4fc645" # 0.10.2
|
||||||
|
|
||||||
when defined(gcc) and defined(windows):
|
when defined(gcc) and defined(windows):
|
||||||
when defined(x86):
|
when defined(x86):
|
||||||
{.link: "icons/koch.res".}
|
{.link: "icons/koch.res".}
|
||||||
|
|
@ -118,31 +121,22 @@ proc csource(args: string) =
|
||||||
"--main:compiler/nim.nim compiler/installer.ini $1") %
|
"--main:compiler/nim.nim compiler/installer.ini $1") %
|
||||||
[args, VersionAsString, compileNimInst])
|
[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() =
|
proc bundleC2nim() =
|
||||||
if not dirExists("dist/c2nim/.git"):
|
if not dirExists("dist/c2nim/.git"):
|
||||||
exec("git clone https://github.com/nim-lang/c2nim.git dist/c2nim")
|
exec("git clone https://github.com/nim-lang/c2nim.git dist/c2nim")
|
||||||
nimCompile("dist/c2nim/c2nim", options = "--noNimblePath --path:.")
|
nimCompile("dist/c2nim/c2nim", options = "--noNimblePath --path:.")
|
||||||
|
|
||||||
proc bundleNimbleExe(latest: bool) =
|
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
|
# installer.ini expects it under $nim/bin
|
||||||
nimCompile("dist/nimble/src/nimble.nim", options = "-d:release --nilseqs:on")
|
nimCompile("dist/nimble/src/nimble.nim", options = "-d:release --nilseqs:on")
|
||||||
|
|
||||||
proc buildNimble(latest: bool) =
|
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
|
# if koch is used for a tar.xz, build the dist/nimble we shipped
|
||||||
# with the tarball:
|
# with the tarball:
|
||||||
var installDir = "dist/nimble"
|
var installDir = "dist/nimble"
|
||||||
|
|
@ -162,7 +156,7 @@ proc buildNimble(latest: bool) =
|
||||||
exec("git pull")
|
exec("git pull")
|
||||||
else:
|
else:
|
||||||
exec("git fetch")
|
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")
|
nimCompile(installDir / "src/nimble.nim", options = "--noNimblePath --nilseqs:on -d:release")
|
||||||
|
|
||||||
proc bundleNimsuggest() =
|
proc bundleNimsuggest() =
|
||||||
|
|
@ -200,9 +194,6 @@ proc ensureCleanGit() =
|
||||||
|
|
||||||
proc xz(latest: bool; args: string) =
|
proc xz(latest: bool; args: string) =
|
||||||
ensureCleanGit()
|
ensureCleanGit()
|
||||||
bundleNimbleSrc(latest)
|
|
||||||
when false:
|
|
||||||
bundleNimsuggest()
|
|
||||||
nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
||||||
[VersionAsString, compileNimInst])
|
[VersionAsString, compileNimInst])
|
||||||
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim xz compiler/installer.ini" %
|
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":
|
inFold "winrelease koch":
|
||||||
nimexec "c --cpu:$# koch" % cpu
|
nimexec "c --cpu:$# koch" % cpu
|
||||||
kochExecFold("winrelease boot", "boot -d:release --cpu:$#" % 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,
|
overwriteFile r"build\nim-$#.zip" % VersionAsString,
|
||||||
r"web\upload\download\nim-$#_x$#.zip" % [VersionAsString, arch]
|
r"web\upload\download\nim-$#_x$#.zip" % [VersionAsString, arch]
|
||||||
|
|
||||||
|
|
@ -545,7 +536,7 @@ proc testUnixInstall(cmdLineRest: string) =
|
||||||
# check the docs build:
|
# check the docs build:
|
||||||
execCleanPath("./koch docs", destDir / "bin")
|
execCleanPath("./koch docs", destDir / "bin")
|
||||||
# check nimble builds:
|
# check nimble builds:
|
||||||
execCleanPath("./koch --latest tools")
|
execCleanPath("./koch tools")
|
||||||
# check the tests work:
|
# check the tests work:
|
||||||
putEnv("NIM_EXE_NOT_IN_PATH", "NOT_IN_PATH")
|
putEnv("NIM_EXE_NOT_IN_PATH", "NOT_IN_PATH")
|
||||||
execCleanPath("./koch tests --nim:./bin/nim cat megatest", destDir / "bin")
|
execCleanPath("./koch tests --nim:./bin/nim cat megatest", destDir / "bin")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue