-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: add 'go mod vendor -o <dir>' #47327
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
Comments
I can take a stab if there's no one already on it. From a quick look, it looks straightforward; adding the new option, and working with a different |
I think I confused myself about which was the next release and meant Go 1.18 for this. |
Change https://golang.org/cl/338149 mentions this issue: |
Change https://golang.org/cl/362814 mentions this issue: |
For golang/go#47327 Change-Id: I8f6a4da541be4d95aa8b420b0294a0c1e78b8a0b Reviewed-on: https://go-review.googlesource.com/c/website/+/362814 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Than McIntosh <thanm@google.com>
Change https://golang.org/cl/363174 mentions this issue: |
For #47327 Change-Id: I50418c0d017c4e90a2c13d26945ee639079e4e33 Reviewed-on: https://go-review.googlesource.com/c/go/+/363174 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Paschalis Tsilias <paschalistsilias@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
For golang/go#47327 Change-Id: I8f6a4da541be4d95aa8b420b0294a0c1e78b8a0b Reviewed-on: https://go-review.googlesource.com/c/website/+/362814 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Than McIntosh <thanm@google.com>
Thinking about how to get a copy of all the code that is needed for a given build, for uploading to some kind of a remote build (Google App Engine or other similar systems).
Right now if you upload just the main module, then the remote build has to resolve all the dependencies. But what if the dependencies are private modules, and the remote build has no access to them? This happens.
The solution I have used in the past is to run
go mod vendor
and then do the upload of the main module. That works, but then you have a vendor directory you need to remove (assuming you don't want it in you repo).What could be done instead is to have the uploader itself run
go mod vendor
, zip up the main module, and then delete the vendor directory. That's almost perfect except that I think it's bad form for an uploader to be making changes in the actual directory being uploaded.If instead
go mod vendor
took a-o
flag saying what directory to write the vendor tree to, then the uploader could write it to a temporary place and then combine that with the contents of the actual main module directory.We should do this for
Go 1.17Go 1.18.In the long term, we might also consider some kind of formal "archive of everything for a build", so that you could
go mod archive -o x.zip
, but there's a lot to figure out there about exactly what that zip file looks like, how you build it, and so on.For now if we do
go mod vendor -o
, then that will unblock uploaders.The text was updated successfully, but these errors were encountered: