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

feature: choosenim csources v0.19.0 (for bootstrapping older nims during bisect) #154

Closed
timotheecour opened this issue Jan 8, 2020 · 3 comments

Comments

@timotheecour
Copy link
Contributor

see design idea discussed here: nim-lang/Nim#13066 (comment)
the idea is to allow automatically building nim at any prior commit (eg use case: for git bisect) and using an appropriate csources-built nim version as bootstrapping point is guaranteed to work, unlike any of the releases built by choosenim. For example (that occurred while bisecting for nim-lang/Nim#13066):

git checkout 9985706fb812156fa6f805989063293ca71599df
choosenim 0.19.0 # ditto with 0.19.2 0.19.4 0.20.0
nim c -o:bin/nim_temp1 -d:release --skipParentCfg --skipUserCfg compiler/nim.nim
pathutils.nim(13, 22) Error: cannot open file: pathnorm

whereas it works if we build from csources at tag v0.19.0

@dom96
Copy link
Owner

dom96 commented Jan 9, 2020

csources at v0.19.0 should be the same as nim v0.19.0. How can one work and the other not?

@timotheecour
Copy link
Contributor Author

timotheecour commented Jan 10, 2020

ok i figured part of the problem, and a workaround:

after choosenim 0.19.0:

nim c -o:bin/nim_temp1 -d:release --skipParentCfg --skipUserCfg compiler/nim.nim
# pathutils.nim(13, 22) Error: cannot open file: pathnorm
# ditto with directly running `/Users/timothee/.choosenim/toolchains/nim-0.19.0/bin/nim c -o:bin/nim_temp1 -d:release --skipParentCfg --skipUserCfg compiler/nim.nim`

workaround:

cp /Users/timothee/.choosenim/toolchains/nim-0.19.0/bin/nim bin/nim.0.19.0
bin/nim.0.19.0 c -o:bin/nim_temp1 -d:release --skipParentCfg --skipUserCfg compiler/nim.nim

so the build breaks if nim binary is outside of nim repo we are building.
While this works, is there a better workaround?

Note: simply doing cp /Users/timothee/git_clone/nim/Nim_temp/config/nim.cfg /Users/timothee/.choosenim/toolchains/nim-0.19.0/config/nim.cfg did not remove the error, so it's something about wrong paths being used: is there a simple way to override paths so that we'd use the paths from current nim repo instead of paths from /Users/timothee/.choosenim/toolchains/nim-0.19.0/ ?

@timotheecour
Copy link
Contributor Author

timotheecour commented Jan 10, 2020

ok I found a better way: using --lib:lib
I know that flag is documented (very succintly... set the system library pat), but maybe we can improve its documentation as that's what shd be used to build older nims from another outside of source nim binary:

nim c -o:bin/nim_temp1 -d:release --skipParentCfg --skipUserCfg --lib:lib compiler/nim.nim

in any case, no action needed here for choosenim, closing

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