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

Fix for package managers storing files in read-only #1314

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

bzizou
Copy link
Contributor

@bzizou bzizou commented Jun 17, 2024

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 to false because it uses the shutil.copytree() function that implies a shutil.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]

@asl asl requested a review from andrewprzh June 17, 2024 17:27
@asl
Copy link
Member

asl commented Jun 17, 2024

Thank! Maybe there is some other way (more python'ish) way of doing things instead of just os.system? @andrewprzh Will you please take a look?

@bzizou bzizou mentioned this pull request Jun 18, 2024
13 tasks
@bzizou
Copy link
Contributor Author

bzizou commented Jun 18, 2024

Thank! Maybe there is some other way (more python'ish) way of doing things instead of just os.system?

Sure! I did this as a quick fix, working, but dirty ;-)

Copy link
Collaborator

@andrewprzh andrewprzh left a 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

@asl
Copy link
Member

asl commented Jun 20, 2024

@bzizou Will you please check if the updated patch resolves downstream issue?

@bzizou
Copy link
Contributor Author

bzizou commented Jul 1, 2024

@bzizou Will you please check if the updated patch resolves downstream issue?

checking right now...

@bzizou
Copy link
Contributor Author

bzizou commented Jul 1, 2024

I had to squash the commits, to be able to get a single patch for downstream. Now, testing the package with this...

@bzizou
Copy link
Contributor Author

bzizou commented Jul 1, 2024

That's ok!
Patch resulting from this PR applied to the package (https://github.com/NixOS/nixpkgs/compare/c27bbb2094c2f855092cc8cf96b7045f8a8a8337..ea7dabc17148dd26457ce4986b0cad405844ede3)
Tests are passing!

update write permissions via in-built python functions

fix: do not give exec permissions

fix whatever typo is was
@asl asl merged commit 88d619c into ablab:next Jul 2, 2024
92 checks passed
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

Successfully merging this pull request may close these issues.

3 participants