Skip to content

Commit 36b9429

Browse files
committed
feat(cli): allow RUSTFLAGS in build command (#1610)
necessary as temporary workaround for supporting custom getrandom_backend: https://docs.rs/getrandom/latest/getrandom/#custom-backend
1 parent a72eb13 commit 36b9429

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/cli/src/commands/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::{
2+
env::var,
23
fs::{create_dir_all, read, write},
34
path::PathBuf,
45
sync::Arc,
@@ -128,7 +129,8 @@ pub(crate) fn build(build_args: &BuildArgs) -> Result<Option<PathBuf>> {
128129
};
129130
let mut guest_options = GuestOptions::default()
130131
.with_features(build_args.features.clone())
131-
.with_profile(build_args.profile.clone());
132+
.with_profile(build_args.profile.clone())
133+
.with_rustc_flags(var("RUSTFLAGS").unwrap_or_default().split_whitespace());
132134
guest_options.target_dir = build_args.target_dir.clone();
133135
if build_args.offline {
134136
guest_options.options = vec!["--offline".to_string()];

0 commit comments

Comments
 (0)