CARGO_TARGET_DIR set, nikaia build leaves no target/nikaia/bin/<name>Open and answer this issue on GitHub.
compiler, ready · opened 2026-10-19 · updated 2026-10-29 · 1 comment
Found while writing the 1BRC measurement harness in Nikaia. To keep builds apart, the harness set CARGO_TARGET_DIR per program.
In a project, nikaia build normally leaves the program at target/nikaia/bin/<name>. With CARGO_TARGET_DIR=/some/dir in the environment, nothing appears there. The binary exists only inside /some/dir (release/ or debug/, depending on the generated profile), so a script that runs target/nikaia/bin/<name> either finds nothing or runs a stale binary from an earlier build.
nikaia build copies the program from wherever cargo put it. It reads the effective target directory (CARGO_TARGET_DIR, or cargo metadata’s target_directory) instead of assuming the project’s own.crates/nikaia/tests/project.rs): a project built with CARGO_TARGET_DIR pointing at a scratch directory has target/nikaia/bin/<name>, and it runs.Triage (#982), class B: waits for P5c. drive_to in project.rs decides when own_copy runs (2544). Still reproduces at de0bb82.
Generated by Claude Code