-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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 mod download should follow symlinks #39417
Comments
Unfortunately, we can't make any changes to the set of files that get packed into a zip file for a given version. That would change the hashes of the resulting zip files. Even if we gated this on the For reference, before #27093, the About |
@jayconrod, would it be possible for As a very rough metric, I counted ~3000 Github repositories containing Go code that use LICENSE.txt (vs ~80000 with LICENSE) using Bigquery. Or ~2000 (vs ~61000) with Go listed as their first language, in case that means most lines of code (also Bigquery). |
I won't say it's impossible, but it's very difficult to make any change to the set of files that get included in a module .zip file. If different versions of Go choose different sets of files, they won't generate the same hashes, so when a module is downloaded by an old version of the It's also hard to decide what files to actually include: |
We remember all of them. In this case, the proxy would copy all of them. |
Just to close the loop on this: @bcmills, @matloob, and I discussed this last week, and we decided not to change anything here. Some mitigations are possible, but fundamentally, this would cause different versions of the |
Go modules don't handle symlinks well due to golang/go#39417. This hacky fix works around the issue by replacing symlinks with regular files.
Replace dep symlinks with copies of the target Go modules don't handle symlinks well due to golang/go#39417. This hacky fix works around the issue by replacing symlinks with regular files.
When constructing a module zip, follow symlinks and include the linked files.
One application: nested modules can symlink to the LICENSE file at repo root instead of copying it, to avoid skew when the root file is modified.
Example: https://github.com/apache/arrow, which isn't exclusively Go code, has a module at
go/arrow
. The license at repo root is intended to cover the module, but since it isn't in the module tree, it's not in the zip, so the module appears to have no license. The maintainer would like to symlink the license at repo root (apache/arrow#7351).The text was updated successfully, but these errors were encountered: