Skip to content

Commit

Permalink
fix(swarm): use host envs when compiling (#1180)
Browse files Browse the repository at this point in the history
Description
---
fix(swarm): use host envs when compiling

Motivation and Context
---
Some dependencies may require the host environment when compiling 

How Has This Been Tested?
---
Swarm compiles successfully 

What process can a PR reviewer use to test or verify this change?
---


Breaking Changes
---

- [x] None
- [ ] Requires data directory to be deleted
- [ ] Other - Please specify
  • Loading branch information
sdbondi authored Oct 18, 2024
1 parent 23e4dba commit 39c638b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion applications/tari_swarm_daemon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fn get_base_config(cli: &Cli) -> anyhow::Result<Config> {
})
.unwrap_or_else(|| std::env::current_dir().unwrap().join("data").join("swarm"));

fs::create_dir_all(&base_dir)?;
std::fs::create_dir_all(&base_dir)?;

Ok(Config {
skip_registration: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: BSD-3-Clause

use std::{
env,
io,
path::{Path, PathBuf},
};
Expand Down Expand Up @@ -169,6 +170,8 @@ impl ExecutableManager {
fn cargo_build<P: AsRef<Path>>(working_dir: P, package: &str) -> io::Result<Child> {
Command::new("cargo")
.args(["build", "--release", "--bin", package])
// Ensure host environment vars are available
.envs(env::vars())
.current_dir(working_dir)
.kill_on_drop(true)
.spawn()
Expand Down

0 comments on commit 39c638b

Please sign in to comment.