-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: mod vendor modules.txt sort order is inconsitent between linux and freebsd #34538
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
Providing some more information here. There appears to be a difference in the sorting order of vendor/modules.txt between linux and freebsd. Freebsd uses pure alpha ordering and linux takes the number of path components into account
From the diff excerpt you can see that bsd is trying to sort |
@pgier, want to send a fix? Should be a pretty easy one. |
Yeah, I can git it a shot. Which way is the right behaviour? The bsd way (pure alpha) seems better to me because it would group together packages with their subpackages, but changing the linux version will probably affect more people, and I'm not sure if there is a specific reason it was done that way. |
Probably we should sort lexically by path. (That is: use the same order that |
Testing this further it seem to be a difference between go 1.12 and 1.13. I had been using 1.12 on Linux when I thought I was using 1.13. Sorry for the faulty bug report! |
Oh, yep! There it is: https://golang.org/cl/174527. |
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?
Ran
go mod vendor
on freebsd.What did you expect to see?
vendor/modules.txt should not be modified
What did you see instead?
vendor/modules.txt was modified to sort in a different order from the committed version
The text was updated successfully, but these errors were encountered: