-
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
x/vgo: rename go.modverify to go.sum and enable by default #25525
Comments
Change https://golang.org/cl/115496 mentions this issue: |
Change https://golang.org/cl/121298 mentions this issue: |
Change https://golang.org/cl/121302 mentions this issue: |
Refactoring so that all the cache directory management is in package modfetch. While here, rename go.modverify to go.sum, in preparation for forcing go.sum checking on all the time. Vgo will automatically move content from go.modverify into go.sum when it sees it. For golang/go#25525. Change-Id: Id03286d52ca4923b35ac14b639e5885571397bba Reviewed-on: https://go-review.googlesource.com/121298 Reviewed-by: Bryan C. Mills <bcmills@google.com>
A bit late to the ticket, but why not add a third column to the |
@dlsniper Bad idea, than we won't be able to add This is what happens if I try to use a windows checksum on a linux system.
The way I got round that issues is to add |
@CJ-Jackson unfortunately I don't understand how this happens and because the example you provided is not publicly accessible I can't reproduce it. My suggestion is to run However it's concerning that you have two different checksums as it means that the build is not reliable, which is the whole point of having this checksum feature. |
@dlsniper I had a more closer look it's zip the source code and generate the sum based on the zip file, hench On windows (cygwin) I get this.
On linux I got this.
As you can see the checksum of mod files are the same on windows and linux, but as for the zip file that comes out differently, that suggest to me that there might be a bug with the zip utility in Go. Until that is fix I have to leave |
@CJ-Jackson are you definitely running the same commit of |
@myitcv Yes I am Windows
Linux
I just notice a new commit in vgo, I'm going to update vgo and do the shasum again. UpdateI updated vgo to |
@CJ-Jackson's problem was git mangling the line endings, tracked as #26229. @dlsniper In general we're much less likely to see comments on closed issues than on open ones. I just happened to come across this when working on #26229. To answer your question from 8 days ago, I can think of a few reasons to keep go.mod and go.sum separate:
These are all circling around the general concern, which is that go.mod is meant to be human-readable, with nothing more than a text editor, with meaningful diffs for code reviews, and so on. In contrast go.sum is very much not human-readable. It's an impenetrable alphabet soup. In the little repo I run tests in, at this moment go.mod is 803 bytes and go.sum is 7,470 bytes. If we put go.sum into go.mod the signal-to-noise ratio there would be near zero. |
go.modverify guarantees that only the main source repository needs to be securely obtained and verified for the whole build to be verified and reproducible. It also enables untrusted proxies.
Go has a culture of secure by default, so we should provide this safety automatically. Also, most people will be upgrading from dep, so we should not downgrade their security in the process.
A flag to disable modverify is probably not needed, if someone wants to turn off the brakes they can easily add the file to gitignore and/or script its removal.
@rsc suggested renaming it to
go.sum
, which sounds good to me.This is not to say that we don't aim to build a better verification system that will hopefully replace go.sum files for most users, but that will take more time than vgo adoption will hopefully take.
The text was updated successfully, but these errors were encountered: