Skip to content

Commit

Permalink
Removed spurious recompile on integration tests (#468)
Browse files Browse the repository at this point in the history
* Removed spurious recompile on integration tests

I noticed we're using different compilers to compile our wasm and native
binaries. This means they keep blowing out each others caches forcing a
recompile.

This fixes that, but only for people using nix/direnv.

* Added comments

* Removed dep

* Cargo fmt
  • Loading branch information
DavidM-D authored Feb 23, 2024
1 parent 2f337f1 commit 994a17e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion integration-tests/src/mpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,22 @@ async fn build_package(
package: &str,
target: Option<&str>,
) -> anyhow::Result<ExitStatus> {
let mut cmd = Command::new("cargo");
// Do you have direnv installed?
let has_direnv = Command::new("which")
.arg("direnv")
.output()
.await
.expect("Failed to execute which command")
.status
.success();

let mut cmd = if has_direnv {
// If so use the same compiler you always use
Command::new("direnv exec cargo")
} else {
// Otherwise give up and face the pain of constant recompilation
Command::new("cargo")
};
cmd.arg("build")
.arg("--package")
.arg(package)
Expand Down

0 comments on commit 994a17e

Please sign in to comment.