fix #18334: handle path with spaces on windows during bootstrap (#18337)

This commit is contained in:
Timothee Cour 2021-06-24 00:58:11 -07:00 • committed by GitHub
commit 55c1953f63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 13 deletions

View file

@ -7,21 +7,24 @@
# distribution, for details about the copyright. # distribution, for details about the copyright.
# #
when defined(gcc) and defined(windows): import std/[os, strutils, parseopt]
when defined(x86): when defined(windows) and not defined(nimKochBootstrap):
{.link: "../icons/nim.res".} # remove workaround pending bootstrap >= 1.5.1
else: # refs https://github.com/nim-lang/Nim/issues/18334#issuecomment-867114536
{.link: "../icons/nim_icon.o".} # alternative would be to prepend `currentSourcePath.parentDir.quoteShell`
when defined(gcc):
when defined(x86):
{.link: "../icons/nim.res".}
else:
{.link: "../icons/nim_icon.o".}
when defined(amd64) and defined(windows) and defined(vcc): when defined(amd64) and defined(vcc):
{.link: "../icons/nim-amd64-windows-vcc.res".} {.link: "../icons/nim-amd64-windows-vcc.res".}
when defined(i386) and defined(windows) and defined(vcc): when defined(i386) and defined(vcc):
{.link: "../icons/nim-i386-windows-vcc.res".} {.link: "../icons/nim-i386-windows-vcc.res".}
import import
commands, options, msgs, commands, options, msgs, extccomp, main, idents, lineinfos, cmdlinehelper,
extccomp, strutils, os, main, parseopt,
idents, lineinfos, cmdlinehelper,
pathutils, modulegraphs pathutils, modulegraphs
from browsers import openDefaultBrowser from browsers import openDefaultBrowser

View file

@ -308,7 +308,7 @@ proc boot(args: string) =
var nimi = i.thVersion var nimi = i.thVersion
if i == 0: if i == 0:
nimi = nimStart nimi = nimStart
extraOption.add " --skipUserCfg --skipParentCfg" extraOption.add " --skipUserCfg --skipParentCfg -d:nimKochBootstrap"
# The configs are skipped for bootstrap # The configs are skipped for bootstrap
# (1st iteration) to prevent newer flags from breaking bootstrap phase. # (1st iteration) to prevent newer flags from breaking bootstrap phase.
let ret = execCmdEx(nimStart & " --version") let ret = execCmdEx(nimStart & " --version")