nim-lang / nimble

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

nimble should not prompt for "X already exists. Overwrite?" when X is just a dependency #475

Open timotheecour opened 6 years ago

timotheecour commented 6 years ago

after:

git clone https://github.com/dom96/choosenim
cd choosenim
nimble build

I got:

  Verifying dependencies for choosenim@0.3.2
 Installing nimble@>= 0.8.5
Downloading https://github.com/nim-lang/nimble using git
  Verifying dependencies for nimble@0.8.10
      Info: Dependency on compiler@#head already satisfied
  Verifying dependencies for compiler@#head
 Installing nimble@0.8.10
   Building nimble/nimble using c backend
   Success: nimble installed successfully.
 Installing untar@>= 0.1.0
Downloading https://github.com/dom96/untar using git
  Verifying dependencies for untar@0.1.0
 Installing untar@0.1.0
   Success: untar installed successfully.
 Installing libcurl@>= 1.0.0
Downloading https://github.com/Araq/libcurl using git
  Verifying dependencies for libcurl@1.0.0
 Installing libcurl@1.0.0
   Success: libcurl installed successfully.
 Installing analytics@>= 0.1.0
Downloading https://github.com/dom96/analytics using git
  Verifying dependencies for analytics@0.1.0
 Installing uuids@>= 0.1.7
Downloading https://github.com/pragmagic/uuids using git
   Warning: Package 'uuids' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'uuids.nim', but a file named 'urandom.nim' was found. This will be an error in the future.
      Hint: If this is the primary source file in the package, rename it to 'uuids.nim'. If it's a source file required by the main module, or if it is one of several modules exposed by 'uuids', then move it into a 'uuids/' subdirectory. If it's a test file or otherwise not required to build the the package 'uuids.nim', prevent its installation by adding `skipFiles = @["urandom.nim"]` to the .nimble file. See https://github.com/nim-lang/nimble#libraries for more info.
  Verifying dependencies for uuids@0.1.9
 Installing isaac@>= 0.1.3
Downloading https://github.com/pragmagic/isaac using git
  Verifying dependencies for isaac@0.1.3
 Installing isaac@0.1.3
   Success: isaac installed successfully.
 Installing uuids@0.1.9
   Success: uuids installed successfully.
 Installing osinfo@>= 0.2.0
Downloading https://github.com/nim-lang/osinfo.git using git
  Verifying dependencies for osinfo@0.2.0
 Installing osinfo@0.2.0
   Success: osinfo installed successfully.
 Installing analytics@0.1.0
   Success: analytics installed successfully.
 Installing osinfo@>= 0.2.0
Downloading https://github.com/nim-lang/osinfo.git using git
  Verifying dependencies for osinfo@0.2.0
 Installing osinfo@0.2.0
    Prompt: osinfo@0.2.0 already exists. Overwrite? [y/N]
    Answer: y
   Success: osinfo installed successfully.
   Building choosenim/choosenim using c backend

Why should nimble ask for "Prompt: osinfo@0.2.0 already exists. Overwrite? [y/N]" ? I understand it should ask if I'm explicitly calling nimble install osinfo but here I was just calling nimble install X where X depends on osinfo

dom96 commented 6 years ago

Because of the way Nimble works right now it needs to ask this because you may have other packages that depend on the osinfo that you have currently installed.

Once we have lock file support this should be less of an issue.