Skip to content

Commit

Permalink
fix nim-lang#18334: handle path with spaces on windows during bootstr…
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour authored and PMunch committed Mar 28, 2022
1 parent 86f126a commit 8f390e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
27 changes: 15 additions & 12 deletions compiler/nim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@
# distribution, for details about the copyright.
#

when defined(gcc) and defined(windows):
when defined(x86):
{.link: "../icons/nim.res".}
else:
{.link: "../icons/nim_icon.o".}
import std/[os, strutils, parseopt]
when defined(windows) and not defined(nimKochBootstrap):
# remove workaround pending bootstrap >= 1.5.1
# refs https://github.com/nim-lang/Nim/issues/18334#issuecomment-867114536
# 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):
{.link: "../icons/nim-amd64-windows-vcc.res".}
when defined(i386) and defined(windows) and defined(vcc):
{.link: "../icons/nim-i386-windows-vcc.res".}
when defined(amd64) and defined(vcc):
{.link: "../icons/nim-amd64-windows-vcc.res".}
when defined(i386) and defined(vcc):
{.link: "../icons/nim-i386-windows-vcc.res".}

import
commands, options, msgs,
extccomp, strutils, os, main, parseopt,
idents, lineinfos, cmdlinehelper,
commands, options, msgs, extccomp, main, idents, lineinfos, cmdlinehelper,
pathutils, modulegraphs

from browsers import openDefaultBrowser
Expand Down
2 changes: 1 addition & 1 deletion koch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ proc boot(args: string) =
var nimi = i.thVersion
if i == 0:
nimi = nimStart
extraOption.add " --skipUserCfg --skipParentCfg"
extraOption.add " --skipUserCfg --skipParentCfg -d:nimKochBootstrap"
# The configs are skipped for bootstrap
# (1st iteration) to prevent newer flags from breaking bootstrap phase.
let ret = execCmdEx(nimStart & " --version")
Expand Down

0 comments on commit 8f390e0

Please sign in to comment.