Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use separate 'target-dir' for 'infra_cli' (NomicFoundation#741)
Rust Analyzer runs `cargo check` frequently (on every file save) on the whole workspace. This locks `$REPO_ROOT/target` directory, and prevents building/running any other `infra` commands until it is done. To avoid this during local development, let`s use a separate target directory for this binary. Additionally, we cannot use `cargo run --bin infra_cli` directly, because `cargo run` sets a bunch of `CARGO_*` environment variables, and they get propagated to any child `cargo` commands that are spawned by `infra_cli`. We have to build and run the binary directly to ensure it has a clean env. Otherwise, they leak into things like cross-platform NAPI builds, and cause build failures.
- Loading branch information