Closed timotheecour closed 4 years ago
Choosenim recognizes #head
and devel
is a channel. Both can be updated.
#devel
is treated as a commit so its deleted and rebuilt from scratch.
not sure whether you're implying it works as intended or not; but I don't see where fetch (from https://github.com/dom96/choosenim/pull/173) happens, it always seems to use download a zip.
devel is treated as a commit so its deleted and rebuilt from scratch.
but it's the same with choosenim update #head
there are 2 options:
resolve symbolic hashes (eg #head
) the real hash (after a fetch you know the hash).
instead of saving to ~/.choosenim/toolchains/nim-#head/
it should save to ~/.choosenim/toolchains/nim-c61f7466292cb19c910f4a2f2976f738796e6bdf
and on systems that use symlinks (eg posix + windows 10), use a symlink ln -s nim-#head nim-c61f7466292cb19c910f4a2f2976f738796e6bdf
, or simply store this relationship in a json file.
likewise for nimble, nimble install choosenim@#head
should install to ~/.nimble/pkgs/choosenim-0a6a7933da9e532679998000fdc7aca4f1cec643
instead of ~/.nimble/pkgs/choosenim-\#head/
this allows keeping more than 1 head (eg after a few updates) but requires some form of garbage collection (as done in homebrew)
keep symbolic hashes, eg ~/.choosenim/toolchains/nim-#head/
and ~/.nimble/pkgs/choosenim-\#head/
, but store relationship in a json file eg:
~/.nimble/map.json
and ~/.choosenim/map.json
so next time you run choosenim update #head
, it'll know whether the hash is already there or not
I see your confusion. If you look at choosenim -h
:
choosenim devel [--latest]
Installs (if necessary) and selects the most recent nightly build of Nim.
The '--latest' flag selects and builds the latest commit in the devel branch
choosenim update devel [--latest]
Updates to the most recent nightly build of Nim.
The '--latest' flag updates and builds the latest commit in the devel branch
On Windows and Linux, it installs latest nightly release which is a binary build so you get "already built". On OSX, there's no binary builds yet so it rebuilds every time on update. But it is downloading an archive from nightlies/releases which is tested and known to be stable.
You only get git checkouts with --latest
. This is how @dom96 wanted it to be. See #179 for the history.
@timotheecour - is this good to close?
thanks for your explanation, the main thing missing here is to avoid rebuilding when un-necessary (because you've already built at that commit); right now re-running choosenim update devel --latest
twice re-builds; the 2nd time should be noop
How does that rebuild twice? Are you referring to building C sources and then bootstrapping? If so then that has to happen to get a reliable version built (in particular when building certain git commit hashes).
@genotrance
choosenim update --verbose #devel
shows:and re-running re-downloads; I thought it would instead cause
git fetch
or similar instead of having to redownload a ziplikewise on OSX:
and then re-running re-does the whole build
this is how I'd intend this feature to work:
choosenim update #devel
:also:
choosenim update #head
andchoosenim update #devel
(other ppl were wondering too)