I ran into an issue with my current build setup that took me a while to realize. I have a Rust project that builds an FFI library. I’m using the build system to build the Rust project with Cargo via addSystemCommand
, and also build example projects (I have C and Zig examples).
Long story short (I lost almost 2 whole days to this), I have to run zig build
twice – the first time to build the Rust project, and the second time to actually copy the Rust artifact to the install dir (zig-out
). For some reason, the first zig build
caches the addInstallLibFile
step, but the subsequent zig build
misses the cache and installs the file.
I have a minimum working example here (note: linux only): https://github.com/weskoerber/zig-build-repro
How can I prevent the caching of the file?