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
x/vgo: Empty go.mod after vgo build #24038
Comments
With rewriting the imports for this dependency in my own app to be
From reading around, I think this would be resolved if go-chi/chi had a go.mod file under a v3 tag, and internally imported things as chi/v3. Either way, it seems really hard to get the latest major version of a dependency installed, especially when they don't have the go.mod file. |
You have an error in the dependency lookup:
Currently when any error happens the go.mod file is not touched. vgo needs to be picky about import paths because it embeds them into the binary and we can record the hashes. I think this is working as intended. |
@kardianos does it follow then that it's by design that vgo cannot use a "latest" major version of a dependency if that dependency does not have a go.mod file? eg:
I think this is a subtly different issue from the linked one (version > 1 need import path changes), even with import path changes you can't get a later version if that dependency does not use mod.go, so effectively you're unable to use that library directly. |
@josler There are a few things here. There are both confirmed and potential issues with the vgo implementation. These are the aspects of the issue that I linked to other issues. The issue you brought up is just the design of vgo and isn't an issue (but with real impact!). There is discussion of that on mailing lists and other issues, but if we discuss that it should be directed at the design specifically and this is a general issue. |
@josler FYI, I did get go-chi working with a require that looks like the below (and without changing any of my imports)
With that everything works great. |
Very excited by the direction vgo is going, kudos on that and on the thoughtful explanation of the ideas and implementations in Russ's post.
Not sure if I'm doing something wrong, but just tried out vgo on a project of mine after blowing away my vendor directory and it isn't building my go.mod as I would expect, it remains empty. I see one warning in there due to a package rename, but it seems to indicate it is moving / fixing it. (exit code id 1 however)
What version of Go are you using (
go version
)?go version go1.10 darwin/amd64 vgo:2018-02-20.1
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?amd64/darwin
What did you do?
https://github.com/nyaruka/courier
, cd in courier dir.go.mod
What did you expect to see?
Resolved dependencies in go.mod.
Note that one thing I'm noticing here is that the "default" of a v1 module is going to make transitioning to vgo a bit painful. It would be really nice if the behavior of importing the latest version of a module defaulted to the latest MAJOR version on first resolve (with the appropriate rewrites of import statements). For example, in this case I believe the failure is due to some bad naming in the v1 version of go-chi, which is now on v3 and which I believe has those naming errors fixed. I don't believe I would have any error at all if the default behavior was to pull in the last MAJOR version instead of the last V1 version.
At the very least it would be super useful to have the update command have a switch to allow moving to the latest version. (and doing the import rewrites for you)
What did you see instead?
The text was updated successfully, but these errors were encountered: