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

Dub with local dependencies goes crazy without "version": "*" #2252

Closed
MrcSnm opened this issue May 31, 2022 · 7 comments
Closed

Dub with local dependencies goes crazy without "version": "*" #2252

MrcSnm opened this issue May 31, 2022 · 7 comments
Labels

Comments

@MrcSnm
Copy link
Contributor

MrcSnm commented May 31, 2022

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

@veelo
Copy link
Contributor

veelo commented May 31, 2022

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.

@MrcSnm
Copy link
Contributor Author

MrcSnm commented May 31, 2022

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:

  1. 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

@WebFreak001
Copy link
Member

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.

@WebFreak001
Copy link
Member

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.

@Geod24
Copy link
Member

Geod24 commented Feb 13, 2023

The bug report was for v1.28

@WebFreak001
Copy link
Member

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

@WebFreak001
Copy link
Member

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

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

No branches or pull requests

4 participants