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

Comments

Projects
None yet
4 participants
@zx2c4
Copy link
Contributor

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

@magical

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2018

Does go clean -modcache do what you want?

@zx2c4

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Oct 11, 2018

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.

@agnivade agnivade closed this Oct 11, 2018

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.