-
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: mod vendor does not preserve execute permission for scripts #34965
Comments
This issue is probably the same root cause as reported in #31481 (comment), but (per #31481 (comment)) let's keep this issue open to track that particular detail. |
We defined the Go module representation to be absolutely least common denominator across systems for portability. The Go module zip file is for dependencies that need to be downloaded and built by the go command. It is not meant to support anything more. By design, there are no permission bits, nor special files like symlinks, nor modification times. I still believe this is the right decision. We can go arbitrarily far in "preserving" file metadata, and the result would still miss some kinds of metadata and fail to recreate other metadata on some subset of systems (symlinks, odd file modification times, etc). Tests that need special files (anything beyond files containing bytes) can write them to a temporary directory and configure them as they wish. Install scripts can be invoked as I don't believe this decision was wrong. But even if it were, it is a fundamental design decision made years ago that would be very hard to change now - it would invalidate all the checksums (if this extra information is important enough to preserve it would have to be checksummed too). It would have to be very wrong to be worth the pain of correcting. |
Closing this as working as intended. Thanks for clarifying! |
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?
main.go
tools.go
go.mod
run
What did you expect to see?
the file permissions of
generate-groups.sh
to be kept the same as the original file.$ # original repo in the same tag v1.16.2 $ ls -la k8s.io/kubernetesstaging/src/k8s.io/code-generator/generate-groups.sh -rwx------. 1 aanm aanm 3837 Apr 25 12:25 staging/src/k8s.io/code-generator/generate-groups.sh
What did you see instead?
The text was updated successfully, but these errors were encountered: