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

./xbps-src zap permission error after compiling with golang #34505

Closed
b-l-a-i-n-e opened this issue Dec 13, 2021 · 4 comments
Closed

./xbps-src zap permission error after compiling with golang #34505

b-l-a-i-n-e opened this issue Dec 13, 2021 · 4 comments

Comments

@b-l-a-i-n-e
Copy link
Contributor

After compiling a program with golang, a masterdir/tmp/go directory is created with files in it that can only only be removed as root.

./xpbs-src zap then complains about permissions like below

rm: cannot remove '/home/b/void-packages/masterdir/tmp/go/pkg/mod/golang.org/x/net@v0.0.0-20190328230028-74de082e2cca/dns/dnsmessage/example_test.go': Permission denied
rm: cannot remove '/home/b/void-packages/masterdir/tmp/go/pkg/mod/golang.org/x/net@v0.0.0-20190328230028-74de082e2cca/dns/dnsmessage/message_test.go': Permission denied
rm: cannot remove '/home/b/void-packages/masterdir/tmp/go/pkg/mod/golang.org/x/net@v0.0.0-20190328230028-74de082e2cca/dns/dnsmessage/message.go': Permission denied
rm: cannot remove '/home/b/void-packages/masterdir/tmp/go/pkg/mod/golang.org/x/net@v0.0.0-20190328230028-74de082e2cca/PATENTS': Permission denied
@b-l-a-i-n-e
Copy link
Contributor Author

sudo rm -rf masterdir/tmp fixes it, but to avoid sudo permissions we may need to do something like

chmod -R 777 masterdir/tmp in the zap command

@b-l-a-i-n-e
Copy link
Contributor Author

Potential fix here:
#34506

@paper42
Copy link
Member

paper42 commented Dec 13, 2021

That is a solution, but a much cleaner approach would be to add -modcacherw to the go build style to make the files writeable

@b-l-a-i-n-e
Copy link
Contributor Author

@paper42 do you mean adding the GOFLAGS check in the actual build_style (common/build-style/go.sh) or adding the flag to the specific package that was causing the issue?

For my particular issue I was not using the go build-style because the package I want to install is not in the normal go package format, I need to run a script to start the go compilation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants