-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: running go1.23.0 mod vendor
on go1.22.6 source unexpectedly vendors golang.org/x/crypto/sha3
#69235
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 tried changing I suppose this might be reasonable: I'm not sure how this is intended to work, but maybe it's fine if documented in README.vendor? |
I don't think a cmd/go built from a different tree and/or pointed at a different GOROOT is expected to work correctly on |
Change https://go.dev/cl/616815 mentions this issue: |
Submitted a CL to add a note, although its claims are weak because I don't know what's intended to be guaranteed here. 😄 |
Using a different build of Go (specifically, a different GOROOT) to maintain the vendor directory doesn't always reproduce the same results. This can result in unknowingly creating a vendor directory that isn't able to build Go. Add a note to README.vendor to point this out. Specifically, mention that a mismatched GOROOT is an issue, and recommend using a fresh build of Go to maintain the vendor directory. Updates #69235 Change-Id: Id80c7607bf28bd76e43e1fdc672811c50f2bffb3 Reviewed-on: https://go-review.googlesource.com/c/go/+/616815 Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Sam Thanawalla <[email protected]> Reviewed-by: Sam Thanawalla <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
This behavior is expected. Different Go versions can sometimes resolve dependencies in slightly different ways (because of optimizations/tweaks) which can lead to variations in the packages that end up in your vendor directory. The scope of the backwards compatibility promise is that code written for older versions of Go will continue to work on newer versions. Changes to vendoring should not break this promise. While striving for consistency is important, minor variations can still happen. Thanks for the CL. Closing this out! |
Go version
go version go1.23.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
After checking out go1.22.6, in
src
:(Used https://pkg.go.dev/golang.org/dl to download both Go versions.)
What did you see happen?
The first
git diff
has no output. This means go1.22.6's vendor directory is reproducible when I run Go 1.22.6.The second
git diff
shows:(The golang.org/x/crypto/sha3 source is also added into
vendor/
.)What did you expect to see?
I expected reproducible results both times.
I filed this based on https://groups.google.com/g/golang-nuts/c/BEsmO16g37I, where I mentioned why this is what I expected:
The text was updated successfully, but these errors were encountered: