Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Haiku] Nimcache glitches on Koch boot #13017

Closed
Teashrock opened this issue Jan 3, 2020 · 0 comments · Fixed by #13085
Closed

[Haiku] Nimcache glitches on Koch boot #13017

Teashrock opened this issue Jan 3, 2020 · 0 comments · Fixed by #13085

Comments

@Teashrock
Copy link
Contributor

Teashrock commented Jan 3, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant