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 upgrade --missing-only and git+https selections can lead to multiple package cache entries #2261

Closed
kinke opened this issue Jun 8, 2022 · 9 comments

Comments

@kinke
Copy link
Contributor

kinke commented Jun 8, 2022

pkg1/dub.sdl:

name "pkg1"
targetType "library"
dependency "openssl" version=">=3.1.0"

pkg2/dub.sdl:

name "pkg2"
targetType "executable"
dependency "pkg1" path="../pkg1"

pkg2/dub.selections.json:

{
	"fileVersion": 1,
	"versions": {
		"openssl": {"repository":"git+https://github.com/kinke/openssl.git","version":"9e56c4bd28d01bcd3644df940101f156b48d9fca"},
		"pkg1": {"path":"../pkg1"}
	}
}

After cleaning up the ~/.dub/packages cache, running dub upgrade --missing-only with dub v1.28 in the pkg2 dir yields two identical openssl git clones:

  1. ~/.dub/packages/openssl-9e56c4bd28d01bcd3644df940101f156b48d9fca/openssl
  2. ~/.dub/packages/pkg1-9e56c4bd28d01bcd3644df940101f156b48d9fca/pkg1

dub build is fine, only ending up with expected version 1 above.

@nordlow
Copy link
Contributor

nordlow commented Jun 8, 2022

After cleaning up the ~/.dub/packages/ cache

What is meant by this line?

If it is meant that ~/.dub/packages/ is deleted where do the other faulty cache artifacts reside? In pkg1/.dub/ or pkg2/.dub/ or both? Or under /tmp/?

@kinke
Copy link
Contributor Author

kinke commented Jun 8, 2022

An rm -rf ~/.dub/packages, just to illustrate that the 2 resulting clones are both caused by the following dub cmdline, not some leftover from other builds. Not recommended for local reproduction. ;)

@nordlow
Copy link
Contributor

nordlow commented Jun 8, 2022

An rm -rf ~/.dub/packages, just to illustrate that the 2 resulting clones are both caused by the following dub cmdline, not some leftover from other builds. Not recommended for local reproduction. ;)

I see, thanks.

@nordlow
Copy link
Contributor

nordlow commented Jun 8, 2022

  1. ~/.dub/packages/pkg1-9e56c4bd28d01bcd3644df940101f156b48d9fca/pkg1

Should the hash on this line differ from previous?

@nordlow
Copy link
Contributor

nordlow commented Jun 8, 2022

Do you have any clues about where to start digging to fix this, @s-ludwig?

@rikkimax
Copy link
Contributor

rikkimax commented Jun 8, 2022

I would look at:

private Package loadGitPackage(string name, string versionSpec, string remote)

@nordlow
Copy link
Contributor

nordlow commented Jun 9, 2022

So to double check is the call to git clone getting the wrong treehash, @kinke? Regardless of cloning over git vs https, right?

@kinke
Copy link
Contributor Author

kinke commented Jun 9, 2022

Nope - there should obviously be no pkg1-9e56c4bd28d01bcd3644df940101f156b48d9fca dir at all, with an openssl hash and containing a superfluous openssl clone!

@WebFreak001
Copy link
Member

was a mixed up argument in the package resolver. Has been fixed by #2588 since v1.31.1-beta.1

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

4 participants