nim-lang / nimble

Package manager for the Nim programming language.
Other
1.25k stars 188 forks source link

Installing package fails to find the dependent package even though it exists. #766

Open flenniken opened 4 years ago

flenniken commented 4 years ago

Nimble cannot find the nimpy dependent package when installing my metar package. It shows a "Package not found" error. I expect metar and nimpy to install because both exist.

The metar nimble file specifies a particular version of nimpy using a commit number, here is the line:

requires "nim >= 1.0.4", "nimpy@#c8ec14a" # Search for nimpyVersion*.

You can reproduce the issue by trying to install metar. Notice the two @@ signs in the output.

nimble install metar

Downloading https://github.com/flenniken/metar using git
  Verifying dependencies for metar@0.1.22
 Installing nimpy@@#c8ec14a
    Prompt: nimpy@ not found in any local packages.json, check internet for updated packages? [y/N]
    Answer: y
Downloading Official package list
    Success Package list downloaded.
       Tip: 8 messages have been suppressed, use --verbose to show them.
     Error: Package not found.

Installing nimpy directly works.

nimble install nimpy@#c8ec14a

Downloading https://github.com/yglukhov/nimpy using git
  Verifying dependencies for nimpy@#c8ec14a
 Installing nimpy@#c8ec14a
    Prompt: nimpy@#c8ec14a already exists. Overwrite? [y/N]
    Answer: y
   Success: nimpy installed successfully.

I'm running on a Mac using nim version 1.0.4 and nimble version 0.11.0.

nim --version

Nim Compiler Version 1.0.4 [MacOSX: amd64]
Compiled at 2019-11-27
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: c8998c498f5e2a0874846eb31309e1d1630faca6
active boot switches: -d:release

nimble --version

nimble v0.11.0 compiled at 2019-12-29 18:44:04
git hash: couldn't determine git hash
genotrance commented 4 years ago

Nimble requires are written as nimpy#c8ec14a - no @. On the command line, they need the @.

dom96 commented 4 years ago

We can maybe improve the error message here, so I'll keep this open as a low-pri.

genotrance commented 4 years ago

Why not just support @# in requires as well?