Skip to content

Commit

Permalink
fix: remove CARGO_ENCODED_RUSTFLAGS for easier nested builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Jan 10, 2025
1 parent dfa5ca5 commit 57c58ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cargo-near-build/src/cargo_native/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ where
let cargo = std::env::var("CARGO").unwrap_or_else(|_| "cargo".to_string());
let mut cmd = Command::new(cargo);

// removing env, which may be implicitly passed when bulding from within a build-script
// see https://github.com/near/cargo-near/issues/287
// CARGO_ENCODED_RUSTFLAGS="-Awarnings" and RUSTFLAGS="-Awarnings" both result
// in mysterious failures of `cargo build --target wasm32-unknown-unknown` (rustc bug)
cmd.env_remove("CARGO_ENCODED_RUSTFLAGS");
cmd.envs(env);

if let Some(path) = working_dir {
Expand Down

0 comments on commit 57c58ec

Please sign in to comment.