dub
dub copied to clipboard
Dub with local dependencies goes crazy without "version": "*"
System information
- DUB version 1.28.0, built on Mar 6 2022
- Windows 10
- DMD32 D Compiler v2.099.0-dirty
Bug Description
Basically, I have a project with a bunch of local dependencies. They started depend each other on something like an "utils" library. Then I specify the project by doing
"dependencies":
{
"utils": {"path": "../utils"}
}
After adding "version": "*"
, it solved this problem (I needed to delete dub.selections after that)
How to reproduce?
Maybe try cloning my project and dub it https://github.com/MrcSnm/HipremeEngine
Expected Behavior
Compile?
Logs
data >=0.0.0 @modules\data depends on hipengine_api >=0.0.0 @hipreme_engine ~master depends on hipengine_api >=0.0.0 @C:\Users\Hipreme\Documents\Programming\D\HipremeEngine\api
What do you define as "going crazy"? Do you not get a usable error message?
This may well be a bug in the documentation, which contradicts itself. https://dub.pm/package-format-json#version-specs:
A version specification should only be specified when no "path" attribute is present
yet
Whenever you refer to (sub) packages within the same repository, use the "any version" version specifier: "*"
Not sure how long this contradiction is in place.
I remember "version": "*"
as being obligatory for dependencies with a "path"
attribute, so it may have been documented differently before.
Nevertheless I agree that it is reasonable to expect Dub to default to "version": "*"
for dependencies with a "path"
attribute when none is given.
This is the error I get:
data >=0.0.0 @modules\data depends on hipengine_api >=0.0.0
@hipreme_engine ~master depends on hipengine_api >=0.0.0 @C:\Users\Hipreme\Documents\Programming\D\HipremeEngine
Which usually happens when you have 2 projects which depend on different versions of the same library. So, there's 2 bugs occurring:
- Not defaulting to "*" 2.They both depend on >= 0.0.0. But it is as if they're not the same version, so, that bug should never occur. Probably there's other thing which is not seen being used to compare the versions
note: a path based variable should not require (and even disallow) a version, as the path should always override whatever version resolution would do. This seems like a bug in the dependency resolver.
there was an issue with path based dependencies in submodules wrongly being resolved, which might be at play here. Should be fixed with latest DUB beta (v1.31.1-beta.1)
If it still doesn't work, feel free to reopen.
The bug report was for v1.28
I wasn't able to reproduce it by cloning HipremeEngine and checking out 8c7894394227e7866ccaf8d44e41244ff3a3b6bf (last commit before this issue date) - neither with dub upgrade, nor with dub build
also in v1.28 path based dependencies also resolved wrongly, it was just a different sub-issue that didn't trigger. The regression fix has also accidentally fixed other issues that were broken with 1.28 like #2261