-
Notifications
You must be signed in to change notification settings - Fork 1k
Incorrect branch taken on n+1 dependency #1112
Comments
@mremond hi, thanks for trying dep. I tried to reproduce this but couldn't get the transitive dependency
And then I changed
Regarding setting constraint for |
@darkowlzz Thank you very much for your reply.
What can I do to find why it is taking that branch ? Is there special debug options ? |
bit of a side note here, but
happens is a bit misleading; that's really just
you didn't walk it back as far as @darkowlzz did, though - you let
pass
right now, just package existence - if you're importing a package that does not exist at the target version, that version will be discarded and then next available version will be attempted. |
Thanks @sdboyer We will lock the dependency on the full revision id. We had to do this as we are waiting for a bug fix and needed to lock the lib on the last working version for us. Regarding the test, I did restart from scratch, to be sure, as you pointed you. I removed Gopkg.toml, Gopkg.lock and vendor dir. I have the same behaviour with just the Go file in the directory, without locking gocql to a given version (just checkout, delete and dep init). Here is the printout of dep init in verbose mode:
It seems the first branch tried on github.com/hailocab/go-hostpool is the first one in alphabetical order, and it is accepted on first try. It does not seem to consider master. I hope this helps, |
sure, that's not an uncommon approach. it's generally not strictly necessary, as running
oh, ok - your previous response indicated that you only removed the latter two:
so, we're back in very, very weird territory. i can't replicate your situation locally, either - i see the same results as @darkowlzz. the only thing i can think that might be causing it to pick that old version over another is if you had could you have a look at |
oh, just to be explicit - the logic definitely puts default branches before non-default branches (which are then sorted lexicographically). that's why both of us are seeing master. i'm just mystified on why you'd be getting something different - but hopefully that oh, also, the output of |
Thanks ! I tried on another machine with and almost empty GOPath and it works as expected, so this confirm what you knew: It is an issue related to my environment. Let's try to find the difference. Here are some info that your requested. From go/pkg/dep/sources/https---git.f4.workers.dev-hailocab-go--hostpool:
Here is git ls-remote:
|
i'm glad you weren't able to replicate it on another machine - really, a relief. but it's still pretty disturbing that you were observe, and replicate, this behavior on any machine. that git output all looks the way i'd expect it to, which leaves me quite mystified as to what might have been causing this 😢 at this point, all i can think of to have you do on the problem machine is hack up |
Here is the result: |
Strangely, retrying now from home and I get a different order from Interestingly, ListVersions comment says:
So, it seems to imply that if VCS return list in different order, we will try the list of branches in a different order. |
I think I found the issue. I will try to test some possible fix / workaround and report here. |
The issue happens when you need to use private repository.
When you do this, you get through ssh and can have SSH warning at the beginning of git commands. In my case, when I issue the command
The first warning line is confusing the function
I confirm that removing the "insteadOf" option on Github solves the issue and dep is starting to get the correct dependency because it can resolve HEAD properly and start getting the default branch. |
ugh, i realized i sent you to not the most helpful spot. the interface contract of
ah, yes! that would definitely do it. note that we have another PR open, #1053, which is also working on this same bit of logic.
absolutely! 🎉 |
Sure, I will check this PR and see how I can make sure I propose a PR that is compliant / easy to merge with #1053 |
What version of
dep
are you using (dep version
)?Master head from today. I tried previously with dep 0.3.0
What
dep
command did you run?I have build an exemple project.
Initial try. I did
dep ensure
on the project afterdep init
and changing the constraint on go_cql to a specific revision (see https://github.com/processone/dep-resolv/blob/master/Gopkg.toml#L26).dep used the outdated branch internal_changes (the first one alphabetically) as value for branch, instead of master.
See: processone/dep-resolv@1d6b1d3#diff-836546cc53507f6b2d581088903b1785R30
Doing dep ensure -update does nothing.
dep status is well aware of the discrepency:
What did you expect to see?
I expect that Gopkg.lock would have used master branch as default branch without the need to add a specific constraint.
I expect adding the contraint and running go ensure -update to select the right dependency for second level dependency.
What did you see instead?
Project is stuck with outdated version of a subdependency. Only way to use the right version is to fix Gopkg.lock manually and do dep ensure.
The text was updated successfully, but these errors were encountered: