Skip to content

Commit

Permalink
fix(cli): added missing RUSTFLAGS
Browse files Browse the repository at this point in the history
This *should* address #249.
  • Loading branch information
arctic-hen7 committed Jan 2, 2023
1 parent 51a0f2b commit 0735b8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/perseus-cli/src/export_error_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub fn export_error_page(
vec![
("PERSEUS_ENGINE_OPERATION", "export_error_page"),
("CARGO_TARGET_DIR", "dist/target_engine"),
("RUSTFLAGS", "--cfg=engine"),
],
|| {},
)?;
Expand Down
7 changes: 5 additions & 2 deletions packages/perseus-cli/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,14 @@ impl Tools {
let lf_msg = format!("{} Generating Cargo lockfile", GENERATING_LOCKFILE);
let lf_spinner = cfg_spinner(ProgressBar::new_spinner(), &lf_msg);
let (_stdout, _stderr, exit_code) = run_stage(
vec!["cargo generate-lockfile"],
vec![&format!(
"{} generate-lockfile",
global_opts.cargo_engine_path
)],
&workspace_root,
&lf_spinner,
&lf_msg,
Vec::new(),
vec![("RUSTFLAGS", "--cfg=engine")],
)
.map_err(|err| InstallError::LockfileGenerationFailed { source: err })?;
if exit_code != 0 {
Expand Down
7 changes: 6 additions & 1 deletion packages/perseus-cli/src/snoop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub fn snoop_build(dir: PathBuf, tools: &Tools, global_opts: &Opts) -> Result<i3
vec![
("PERSEUS_ENGINE_OPERATION", "build"),
("CARGO_TARGET_DIR", "dist/target_engine"),
("RUSTFLAGS", "--cfg=engine"),
],
)
}
Expand All @@ -38,7 +39,10 @@ pub fn snoop_wasm_build(
tools.cargo_browser, global_opts.cargo_browser_args
),
&dir,
vec![("CARGO_TARGET_DIR", "dist/target_wasm")],
vec![
("CARGO_TARGET_DIR", "dist/target_wasm"),
("RUSTFLAGS", "--cfg=client"),
],
)?;
if exit_code != 0 {
return Ok(exit_code);
Expand Down Expand Up @@ -74,6 +78,7 @@ pub fn snoop_server(
("CARGO_TARGET_DIR", "dist/target_engine"),
("PERSEUS_HOST", &opts.host),
("PERSEUS_PORT", &opts.port.to_string()),
("RUSTFLAGS", "--cfg=engine"),
], /* Unlike the `serve` command, we're both
* building and running here, so we provide
* the operation */
Expand Down

0 comments on commit 0735b8c

Please sign in to comment.