Skip to content

Commit f0d0f2f

Browse files
tkintscherThomas Kintscher
and
Thomas Kintscher
authored
Append to existing RUSTFLAGS, instead of overwriting. (#1582)
* Append to existing RUSTFLAGS, instead of overwriting. * Assemble RUSTFLAGS correctly. Co-authored-by: Thomas Kintscher <[email protected]>
1 parent ce572bc commit f0d0f2f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sqlx-cli/src/prepare.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ hint: This command only works in the manifest directory of a Cargo package."#
115115
bail!("`cargo clean` failed with status: {}", check_status);
116116
}
117117

118+
let mut rustflags = env::var("RUSTFLAGS").unwrap_or_default();
119+
rustflags.push_str(&format!(
120+
" --cfg __sqlx_recompile_trigger=\"{}\"",
121+
SystemTime::UNIX_EPOCH.elapsed()?.as_millis()
122+
));
123+
118124
Command::new(&cargo)
119125
.arg("check")
120126
.args(cargo_args)
121-
.env(
122-
"RUSTFLAGS",
123-
format!(
124-
"--cfg __sqlx_recompile_trigger=\"{}\"",
125-
SystemTime::UNIX_EPOCH.elapsed()?.as_millis()
126-
),
127-
)
127+
.env("RUSTFLAGS", rustflags)
128128
.env("SQLX_OFFLINE", "false")
129129
.status()?
130130
} else {

0 commit comments

Comments
 (0)