summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--build_all.sh6
-rw-r--r--koch.nim9
2 files changed, 12 insertions, 3 deletions
diff --git a/build_all.sh b/build_all.sh
index 6c28e7407..6828bbbd8 100644
--- a/build_all.sh
+++ b/build_all.sh
@@ -26,6 +26,10 @@ build_nim_csources(){
 
 [ -f $nim_csources ] || echo_run build_nim_csources
 
-echo_run bin/nim c koch # Note: if fails, may need to `cd csources && git pull`
+# Note: if fails, may need to `cd csources && git pull`
+# Note: --skipUserCfg is to prevent newer flags from
+# breaking bootstrap phase
+echo_run bin/nim c --skipUserCfg koch
+
 echo_run ./koch boot -d:release
 echo_run ./koch tools # Compile Nimble and other tools.
diff --git a/koch.nim b/koch.nim
index 845dffada..a77ad3144 100644
--- a/koch.nim
+++ b/koch.nim
@@ -285,8 +285,13 @@ proc boot(args: string) =
   copyExe(findStartNim(), 0.thVersion)
   for i in 0..2:
     echo "iteration: ", i+1
-    exec i.thVersion & " $# $# --nimcache:$# compiler" / "nim.nim" % [bootOptions, args,
-        smartNimcache]
+    let extraOption = if i == 0:
+      "--skipUserCfg"
+        # forward compatibility: for bootstrap (1st iteration), avoid user flags
+        # that could break things, see #10030
+    else: ""
+    exec i.thVersion & " $# $# $# --nimcache:$# compiler" / "nim.nim" %
+      [bootOptions, extraOption, args, smartNimcache]
     if sameFileContent(output, i.thVersion):
       copyExe(output, finalDest)
       echo "executables are equal: SUCCESS!"