moved winrelease to its own tool to fix #6147

This commit is contained in:
Araq 2017-09-03 16:26:02 +02:00
commit a5b19ba86c
2 changed files with 53 additions and 41 deletions

View file

@ -233,7 +233,7 @@ proc bundleWinTools() =
r"--path:..\ui tools\downloader.nim") r"--path:..\ui tools\downloader.nim")
proc zip(args: string) = proc zip(args: string) =
bundleNimbleSrc() bundleNimbleExe()
bundleNimsuggest(false) bundleNimsuggest(false)
bundleWinTools() bundleWinTools()
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" %
@ -407,13 +407,15 @@ proc winReleaseArch(arch: string) =
withMingw r"..\mingw" & arch & r"\bin": withMingw r"..\mingw" & arch & r"\bin":
# Rebuilding koch is necessary because it uses its pointer size to # Rebuilding koch is necessary because it uses its pointer size to
# determine which mingw link to put in the NSIS installer. # determine which mingw link to put in the NSIS installer.
nimexec "c --out:koch_temp --cpu:$# koch" % cpu nimexec "c --cpu:$# koch" % cpu
exec "koch_temp boot -d:release --cpu:$#" % cpu exec "koch boot -d:release --cpu:$#" % cpu
exec "koch_temp zip -d:release" exec "koch 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]
proc winRelease() = proc winRelease*() =
# Now used from "tools/winrelease" and not directly supported by koch
# anymore!
# Build -docs file: # Build -docs file:
when true: when true:
web(gaCode) web(gaCode)
@ -530,6 +532,7 @@ proc showHelp() =
quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)), quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)),
CompileDate, CompileTime], QuitSuccess) CompileDate, CompileTime], QuitSuccess)
when isMainModule:
var op = initOptParser() var op = initOptParser()
op.next() op.next()
case op.kind case op.kind
@ -557,7 +560,7 @@ of cmdArgument:
of "test", "tests": tests(op.cmdLineRest) of "test", "tests": tests(op.cmdLineRest)
of "temp": temp(op.cmdLineRest) of "temp": temp(op.cmdLineRest)
of "xtemp": xtemp(op.cmdLineRest) of "xtemp": xtemp(op.cmdLineRest)
of "winrelease": winRelease() #of "winrelease": winRelease()
of "wintools": bundleWinTools() of "wintools": bundleWinTools()
of "nimble": buildNimble(existsDir(".git")) of "nimble": buildNimble(existsDir(".git"))
of "nimsuggest": bundleNimsuggest(buildExe=true) of "nimsuggest": bundleNimsuggest(buildExe=true)

9
tools/winrelease.nim Normal file
View file

@ -0,0 +1,9 @@
## This is a small helper program to build the Win release.
## This used to be part of koch (and it still uses koch as a library)
## but since 'koch.exe' cannot overwrite itself is now its own program.
## The problem is that 'koch.exe' too is part of the zip bundle and
## needs to have the right 32/64 bit version. (Bug #6147)
import "../koch"
winRelease()