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

Conflicting dependency resolution #1162

Open
diegomrsantos opened this issue Nov 16, 2023 · 4 comments
Open

Conflicting dependency resolution #1162

diegomrsantos opened this issue Nov 16, 2023 · 4 comments

Comments

@diegomrsantos
Copy link

diegomrsantos commented Nov 16, 2023

Consider the following nimble files

Project A:

version = "1.1.0"

requires "B >= 0.1.4", "C >= 0.0.5 & <= 0.1.0"

Project B:

version = "0.1.4"

requires "C"

Also consider Project C has versions 0.1.0 and 0.2.1 available.

If nimble install A is run, it fails with Error: Cannot satisfy the dependency on C 0.1.0 and C 0.2.1. The version 0.2.1 is installed first for B and later 0.1.0 for A.

Is it expected? When no version is specified, does it mean any version? If so, why hasn't only C 0.1.0 been installed, what would satisfy both A and B requirements?

@xTrayambak
Copy link
Contributor

That's a fairly complicated problem right there. What should the behaviour be? I believe it's fine as it is right now, it's how most languages' package managers handle it.

@diegomrsantos
Copy link
Author

diegomrsantos commented Nov 22, 2023

I believe installing onlyC 0.1.0 would satisfy both project A and B constraints on C version.

@diegomrsantos
Copy link
Author

It seems Nimble is satisfying the dependencies' version constraints (and their transitive dependencies) greedily and locally, instead of globally, considering the whole set of constraints.

@xTrayambak
Copy link
Contributor

I'm fairly sure that's a bug. Nimble will choose any version it can find if none is explicitly provided.

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

No branches or pull requests

2 participants