rust-cross / cargo-zigbuild

Compile Cargo project with zig as linker
MIT License
1.35k stars 50 forks source link

Command to create all temporary files needed? #258

Closed NobodyXu closed 1 week ago

NobodyXu commented 2 weeks ago

Hello I'm working on sandboxing package building using cargo-zigbuild in cargo-bins/cargo-quickinstall#252 , with a read-only container where anywhere other than /tmp or /var/tmp is read-only.

However it turns out that zig creates some files in its installation directory /lib/libc/sysdep/arm for arm targets, and I think cargo-zigbuild also creates some temporary files.

For the safety concern, I'd like them to be created at the image build stage and mounted as immutable.

Is it possible to have a command that does it?

Thank you so much!

messense commented 1 week ago

However it turns out that zig creates some files in its installation directory /lib/libc/sysdep/arm for arm targets

See https://github.com/rust-cross/cargo-zigbuild/commit/fa7908f9bb535128bf5b03fc1ddd12b9b7b3ee9e

I don't think we need to provide such functionality in cargo-zigbuild, you can already use XDG_CACHE_HOME to override cache dirs that cargo-zigbuild uses.

NobodyXu commented 1 week ago

Thanks!