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: module 0400 permissions are annoying #28137

Closed
zx2c4 opened this issue Oct 10, 2018 · 3 comments
Closed

cmd/go: module 0400 permissions are annoying #28137

zx2c4 opened this issue Oct 10, 2018 · 3 comments
Labels
FrozenDueToAge modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.

Comments

@zx2c4
Copy link
Contributor

zx2c4 commented Oct 10, 2018

I use go build as part of larger build systems, such as gradle, xcodeproj, and cmake. In these cases, I'm generally putting various artifacts into a predefined build directory that I don't control. I'm only allowed to write files there, and so that's where they go. So, for example, downloaded go modules go into this intermediate/temporary build structure.

When it's time for the parent build system to clean up its various temporary or intermediate directories, it of course chokes when hitting the 0400 directories. It's not very pleasant or clean (in error paths) to have to unconditionally run chmod -fR +w .../pkg/mod everytime that either go build or go get is called.

Rather, would you consider adding an option to these tools or perhaps even an environment variable that doesn't chmod anything and just uses the ordinary boring file permissions?

@ALTree ALTree changed the title module 0400 permissions are annoying cmd/go: module 0400 permissions are annoying Oct 10, 2018
@ALTree ALTree added modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Oct 10, 2018
@magical
Copy link
Contributor

magical commented Oct 10, 2018

Does go clean -modcache do what you want?

@zx2c4
Copy link
Contributor Author

zx2c4 commented Oct 11, 2018

Probably, but that misses the point: most of the time I don't really have control over how temporary/intermediate build tree is cleaned up. A parent build system is responsible for that. Here's another example: imagine a Jenkins setup where I don't have any place to persist files in between builds and where the whole tree is supposed to be trivially clearable after builds. Again in this case, the 0400 permissions go sets are super annoying. Hence, a desire for some means of suppressing this.

@agnivade
Copy link
Contributor

This was intentional. See @rsc's comment here - #27455 (comment).

There is a duplicate bug which tracks slight improvements on this #27161. Feel free to add your suggestions there.

@golang golang locked and limited conversation to collaborators Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

5 participants