Closed fracek closed 1 year ago
@fracek Perhaps I'm misunderstanding the description, but how exactly would this work in the first place on a read-only file system? After all, you wouldn't be able to copy the files around in the first place.
@yorickpeterse In my case I'm copying from a read-only filesystem to a normal filesystem. I'm using the library in a Rust project and building it with nix, so all dependencies (including libffi
) are stored in a read-only filesystem for caching. Before build, they're copied over to the working directory (which is in a normal filesystem). Without this patch, all files retain their read-only attributes and so the build fails. With this patch, the attributes are removed and the build works.
@fracek Ah that clears things up, thanks!
I see the build is failing on MacOS because it doesn't have the --no-preserve
flag. I can fix it, but I want to hear what's your prefered solution:
@fracek Doing this in pure Rust is fine :smiley:
I didn't realize libffi was a directory. I changed it to conditionally add the necessary flags on linux.
@yorickpeterse I updated to check the output of cp --help
to see if the flag exists.
@fracek Thanks!
By default, copying a file will preserve its mode and ownership attributes. This is an issue when copying
libffi
from a read-only filesystem since the configuration log file also becomes read-only, causing a build failure.