-
Notifications
You must be signed in to change notification settings - Fork 135
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
Fix for package managers storing files in read-only #1314
Conversation
Thank! Maybe there is some other way (more python'ish) way of doing things instead of just |
Sure! I did this as a quick fix, working, but dirty ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asl double check please
@bzizou Will you please check if the updated patch resolves downstream issue? |
checking right now... |
I had to squash the commits, to be able to get a single patch for downstream. Now, testing the package with this... |
That's ok! |
update write permissions via in-built python functions fix: do not give exec permissions fix whatever typo is was
This is a quick fix coming from a hack I had to do for the packaging of Spades 4.0.0 into NixOS :
The proposed patch is currently into the proposed update for the Nix Spades package, but it would be great if the fix is done upstream. The problem is that once installed, a Nix package has all the files with no write permission at all (files coming from packages are stored into a read-only directory). The Spades pipeline copies some data files to an output directory, but keeps the modes, even if the
preserve_mode
argument is set tofalse
because it uses theshutil.copytree()
function that implies ashutil.copystat()
that can not be disabled (see https://github.com/python/cpython/blob/4bf17c381fb7b465f0f26aecb94a6c54cf9be2d3/Doc/library/shutil.rst?plain=1#L237). So the copied files are read-only and the test pipeline fails.Giving the write access to the owner is enough to solve the issue.
Co-authored by: Andrey Prjibelski [email protected]