-
-
Notifications
You must be signed in to change notification settings - Fork 227
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 fails for common dependency of app and library, even though a mutually acceptable version is available #1732
Comments
I just tried to create a VERY minimal example as follows: (1) create a project in a directory
{
"name": "subm",
"description": "A minimal test case for DUB version resolution: the submodule",
"dependencies": {
"unit-threaded:assertions": ">=0.8.0 <0.9.0"
}
}
module subm;
unittest
{
import unit_threaded.assertions;
(1 + 1).should == 2;
} (2) create another project in another dir,
{
"name": "vres",
"description": "A minimal test case for DUB version resolution",
"dependencies": {
"unit-threaded:assertions": ">=0.8.0 <0.10.0",
"subm": {"path": "submodules/subm" }
}
}
import std.stdio;
import subm;
void main()
{
writeln("Edit source/app.d to start your project.");
} ... and then However, in this case, DUB flawlessly recognizes that |
Interestingly enough, in the original project, I get a version resolution failure even if the app specifies |
I have another similar issue for clashes over the
... where again one would expect this to resolve straightforwardly to 0.10.13 (and where DUB accepts this with no problem if there is already a What's weird is that this showed up after adding an extra submodule dependency to the affected project, even though that submodule has nothing to do with So, I'm wondering if having |
This bears a lot of resemblance to problems we've had at Symmetry. Thanks @joseph-wakeling-frequenz for doing the legwork to produce a useful bug report. |
The inconsistency of it is weird, which makes me wonder (without having looked at any internals) if it's in some way related to how dependency info is stored and iterated over inside DUB -- so that adding 1 more dependency perhaps changes the order of decisions in a way that impacts outcomes. I'm particularly suspicious because the taggedalgebraic issue started showing up again in a different context -- this time after adding an extra dependency on a public DUB project (pyd, which has nothing to do with any of the other packages). @John-Colvin I'm putting together a little document on use-cases for build and dependency management that's intended to cover the situations that only crop up with in-house work. It's going to cover the basic needs (divorced from any particular technical solution) and then go over potential mechanisms to use with DUB, together with problems encountered. Would you be up for a chat about that some time to compare notes? |
I should say: it's not a flaky Heisenbug, when it shows up it's consistent between builds, but it is strange when it shows up. |
Do you think libsolve could be helpful? |
Obviously not directly if it's a data structure problem or representing the raw data problem. |
Crazy thought. Wrap dub as a library for SIL so you can play with it from Jupyter and see what crazy things it is doing. |
My first suspicion would be that the error message that gets generated in |
@s-ludwig yes, this has also been my suspicion, given that solving one alleged clash has often led to another being reported instead. |
This is a simple example of the dependency resolution failure described in dlang/dub#1732. Running `dub build` fails with the error: Unresolvable dependencies to package taggedalgebraic: eventcore 0.8.43 depends on taggedalgebraic >=0.10.12 <0.12.0-0 std_data_json 0.18.3 depends on taggedalgebraic ~>0.10.1 The reported failure in fact has an easily recognizable resolution, but for some reason DUB is unable to find it. It is not 100% clear if this is the real dependency clash or not, but it is interesting to note that if `dep2` (which has no dependencies of its own) is removed from the list of dependencies of the main project, the resolution failure also disappears.
I've put together a minimal example of the problem here: https://github.com/joseph-wakeling-frequenz/vibe-dependency-failure |
An interesting note: if I delete the |
System information
Bug Description
An application project has a dub dependency which in turn has a dependency on unit-threaded:
I tried adding a similar dependency to the main app, but with a wider supported range of versions:
When trying to run
dub test
I get an error message:... despite the fact that the dependencies are eminently resolvable (just use v0.8.0, which is compatible with both constraints). This can be established straightforwardly: if I use
dub.selections.json
to specify using v0.8.0, dub is perfectly happy with this.How to reproduce?
A minimal example:
dub build
on the project at https://github.com/joseph-wakeling-frequenz/vibe-dependency-failureExpected Behavior
DUB should recognize that v0.8.0 is a perfectly acceptable resolution of the two version constraints and choose that.
The text was updated successfully, but these errors were encountered: