-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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.sum checksum different on Windows vs. Linux #33178
Comments
Or it could be a stale module cache / hash generated with earlier go version.
package main
import (
"fmt"
_ "github.com/alecthomas/chroma"
)
func main() {
fmt.Printf("Hello\n")
}
And a
The theory was to re-create
But maybe I'm just not reproducing whatever
One way to confirm the "format change" theory would be to rerun this with a version of go before the I don't know when this change happened. |
There was a change in the way sums were calculated between go1.11.3 and go1.11.4 (we will ensure that never happens again). Is it possible the The checksum algorithm explicitly sets For the record, |
It's possible. I imagine running I don't have a setup with go 1.11.3 thought. |
You can get Go 1.11.3 with |
It's still |
Also note that before Go 1.12, we had no locking or synchronization on the module cache. Is it possible that the cache entry for this module was corrupted due to concurrent |
Yes, it's possible it comes from corrupted cache. I've ran It's fine to close this bug as I see no way to make progress determining the root cause. |
Thanks. Do let us know if you see this again going forward, especially if you discover a clue as to the underlying cause. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have a program that imports
github.com/alecthomas/chroma
. I've createdgo.sum
on Windows (by building a program with go 1.2.7) and checked it in.I checked it out on Linux (Ubuntu 18.04) and tried to build it with go 1.2.4.
What did you expect to see?
It should work.
What did you see instead?
It failed with:
I fixed it by deleting
go.sum
but after a build it was indeed different on Linux than on Windows:Please note I know little about how
go.sum
works but here's my theory:go build
calculates checksum ingo.sum
as hash of file contentgo build
downloads repositories usinggit
installed on the systemgit
can change newlines depending oncore.autocrlf
settings, changing the content and therefore changing the hashOn Windows I have:
On Linux I have:
Presumably, we would prefer
go.sum
not be affected by local value of git'score.autocrlf
setting.I imagine it would be possible for go tool to invoke
git
in such a way as to over-ride local setting and ensure thatcore.autocrlf=false
when downloading dependent repos locally for module cache.The text was updated successfully, but these errors were encountered: