-
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: modules generates read-only files #33516
Comments
Well... this is not something I can not over come. I wanted to report this as possible improvement that you would not create files in read only mode (not sure how this helps anyone). Of course I can do go clean -modcache as I can do chmod a+w -R $GOPATH. The thing is I don't want to do any additional commands. |
Please see #27161 (comment) as a reason for this. A general improvement to this is tracked at #31481. It seems like you need this in your CI. Does #31481 suffice your usecase ? |
Well if you care about me/or people that actually use your app then no it doesnt suffice. Nor i dont believe in some corner case why making files readonly. Non major language does it and in golang you say its the best option and that its intended. If you want this thing to be not only working but also user friendly (assembler also work) then you shoul reconsider previous intentions and wonder if they are valid or if it can be done without sacraficing UX |
Duplicate of #31481 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This is the newest version stable
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
When using go modules (go build, go install whatever) all files are downloaded into GOPATH. Problem is that these files are created with read-only mode. This makes quite complications for example on jenkins pipeline, where I build a single job (some go module), pull things from git, builds, makes services, deploy, etc...
At the end of job I want to remove the workspace (or jenkins does). It has problems because the files are created in readonly mode. I cannot use some global path for GOPATH because in jenkins jobs my organization gives me access only to some sandbox (some folder), and I can't move anywhere else.
What did you expect to see?
I would expect that these files are not created in read only mode, or that I have an ability to disable this feature.
What did you see instead?
I couldn't remove the files with rm-rf, nor could the jenkins
I overcome this issue by invoking chmod a+w -R $GOPATH after invoking all go installs go builds etc... but it's complicated if the commands fail suddenly I have to make bash script traps to do this.
The text was updated successfully, but these errors were encountered: