Fix for package managers storing files in read-only #1314
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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]