Skip to content

Commit

Permalink
Fixed escaped ascii value
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Mar 4, 2022
1 parent de0f357 commit 9d56b7b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cargo/cargo_build_script_runner/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ fn run_buildrs() -> Result<(), String> {
}
}

// Bazel does not support byte strings so in order to correctly represent `CARGO_ENCODED_RUSTFLAGS`
// the escaped `\x1f` sequences need to be unescaped
if let Ok(encoded_rustflags) = env::var("CARGO_ENCODED_RUSTFLAGS") {
command.env("CARGO_ENCODED_RUSTFLAGS", encoded_rustflags.replace("\\x1f", "\x1f"));
}

if let Some(ar_path) = env::var_os("AR") {
// The default OSX toolchain uses libtool as ar_executable not ar.
// This doesn't work when used as $AR, so simply don't set it - tools will probably fall back to
Expand Down

0 comments on commit 9d56b7b

Please sign in to comment.