Skip to content

Commit

Permalink
Handle RUSTFLAGS better (#1441)
Browse files Browse the repository at this point in the history
This cleans up PR #1435 as per (#1435 (comment)).

What we probably really want is a legit "RUSTFLAGS" parser. I don't feel
like writing and testing one and a quick search didn't find anything on
crates.io. So splitting on whitespace will have to be Good Enough.
  • Loading branch information
eeeebbbbrrrr committed Dec 18, 2023
1 parent fc20994 commit f6c032e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cargo-pgrx/src/command/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ fn create_stub(
so_rustc_invocation.stderr(Stdio::inherit());

if let Ok(rustc_flags_str) = std::env::var("RUSTFLAGS") {
if !rustc_flags_str.trim().is_empty() {
let rustc_flags = rustc_flags_str.split(' ').collect::<Vec<_>>();
let rustc_flags = rustc_flags_str.split_whitespace().collect::<Vec<_>>();
if !rustc_flags.is_empty() {
so_rustc_invocation.args(rustc_flags);
}
}
Expand Down

0 comments on commit f6c032e

Please sign in to comment.