Skip to content
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: symbolic links not dropped from repo #27093

Closed
rogpeppe opened this Issue Aug 20, 2018 · 8 comments

Comments

Projects
None yet
5 participants
@rogpeppe
Copy link
Contributor

rogpeppe commented Aug 20, 2018

go version go1.11rc1 linux/amd64

The zip unarchiving used by cmd/go/internal/modfetch does not respect
symbolic links or file modes. This means that if there's a test directory that
contains symlinks or executable files (e.g. shell scripts) and there are
tests that rely on those properties, they will fail when the module is
a dependency and tests are run on it (for example with go test all).

Currently a symbolic link is treated as a plain file - it is unarchived as a normal
file with the symbolic link as its contents, which seems wrong even if we
decide not to support symlinks in modules. Similarly, the module
content hash check will treat a symbolic link identically to a regular file.

@dsnet

This comment has been minimized.

Copy link
Member

dsnet commented Aug 20, 2018

Per #24057 (comment), I think this is working as intended.

@rogpeppe

This comment has been minimized.

Copy link
Contributor Author

rogpeppe commented Aug 20, 2018

@dsnet Thanks a lot for that link - I hadn't seen that. Given that's a deliberate decision, I'm fine with it (very happy actually), but I do think that somewhere you should at least get some error or warning that your symbolic link has been silently turned into a plain file.

@rogpeppe rogpeppe added the modules label Aug 20, 2018

@rogpeppe rogpeppe changed the title cmd/go: symbolic links and executable files are not preserved in modules cmd/go: symbolic links in modules are silently turned into plain files Aug 20, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Aug 21, 2018

Can you please give an example? Symbolic links are supposed to be silently elided from the underlying version control repo. It sounds like one of the converters is including them in the archive incorrectly.

@rsc rsc changed the title cmd/go: symbolic links in modules are silently turned into plain files cmd/go: symbolic links not dropped from repo Aug 21, 2018

@rsc rsc added this to the Go1.12 milestone Aug 21, 2018

@rogpeppe

This comment has been minimized.

Copy link
Contributor Author

rogpeppe commented Aug 21, 2018

See this repo: https://github.com/rogpeppe/test2
The tests directory in the top-level module has a symlink in it which is not elided on import.

@bcmills bcmills self-assigned this Nov 15, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Nov 20, 2018

Good candidate for backport once we fix it. Probably git archive is putting symlinks into the zip and I didn't realize that was a thing that would need to be filtered out.

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Dec 12, 2018

Change https://golang.org/cl/153819 mentions this issue: cmd/go/internal/modfetch: skip symlinks in (*coderepo).Zip

@bcmills

This comment has been minimized.

Copy link
Member

bcmills commented Dec 12, 2018

@gopherbot, please backport to Go 1.11: incorrect module contents produce incorrect go.sum entries, and the fix is tiny.

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Dec 12, 2018

Backport issue(s) opened: #29191 (for 1.11).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@gopherbot gopherbot closed this in 561923f Dec 12, 2018

sagikazarmark added a commit to sagikazarmark/viper that referenced this issue Jan 25, 2019

Update go.sum with go1.11.4
In Go 1.11.4 a bug was fixed related to checksum calculation.
As a result, some packages might end up with a different checksum
from this version. The solution is upgrading, cleaning the mod cache
and recalculating the go.sum file.

See golang/go#27093

bep added a commit to spf13/viper that referenced this issue Jan 27, 2019

Update go.sum with go1.11.4
In Go 1.11.4 a bug was fixed related to checksum calculation.
As a result, some packages might end up with a different checksum
from this version. The solution is upgrading, cleaning the mod cache
and recalculating the go.sum file.

See golang/go#27093

Rafiot added a commit to Rafiot/phishdetect that referenced this issue Feb 12, 2019

josephtfrank pushed a commit to SpectraLogic/viper that referenced this issue Feb 26, 2019

Update go.sum with go1.11.4
In Go 1.11.4 a bug was fixed related to checksum calculation.
As a result, some packages might end up with a different checksum
from this version. The solution is upgrading, cleaning the mod cache
and recalculating the go.sum file.

See golang/go#27093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.