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

compiler/nimeval execute fails with Error: cannot open '$PWD/../lib/system.nim' #7567

Closed
timotheecour opened this issue Apr 11, 2018 · 3 comments

Comments

@timotheecour
Copy link
Member

timotheecour commented Apr 11, 2018

D20180410T192630

@Araq looks like your fix for #7522 causes another issue:

compiler/nimeval execute fails with Error: cannot open '/private/tmp/lib/system.nim'

pwd
/tmp/d04 # same as /private/tmp/d04 on OSX

test.nim:

import compiler/nimeval
echo "before"
execute("echo 1+2")
nim c -o:app -r test.nim

Hint: operation successful (104314 lines compiled; 4.113 sec total; 425.582MiB peakmem; Debug Build) [SuccessX]
Hint: ./app  [Exec]
before
Hint: used config file '/Users/timothee/.config/nim.cfg' [Conf]
Hint: system [Processing]
Error: cannot open '/private/tmp/lib/system.nim'
Error: execution of an external program failed: './app '

diagnostic

looks like execute tries to hardcode path $PWD/lib/system.nim during compilation

NOTE

  • /Users/timothee/.config/nim.cfg is empty
  • nim --version
    Nim Compiler Version 0.18.1 [MacOSX: amd64]
    Copyright (c) 2006-2018 by Andreas Rumpf

active boot switches: -d:release

nim installed via choosenim #head

unfortunately, nim --version doesn't show git hash, but my proposal here dom96/choosenim#57 (comment) would; in any case IIRC, #head was after your fix, but fails for reason above

@timotheecour timotheecour changed the title compiler/nimeval execute fails with Error: cannot open '/private/tmp/lib/system.nim' compiler/nimeval execute fails with Error: cannot open '$PWD/../lib/system.nim' Apr 11, 2018
@andreaferretti
Copy link
Collaborator

Confirmed, it happens for me as well (I installed Nim manually, not via choosenim)

@timotheecour
Copy link
Member Author

since this is the 2nd regression on this, a test case would be nice

@Araq
Copy link
Member

Araq commented Jun 27, 2018

The compiler API is now stable and here is an example that is part of the test suite: https://github.com/nim-lang/Nim/tree/devel/tests/compilerapi

@Araq Araq closed this as completed Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants