-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: go install <path>
modifies current go.mod
#26048
Comments
This is related to #24749 which was marked as a dup of #24605. The latter was closed by https://go-review.googlesource.com/c/vgo/+/117257. But I think my original issue remains, and it's similar to the issue described here. For example I would expect |
Modifying go.mod is OK. What's not OK is that the go.mod line for vgo/hello_world is blocking the addition of vgo/hello_world/v2. I have a CL coming soon to fix this. @myitcv, sorry about the closed duplicate. #24749 and #24605 really are the same kind of issue but I inadvertently only fixed the latter (foo/...) and not the former (./...). Pending CL 122397 fixes the #24749 case. |
Change https://golang.org/cl/123095 mentions this issue: |
I just decided to reconsider this issue about modifying The issue with failing installation is fixed, so after running
we get this:
But what you do want from
So what's the point to modify the And the next step in the logic chain, why do we need go.mod at all while running I'm just a little bit confused with it, because I can understand why |
vgo install <path>
modifies current go.modgo install <path>
modifies current go.mod
One use-case: if you're trying to debug a user-reported crash in some binary that uses your module, you might
To know what versions of modules to use when building the binary, and to know what versions were used when building the binary. (But see #24250 for the request to be able to install binaries at specific versions outside the context of a current module.) |
You could use
I just want to install a binary, that's it. And now I can't just run
In order to install a binary to GOBIN I have to initialize a bogus And the error So what I'm trying to say, we have 2 types of project - library and binary. It would be great to say then - "Use We've all got used to run @bcmills if you wish you could convert #24250 into a proposal and I could describe my thoughts there in a more elegant way. Because I understand a former bug issue is not a right place to do it :) P.S. I'm in love with new And I'm issuing the questions, which could help me understand the reasoning under some decisions, so that I could explain it to the others and help to adopt new dependency management in my company and in the community. Thanks! |
We don't have a solid enough design for a concrete proposal yet (see #24250 (comment)). If you want to sketch out the interactions and work out the details, please do make one: even if there's something missing, having a concrete proposal would give us a baseline to build on. (Even though #24250 and this issue exist, it's probably clearer to reset the discussion for a concrete proposal, and we can always mark things as duplicates.) |
What version of Go are you using (
go version
)?go version go1.10.1 darwin/amd64 vgo:2018-02-20.1
Latest
vgo
:What did you do?
Create empty go.mod (to be able to execute
vgo install
)What did you expect to see?
I expect both v1 and v2 binaries to be installed at $GOPATH/bin
What did you see instead?
Second call to
vgo install github.com/mwf/goplay/vgo/hello_world/v2
fails, becausevgo install
modifies go.mod in current directory.So vgo tries to find
v2
under current v1 tree instead of resolving the version and obviously fails.I don't remember the actual plans about
vgo get
andvgo install
, because I read too many docs these days :) but it seems better to divide the usage:get
for updating the current module,install
for installing binaries from anywhere. Now you can't do it without being under a module root.And finally the last concern - any plans to support versioned install? Like
vgo install github.com/mwf/goplay/vgo/[email protected]
? It also fails now :(The text was updated successfully, but these errors were encountered: