nim-lang / nimble

Package manager for the Nim programming language.
Other
1.24k stars 173 forks source link

`nimble -v` may bootstrap Nim compiler from sources #1232

Open alex65536 opened 2 days ago

alex65536 commented 2 days ago

When Nim executable is not found, then nimble -v will try to download and bootstrap the Nim compiler from sources, even though it's not necessary at all to have a working compiler for just showing version info.

It is really an issue because of choosenim. choosenim tries to call nimble -v before it produces a valid symlink to nim executable. So, when nimble -v is executed, then it tries to boostrap the compiler from sources, leading to much unnecessary CPU usage.

The main outcome of this issue is that running choosenim update 2.0.6 from scratch takes approximately six minutes, making CI runs last much longer than expected.

Note that Nim 2.0.4 is shipped with a version of nimble which doesn't try to bootstrap the compiler on -v when it's not found, but fails with an error instead. So, the problem was not visible before Nim 2.0.6 official release.

It's probably also a good idea to fix this issue in choosenim by preventing it from calling nimble -v.

alex65536 commented 2 days ago

See also: https://github.com/nim-lang/choosenim/issues/6