Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency resolution depends on the order in requires #505

Open
nigredo-tori opened this issue Jun 15, 2018 · 1 comment
Open

Dependency resolution depends on the order in requires #505

nigredo-tori opened this issue Jun 15, 2018 · 1 comment

Comments

@nigredo-tori
Copy link
Contributor

nigredo-tori commented Jun 15, 2018

Consider a package like this (nimfp depends on nimboost):

version       = "0.0.1"
author        = "nigredo-tori"
description   = "Foo for Nim"
license       = "EULA"

requires "nim >= 0.18.1", "nimfp >= 0.4.2", "nimboost >= 0.5.4"

Installing dependencies for this package will work if neither nimfp nor nimboost are present, and in some other cases. However if we have a nimboost@0.5.3 installed, the first dependency will lock nimboost to the existing version (as I understand it), and the second one won't be able to update it:

[dmitry@dmitry nimfoo]$ nimble install nimboost@0.5.3
Downloading https://github.com/vegansk/nimboost using git
   Warning: Package 'nimboost' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'nimboost', but file 'richstring.nim' is in a directory named 'boost' instead. This will be an error in the future.
      Hint: If 'boost' contains source files for building 'nimboost', rename it to 'nimboost'. Otherwise, prevent its installation by adding `skipDirs = @["boost"]` to the .nimble file.
  Verifying dependencies for nimboost@0.5.3
      Info: Dependency on patty@>= 0.3.1 already satisfied
  Verifying dependencies for patty@0.3.1
 Installing nimboost@0.5.3
   Success: nimboost installed successfully.
[dmitry@dmitry nimfoo]$ nimble install -dy
  Verifying dependencies for nimfoo@0.0.1
 Installing nimfp@>= 0.4.2
Downloading https://github.com/vegansk/nimfp using git
   Warning: Package 'nimfp' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'nimfp.nim', but a file named 'fp.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 'nimfp.nim'. If it's a source file required by the main module, or if it is one of several modules exposed by 'nimfp', then move it into a 'nimfp/' subdirectory. If it's a test file or otherwise not required to build the the package 'nimfp.nim', prevent its installation by adding `skipFiles = @["fp.nim"]` to the .nimble file. See https://github.com/nim-lang/nimble#libraries for more info.
  Verifying dependencies for nimfp@0.4.3
      Info: Dependency on nimboost@>= 0.5.3 already satisfied
  Verifying dependencies for nimboost@0.5.3
      Info: Dependency on patty@>= 0.3.1 already satisfied
  Verifying dependencies for patty@0.3.1
      Info: Dependency on classy@>= 0.0.2 already satisfied
  Verifying dependencies for classy@0.0.2
 Installing nimfp@0.4.3
   Success: nimfp installed successfully.
 Installing nimboost@>= 0.5.4
Downloading https://github.com/vegansk/nimboost using git
   Warning: Package 'nimboost' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'nimboost', but file 'richstring.nim' is in a directory named 'boost' instead. This will be an error in the future.
      Hint: If 'boost' contains source files for building 'nimboost', rename it to 'nimboost'. Otherwise, prevent its installation by adding `skipDirs = @["boost"]` to the .nimble file.
  Verifying dependencies for nimboost@0.5.4
      Info: Dependency on patty@>= 0.3.1 already satisfied
  Verifying dependencies for patty@0.3.1
 Installing nimboost@0.5.4
   Success: nimboost installed successfully.
       Tip: 73 messages have been suppressed, use --verbose to show them.
     Error: Cannot satisfy the dependency on nimboost 0.5.4 and nimboost 0.5.3

I'm not sure how this can be solved without building a proper dependency graph beforehand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants