-
Notifications
You must be signed in to change notification settings - Fork 542
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
failure to generate lock file due to conflicting package versions #564
Comments
@timoreimann this is a good question.
Any thoughts on a better UX here? |
@mattfarina thanks for the quick feedback. It seems to me that the user might actually not be able to reliably determine when a particular dependency can be considered test-only or not -- at least not over time as the number of dependencies evolve. I feel like it should be up to glide exclusively to make that judgement by means of analyzing the direct and transitive dependencies and "shifting" packages between the the import and test import groups as appropriate. Technically, this could mean that the Apart from that, I wonder if we can improve the way glide deals with this error in the current implementation:
|
@timoreimann all of this that you've described is already done, working, and tested in gps :) Well, almost all. We don't annotate packages in the resulting lock file as being test-only or not. It's not a trivial refactor, but it's not a terrible one, either...though I'm not sure how important it is as an immediate, practical matter. Issue for it is sdboyer/gps#44. I've also noted this on the list on #565 |
@sdboyer is it reasonable to consider backporting the working solution from gps to glide? Or are the two fundamentally too different to justify such an effort (which is my assumption)? The least we should do from my perspective is to help the user understand what's going on and make sure the vendor folder isn't touched in case of this error (which summarizes my two bullet points). Having to ask the user for manual resolution is not ideal but hopefully rather cheap to implement and better than what we have now, at least until glide/gps is able to deal with this autonomously. By the way, what's the actual benefit of classifying into build and test imports in glide currently? I suppose you want to enable a cleaner separation between installing dependencies required for production vs. testing. Is there already a glide work flow supporting this model, along with a set of commands / switches? Side note: My expectations of gps are so high by now, if this thing won't be able to resolve dependencies fully automatically while also brewing my morning coffee at the same time, I'll be heavily disappointed. ;-) |
correct, it's not feasible. fundamentally different algorithms. best thing to do is get gps merged in 💯
The topic of how much "automated" resolution is good is one that's come up quite frequently in the community discussions in this space. I expect the committee that's forming will deal with it quite extensively.
The main one I always think of is the ability to conditionally download only those dependences that are needed for the task at hand. (The same applies to tagging for os/arch).
I am truly loathe to oversell things, but when people bring up specific cases that I've addressed, I feel OK saying something about it :) There are holes in gps, and I'm sure we'll find more as time goes on...but this isn't one of them. |
Any chance we can move forward with this issue in a way that doesn't require waiting for gps to get merged? (Unless that's a thing close to completion, which it wasn't last time I checked.) As mentioned, I see two possible short term solutions:
I'd be happy to try to implement either of two approaches or any third one that might be preferred. Thanks. |
I was just hit by this and would like to see some progress here as well. |
I think the best solution is to don't have a version constraint on your test dependencies. |
@stevenroose I don't think that "solution" works for some of us. For example, I have a
|
same issue and no version specified at all
|
This was causing an error in glide. See Masterminds/glide#564.
Getting similar issue: Failed to generate lock file: Generating lock produced conflicting versions of github.com/golang/mock. import (), testImport (v1.1.1). I have specified version in glide.yaml |
When trying to
glide upgrade -v
with the latest HEAD version (commit 8ec4e94) and no glide.lock file existing, my run finishes with an error:The package in question was (correctly) identified as a
testImport
in my glide.yaml file (initially populated throughglide create
with the version specifier manually added by me):My code doesn't use the package in non-test code anywhere. I don't see client_model being referenced elsewhere in glide.yaml either (i.e., there's no duplicate entry in the
import
section).The state of my vendor/ folder is also somewhat messy: I had it vendor-stripped and committed before but after the failed run, git status is reporting a huge number of changes (reminding me of #367). What I can also see is a number of nested vendor folders, with some of them referencing the offending prometheus package. My guess is that this is where the conflict stems from, even though the error message apparently claims that the set of (non-test) imports is empty.
The run does not produce a lock file.
What I'm double-checking right now: AFAIR, I haven't seen this problem with 0.11.1 and not even with versions of glide a few commits ago (some of them certainly past the last 0.11.1 release).
The text was updated successfully, but these errors were encountered: