nim-lang / nimble

Package manager for the Nim programming language.
https://nim-lang.github.io/nimble/index.html
Other
1.25k stars 191 forks source link

nimble install nimble@#head fails #306

Closed andreaferretti closed 7 years ago

andreaferretti commented 7 years ago

I just installed nimble with koch nimble --latest and then tried to use the package version with nimble install nimble@#head.

The latter command fails with

Downloading https://github.com/nim-lang/nimble using git
       Info Hint: used config file '/home/papillon/tools/Nim/config/nim.cfg' [Conf]
       Tip: 1 messages have been suppressed, use --verbose to show them.
     Error: Traceback (most recent call last)
        ... nimble.nim(1068)         nimble
        ... nimble.nim(994)          doAction
        ... nimble.nim(603)          install
        ... nimble.nim(392)          installFromDir
        ... packageparser.nim(325)   getPkgInfo
        ... packageparser.nim(313)   getPkgInfoFromFile
        ... packageparser.nim(288)   readPackageInfo
        ... Could not read package info file in /tmp/nimble_11852/githubcom_nimlangnimble_#head/nimble.nimble;
        ...   Reading as ini file failed with: 
        ...     Invalid section: .
        ...   Evaluating as NimScript file failed with: 
        ...     home/papillon/tools/Nim/lib/pure/distros.nim(187, 18) Error: undeclared identifier: 'foreignDeps'.
Araq commented 7 years ago

@andreaferretti Just fyi the '--latest' is now ignored and koch.nim detects a "bleeding edge" Nim setup by the existance of a '.git' directory in your nim directory.

Workaround:

rm -rf $nim/bin/nimblepkg
rm -rf .nimble/pkgs/nimble-*

For some reason nimble itself uses the nimble path to determine where to find nimscriptapi.nim, causing it to use an outdated nimscriptapi.nim.

Oh and I wouldn't use nimble install nimble@#head at all, but dom96 disagrees.

andreaferretti commented 7 years ago

Thank you, the workaround worked! :-)

So, what do you suggest to keep nimble up to date these days? I can think of a few ways:

I think one should be deemed the official way, and the other ones deprecated.

Generally, I am using nim-vm to manage multiple versions of nim: if koch nimble becomes the offically sanctioned way to install nimble, I can make a PR to nim-vm to switch nimble version together with nim

dom96 commented 7 years ago

There is far too many ways to install Nimble sadly. I believe that most users should be fine with using koch nimble to both install Nimble initially and to upgrade it.

Some users, who know what they are doing, may opt for installing Nimble into ~/.nimble/bin. If you guys really want, I can add a special case into Nimble to disallow this, but I don't think there is a need for that.

install_nimble.nims is being replaced with koch nimble.

andreaferretti commented 7 years ago

Thank you. I like how koch becomes a single tool to manage all things nim :-)