diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2019-01-16 23:00:44 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-01-17 08:00:44 +0100 |
commit | 42bac52426bf392fcfa3cfeeee716bec3166b709 (patch) | |
tree | 323a8c65f5cc4fe84309979b761343e719bfaf72 | |
parent | 15584879b91e14565156ca140eef1dc100cf34c4 (diff) | |
download | Nim-42bac52426bf392fcfa3cfeeee716bec3166b709.tar.gz |
[CI] now enables `NIM_COMPILE_TO_CPP=true` to run without allow_failures (#10315)
* better fix for `nim cpp` bootstrap error: error: no member named raise_id * [CI] now enables runs NIM_COMPILE_TO_CPP=true without allow_failures * workaround refs #10343
-rw-r--r-- | .travis.yml | 5 | ||||
-rw-r--r-- | koch.nim | 21 | ||||
-rw-r--r-- | lib/system.nim | 7 | ||||
-rw-r--r-- | tests/exception/t9657.nim | 2 |
4 files changed, 24 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml index 32a40bcaf..ea5d54ead 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,9 @@ matrix: - os: osx env: NIM_COMPILE_TO_CPP=true - allow_failures: - - env: NIM_COMPILE_TO_CPP=true +# To allow failures for a failing configuration, use something like: +# allow_failures: +# - env: NIM_COMPILE_TO_CPP=true # - os: osx addons: diff --git a/koch.nim b/koch.nim index be8f75986..f70cf2142 100644 --- a/koch.nim +++ b/koch.nim @@ -281,19 +281,24 @@ proc boot(args: string) = let smartNimcache = (if "release" in args: "nimcache/r_" else: "nimcache/d_") & hostOs & "_" & hostCpu - copyExe(findStartNim(), 0.thVersion) - for i in 0..2+ord(useCpp): - # do the first iteration in C mode in order to avoid problem #10315: - let defaultCommand = if useCpp and i > 0: "cpp" else: "c" + let nimStart = findStartNim() + copyExe(nimStart, 0.thVersion) + for i in 0..2: + let defaultCommand = if useCpp: "cpp" else: "c" let bootOptions = if args.len == 0 or args.startsWith("-"): defaultCommand else: "" - echo "iteration: ", i+1 - let extraOption = if i == 0: - "--skipUserCfg --skipParentCfg" + var extraOption = "" + if i == 0: + extraOption.add " --skipUserCfg --skipParentCfg" # Note(D20190115T162028:here): the configs are skipped for bootstrap # (1st iteration) to prevent newer flags from breaking bootstrap phase. # fixes #10030. - else: "" + let ret = execCmdEx(nimStart & " --version") + doAssert ret.exitCode == 0 + let version = ret.output.splitLines[0] + if version.startsWith "Nim Compiler Version 0.19.0": + extraOption.add " -d:nimBoostrapCsources0_19_0" + # remove this when csources get updated exec i.thVersion & " $# $# $# --nimcache:$# compiler" / "nim.nim" % [bootOptions, extraOption, args, smartNimcache] if sameFileContent(output, i.thVersion): diff --git a/lib/system.nim b/lib/system.nim index fb52ee9eb..b479b920a 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -569,7 +569,12 @@ type trace: string else: trace: seq[StackTraceEntry] - raiseId: uint # set when exception is raised + when defined(nimBoostrapCsources0_19_0): + # see #10315, bootstrap with `nim cpp` from csources gave error: + # error: no member named 'raise_id' in 'Exception' + raise_id: uint # set when exception is raised + else: + raiseId: uint # set when exception is raised up: ref Exception # used for stacking exceptions. Not exported! Defect* = object of Exception ## \ diff --git a/tests/exception/t9657.nim b/tests/exception/t9657.nim index 5d5164f4f..c96a0a597 100644 --- a/tests/exception/t9657.nim +++ b/tests/exception/t9657.nim @@ -1,6 +1,8 @@ discard """ action: run exitcode: 1 + target: "c" """ +# todo: remove `target: "c"` workaround once #10343 is properly fixed close stdmsg writeLine stdmsg, "exception!" |