-
Notifications
You must be signed in to change notification settings - Fork 1k
dep ensure fails on subpackage with a revision constraint #705
Comments
dep ensure
fails on subpackage with a revision constraint
hi, welcome! thanks for the detailed issue 🎉
This is exactly what we're hoping for folks not to do 😢. I thought we had an FAQ entry for this, but apparently not. When you do this, it turns That said, until we make a bit more progress on #277 (hopefully in the next week or so), dep still suffers from the same problem that glide does where you can't update only a single dependency at a time. If that's what you're guarding against, then I get it. But once we get that fixed, I hope you'll be able to stop using dep this way. Anyway, on to your problem. The central thing is this:
That's happening because there's a relative import in one of the tests in that package. Some explanations:
Almost certainly this is more than you're looking for, @ellotheth, but it points to issues we need to resolve, so I have to highlight them 😄
This is...weird. Very weird. Constraints cannot be applied to arbitrary packages - only the root of a project. Or at least, they should not be able to be applied to arbitrary packages. The fact that it worked for you above is a happy accident, but it's undefined behavior. We need errors to guard against it, and are working on them in e.g. #697 (though that's slightly different). It's even weirder, though, that the error with the relative import didn't re-occur. Definitely needs some investigating. |
Thank you enormously for the comprehensive response. I appreciate your time!
Ok so before this causes anyone a sad, I swear there's method to my madness:
(I could also have updated all my dependencies with Glide and started moving to dep afterwards, but I wasn't sure how long it would take or if it would work.)
ARGH, you know what, I saw a couple other issues related to relative imports, so I checked all the non-test files in that
Not at all! dep is trying to solve a hard problem, and the process is fascinating.
Ha! I'm glad it's not just me. If you end up needing more information, let me know! |
@ellotheth We just merged a feature that will read your glide configuration during |
@carolynvs Unfortunately the repo is not public; it's a backend service for WonderNetwork. That said, I'd be happy to test it out and report back! |
@carolynvs Gist here: https://gist.github.com/ellotheth/e96f8f2c5fdd1b9e09e183970cfb276b. It breaks on the mgo package, maybe because it's expecting semver-compatible versioning? |
Thanks! I think the problem is that I'm converting "v2" to a semver instead of a branch when importing your glide.yaml. I'll poke around a bit more and see if that's right. |
Probably is - I think I stumbled across this code last night. One of the main things we have to do with glide is figure out which type a string like that - which COULD be semver, OR a string-literal match to e.g. a branch, should be. |
Even this should fall under the same general rubric as what I described above - even if you have to follow a branch, what's in It'll normally only change on a
❤️ ❤️ |
That works once I've got dep into the state I want it, but how do I get to that state? I'm using Glide to track the I'm using Glide, so the |
Ahh, gotcha. i believe that |
Is there any workaround for this bug? We use many packages that contain test files like that. |
What version of Go are you using (go version)/operating system and processor architecture?
What did you do?
I've been using Glide, and I'm trying to migrate to dep. I don't want to upgrade my dependencies in the project, so I'm using
[[constraint]]
to fix them at the revision specified in myglide.lock
file.What did you expect to see?
A successful dependency graph for the revision I requested.
What did you see instead?
Notes
If I use
github.com/mikespook/gearman-go/worker
as the constrained package, I get the correct revision for that subpackage, but a different revision for the parent:produces
with the following lock file:
The text was updated successfully, but these errors were encountered: