summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-09-30 18:38:25 +0800
committerGitHub <noreply@github.com>2022-09-30 12:38:25 +0200
commitae050b05e9ce6f4e356c46de8722724a2f706e18 (patch)
treed042b09c9416ea2ef63faf139eb6e7297b0419e7
parent3e43ea3384acd666196bbcdc6029741df9b6e325 (diff)
downloadNim-ae050b05e9ce6f4e356c46de8722724a2f706e18.tar.gz
koch boot compiler with orc (#20467)
* koch boot compiler with orc

* use orc

* workaround bugs

* move it

* move the data
-rw-r--r--compiler/nim.cfg1
-rw-r--r--compiler/semstmts.nim2
-rw-r--r--koch.nim7
-rw-r--r--lib/system.nim4
-rw-r--r--lib/system/indices.nim3
5 files changed, 6 insertions, 11 deletions
diff --git a/compiler/nim.cfg b/compiler/nim.cfg
index 5e8471f70..853a657b3 100644
--- a/compiler/nim.cfg
+++ b/compiler/nim.cfg
@@ -6,7 +6,6 @@ define:booting
 define:nimcore
 define:nimPreviewFloatRoundtrip
 define:nimPreviewSlimSystem
-gc:refc
 
 #import:"$projectpath/testability"
 
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index faf8e3baa..1b98f5c1a 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -225,7 +225,7 @@ proc semTry(c: PContext, n: PNode; flags: TExprFlags; expectedType: PType = nil)
 
       if a.len == 2 and a[0].kind == nkBracket:
         # rewrite ``except [a, b, c]: body`` -> ```except a, b, c: body```
-        a.sons[0..0] = a[0].sons
+        a.sons[0..0] = move a[0].sons
 
       if a.len == 2 and a[0].isInfixAs():
         # support ``except Exception as ex: body``
diff --git a/koch.nim b/koch.nim
index 1e531e5a9..b0718dadc 100644
--- a/koch.nim
+++ b/koch.nim
@@ -537,7 +537,8 @@ proc runCI(cmd: string) =
   # boot without -d:nimHasLibFFI to make sure this still works
   # `--lib:lib` is needed for bootstrap on openbsd, for reasons described in
   # https://github.com/nim-lang/Nim/pull/14291 (`getAppFilename` bugsfor older nim on openbsd).
-  kochExecFold("Boot in release mode", "boot -d:release -d:nimStrictMode --lib:lib")
+  kochExecFold("Boot in release mode", "boot -d:release --gc:refc -d:nimStrictMode --lib:lib")
+  kochExecFold("Boot Nim ORC", "boot -d:release --lib:lib")
 
   when false: # debugging: when you need to run only 1 test in CI, use something like this:
     execFold("debugging test", "nim r tests/stdlib/tosproc.nim")
@@ -591,10 +592,6 @@ proc runCI(cmd: string) =
 
     execFold("Run atlas tests", "nim c -r -d:atlasTests tools/atlas/atlas.nim clone https://github.com/disruptek/balls")
 
-  when not defined(bsd):
-    # the BSDs are overwhelmed already, so only run this test on the other machines:
-    kochExecFold("Boot Nim ORC", "boot -d:release --mm:orc --lib:lib")
-
 proc testUnixInstall(cmdLineRest: string) =
   csource("-d:danger" & cmdLineRest)
   xz(false, cmdLineRest)
diff --git a/lib/system.nim b/lib/system.nim
index 2de70ecad..daee96c1c 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1211,10 +1211,10 @@ else:
 
 
 when defined(nimSeqsV2):
-  template movingCopy(a, b) =
+  template movingCopy(a, b: typed) =
     a = move(b)
 else:
-  template movingCopy(a, b) =
+  template movingCopy(a, b: typed) =
     shallowCopy(a, b)
 
 proc del*[T](x: var seq[T], i: Natural) {.noSideEffect.} =
diff --git a/lib/system/indices.nim b/lib/system/indices.nim
index 40e7419f6..3f90d4399 100644
--- a/lib/system/indices.nim
+++ b/lib/system/indices.nim
@@ -55,7 +55,7 @@ template `[]=`*(s: string; i: int; val: char) = arrPut(s, i, val)
 template `^^`(s, i: untyped): untyped =
   (when i is BackwardsIndex: s.len - int(i) else: int(i))
 
-template spliceImpl(s, a, L, b: untyped): untyped =
+template spliceImpl(s, a, L, b: typed): untyped =
   # make room for additional elements or cut:
   var shift = b.len - max(0,L)  # ignore negative slice size
   var newLen = s.len + shift
@@ -147,7 +147,6 @@ proc `[]=`*[T; U, V: Ordinal](s: var seq[T], x: HSlice[U, V], b: openArray[T]) =
     var s = @"abcdefgh"
     s[1 .. ^2] = @"xyz"
     assert s == @"axyzh"
-
   let a = s ^^ x.a
   let L = (s ^^ x.b) - a + 1
   if L == b.len: