[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
This commit is contained in:
Timothee Cour 2019-01-16 23:00:44 -08:00 • committed by Andreas Rumpf
commit 42bac52426
4 changed files with 24 additions and 11 deletions

View file

@ -14,8 +14,9 @@ matrix:
- os: osx - os: osx
env: NIM_COMPILE_TO_CPP=true env: NIM_COMPILE_TO_CPP=true
allow_failures: # To allow failures for a failing configuration, use something like:
- env: NIM_COMPILE_TO_CPP=true # allow_failures:
# - env: NIM_COMPILE_TO_CPP=true
# - os: osx # - os: osx
addons: addons:

View file

@ -281,19 +281,24 @@ proc boot(args: string) =
let smartNimcache = (if "release" in args: "nimcache/r_" else: "nimcache/d_") & let smartNimcache = (if "release" in args: "nimcache/r_" else: "nimcache/d_") &
hostOs & "_" & hostCpu hostOs & "_" & hostCpu
copyExe(findStartNim(), 0.thVersion) let nimStart = findStartNim()
for i in 0..2+ord(useCpp): copyExe(nimStart, 0.thVersion)
# do the first iteration in C mode in order to avoid problem #10315: for i in 0..2:
let defaultCommand = if useCpp and i > 0: "cpp" else: "c" let defaultCommand = if useCpp: "cpp" else: "c"
let bootOptions = if args.len == 0 or args.startsWith("-"): defaultCommand else: "" let bootOptions = if args.len == 0 or args.startsWith("-"): defaultCommand else: ""
echo "iteration: ", i+1 echo "iteration: ", i+1
let extraOption = if i == 0: var extraOption = ""
"--skipUserCfg --skipParentCfg" if i == 0:
extraOption.add " --skipUserCfg --skipParentCfg"
# Note(D20190115T162028:here): the configs are skipped for bootstrap # Note(D20190115T162028:here): 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.
# fixes #10030. # 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" % exec i.thVersion & " $# $# $# --nimcache:$# compiler" / "nim.nim" %
[bootOptions, extraOption, args, smartNimcache] [bootOptions, extraOption, args, smartNimcache]
if sameFileContent(output, i.thVersion): if sameFileContent(output, i.thVersion):

View file

@ -569,6 +569,11 @@ type
trace: string trace: string
else: else:
trace: seq[StackTraceEntry] trace: seq[StackTraceEntry]
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 raiseId: uint # set when exception is raised
up: ref Exception # used for stacking exceptions. Not exported! up: ref Exception # used for stacking exceptions. Not exported!

View file

@ -1,6 +1,8 @@
discard """ discard """
action: run action: run
exitcode: 1 exitcode: 1
target: "c"
""" """
# todo: remove `target: "c"` workaround once #10343 is properly fixed
close stdmsg close stdmsg
writeLine stdmsg, "exception!" writeLine stdmsg, "exception!"