Skip to content

[Haiku] Nimcache glitches on Koch boot #13017

@Teashrock

Description

@Teashrock

Attempt to bootstrap with boot results in weird error, where symbol ':' is somehow replaced by '/'. I tried to trace the error with my own hands.

koch.nim, begins at line 321

exec "$# $# $# $# --nimcache:$# --compileOnly compiler" / "nim.nim" %
  [nimi, bootOptions, extraOption, args, smartNimcache]
exec "$# jsonscript $# --nimcache:$# compiler" / "nim.nim" %
  [nimi, args, smartNimcache]

Current Output

iteration: 1
bin/nim c --skipUserCfg --skipParentCfg -d:release -d:useLinenoise --nimcache/nimcache/r_haiku_amd64 --compileOnly compiler/nim.nim
command line(1, 2): Error: invalid command line option: '--nimcache/nimcache/r_haiku_amd64'
FAILURE

Expected Output

The above "invalid command line option" should be --nimcache:nimcache/r_haiku_amd64, not that example above.

This issue is completely absent on Windows and Linux, so I decided to look at generated code on all three systems and compare it source written on Nim.

On all three systems the generated code is similar to each other (aside the string numbers on Windows):

Windows:
image
Linux:
image
Haiku:
image

The problem strings...

STRING_LITERAL(TM_xRS4M9adyeRIWGepJlj9bcoA_72, "$# $# $# $# --nimcache:$# --compileOnly compiler", 48);
STRING_LITERAL(TM_xRS4M9adyeRIWGepJlj9bcoA_74, "$# jsonscript $# --nimcache:$# compiler", 39);

...are similar too. So i didn't localize the problem, but found a temporary solution:

Possible TEMPORARY Solution

  • In file koch.nim make problem symbol ':' be a raw string, concatenated to others.

Was:

exec "$# $# $# $# --nimcache:$# --compileOnly compiler" / "nim.nim" %
  [nimi, bootOptions, extraOption, args, smartNimcache]
exec "$# jsonscript $# --nimcache:$# compiler" / "nim.nim" %
  [nimi, args, smartNimcache]

Will be:

exec "$# $# $# $# --nimcache" %
  [nimi, bootOptions, extraOption, args] &
r":" & "$# --compileOnly compiler" / "nim.nim" %
  [smartNimcache]
exec "$# jsonscript $# --nimcache" %
  [nimi, args] &
r":" & "$# compiler" / "nim.nim" %
  [smartNimcache]

Additional Information

  • Not needed.
$ nim -v
Nim Compiler Version 1.1.1 [Windows: amd64]
Compiled at 2020-01-03
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: 0ecb709cbeec2e77d6ce8dae251270a7d1e3826e
active boot switches: -d:release

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions