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

--noNimblePath breaks nimfmt #1163

Open
ncihnegn opened this issue Nov 17, 2023 · 1 comment
Open

--noNimblePath breaks nimfmt #1163

ncihnegn opened this issue Nov 17, 2023 · 1 comment

Comments

@ncihnegn
Copy link

$ nimble install --verbose https://github.com/ncihnegn/nimfmt 
     Info:  Nimble data file "~/.nimble/nimbledata2.json" has been loaded.
Downloading https://github.com/ncihnegn/nimfmt using git
   Warning: The package has no tagged releases, downloading HEAD instead.
  Verifying dependencies for [email protected]
 Installing [email protected]
   Building nimfmt/nimfmt using c backend
  Executing /usr/local/nim/2.0.0/bin/nim c --colors:on --noNimblePath -d:release -d:NimblePkgVersion=0.2.0 -o:/var/folders/x8/8s64cxbx0yj16d3shdxmm5gr0000gn/T/nimble_18845/githubcom_ncihnegnnimfmt/nimfmt /var/folders/x8/8s64cxbx0yj16d3shdxmm5gr0000gn/T/nimble_18845/githubcom_ncihnegnnimfmt/nimfmt.nim
/private/var/folders/x8/8s64cxbx0yj16d3shdxmm5gr0000gn/T/nimble_18845/githubcom_ncihnegnnimfmt/nimfmt.nim(18, 14) Error: cannot open file: compiler/ast
nimble.nim(229)          buildFromDir

It will build without --noNimblePath.

@daylinmorgan
Copy link
Contributor

This is more of an issue with how the nim compiler source is packaged for nimble than an issue with nimble itself.

As mentioned in this issue you can prefix the imports with "$nim".

So

import "$nim"/compiler/ast

You could probably also just add the compiler source to the path by adding --path:"$nim" to the nim.cfg.

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

No branches or pull requests

2 participants