Skip to content

Commit

Permalink
revert implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifropc committed Dec 9, 2024
1 parent 7a2b31d commit 288ac83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/crates/soroban-test/tests/it/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn with_flags(expected: &str) -> String {
.split("\n")
.map(|x| {
format!(
"CARGO_BUILD_RUSTFLAGS='--remap-path-prefix {}=' {}",
"CARGO_BUILD_RUSTFLAGS=--remap-path-prefix={}= {}",
registry_prefix, x
)
})
Expand Down
9 changes: 3 additions & 6 deletions cmd/soroban-cli/src/commands/contract/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,8 @@ impl Cmd {
/// debugging is expected to be minimal.
///
/// This works by setting the `CARGO_BUILD_RUSTFLAGS` environment variable,
/// with an appropriate
/// [`--remap-path-prefix`](https://doc.rust-lang.org/rustc/command-line-arguments.html#--remap-path-prefix-remap-source-names-in-output)
/// option. It preserves the values of an existing `CARGO_BUILD_RUSTFLAGS` environment variable.
/// with appropriate `--remap-path-prefix` option. It preserves the values of an
/// existing `CARGO_BUILD_RUSTFLAGS` environment variable.
///
/// This must be done some via some variation of `RUSTFLAGS` and not as
/// arguments to `cargo rustc` because the latter only applies to the crate
Expand Down Expand Up @@ -379,11 +378,9 @@ fn make_rustflags_to_remap_absolute_paths(print: &Print) -> Result<Option<String
}

let registry_prefix = format!("{cargo_home}/registry/src/");
let new_rustflag = format!("{registry_prefix}=");
let new_rustflag = format!("--remap-path-prefix={registry_prefix}=");

let mut rustflags = get_rustflags().unwrap_or_default();
// --remap-path-prefix is separated by space with the arguments
rustflags.push("--remap-path-prefix".to_string());
rustflags.push(new_rustflag);

let rustflags = rustflags.join(" ");
Expand Down

0 comments on commit 288ac83

Please sign in to comment.