-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Ensure files are writable after copy to chroot. #2202
Conversation
Seems to fix the issue described in NixOS/nixpkgs#246448 (comment)
I can confirm this solves running |
Thanks for taking a crack at this @phaer. Clearly this must do the trick but I want to dig a bit to see what is really going on. After all:
So the issue can't be that the source files are read only, it must be that the destination file already exists and is read only; i.e. Pex is performing the copy operation for a given target file more than once IIUC and the second+ copy fails. Pex operations should generally be atomic and non-dup - even in the face of multiprocess parallelism; so this is concerning if I have this assesment about right. I'll investigate a bit and report back. |
Yeah, this is a dup copy:
So a better fix is to fix that. Pex should not be over-writing files willy-nilly. In other places it actually checks that a file hash matches before overwriting or else warns or errors depending on settings. Behaving like that here would be good, but even better, since this is Pex's own files its dealing with here, just avoiding the dup is proably the way to go. I'll spin a it more and see what I can come up with and report back. |
Ok, bug tracked here: #2203 |
@phaer I've put up an alternate approach here: #2205 |
@jsirois Thanks for checking and the quick patch! Can confirm that it works with nix :) Definitely the better fix, glad your fix uncovered a deeper issue. Nitpick regarding the "cp" test: I think that's not entirely accurate as |
@phaer excellent. On the nit, I'm a bit confused. Modern |
@jsirois You are right, I misread - sorry for the noise. I also overlooked that the files don't need to be writable at all as long as there's no duplicate copy, just saw that your new tests cover that - perfect :) |
Bootstrapping vendored dependencies seems to require files copied into the chroot to be writable, that however seems only to be true if the src directory is writable as well.
So this change intends to ensure files copied to the chroot are always writable by the owner, while leaving other permissions intact.
It seems to fix the issue described in NixOS/nixpkgs#246448 (comment)
What do you think, @jsirois?