Skip to content

Commit

Permalink
Address the case when RUSTFLAGS environment variable is set but is …
Browse files Browse the repository at this point in the history
…empty (#1435)

Previously, an empty `RUSTFLAGS` would result in an error later on when
we invoke `rustc`.
  • Loading branch information
eeeebbbbrrrr authored Dec 16, 2023
1 parent 5ba0fab commit 9d04cea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cargo-pgrx/src/command/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,10 @@ fn create_stub(
so_rustc_invocation.stderr(Stdio::inherit());

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

so_rustc_invocation.args([
Expand Down

0 comments on commit 9d04cea

Please sign in to comment.