From 5ba5af624dd51bab93b30e3c231c073f437fd16a Mon Sep 17 00:00:00 2001 From: Paul d'Aoust Date: Tue, 11 Feb 2020 21:07:19 -0800 Subject: [PATCH 1/2] don't run .bashrc for any commands fed from .hcbuild --- crates/cli/src/util.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/cli/src/util.rs b/crates/cli/src/util.rs index 44913e49ba..db55a0a8e6 100644 --- a/crates/cli/src/util.rs +++ b/crates/cli/src/util.rs @@ -47,12 +47,17 @@ pub fn run_cmd(base_path: &PathBuf, bin: String, args: &[&str]) -> DefaultResult // e.g. we assume `cargo`, `wasm-gc`, `wasm-opt`, `wasm2wat`, `wat2wasm` all exist in the // default template (which we can't assume outside nix-shell in a portable way). // + // Note the use of --norc. This is to prevent the shell from loading up its usual startup + // script, which may echo things to STDOUT. The reason this matters is that some of the + // commands in a .hcbuild file (which are fed to this function) capture from STDOUT and do + // something meaningful with the value. Do we really want a MOTD in our build artifact path? + // // @TODO - does it make more sense to push "execute arbitrary bash" style features down to the // `nix-shell` layer where we have a better toolkit to handle environments/dependencies? // e.g. @see `hn-release-cut` from holonix that implements conventions/hooks to standardise // bash processes in an extensible way let status = Command::new("bash") - .args(&["-c", &command_string]) + .args(&["--norc", "-c", &command_string]) .current_dir(base_path) .status()?; From 6f1ed7a5972f0978d01d7e02bc32121c89f479fd Mon Sep 17 00:00:00 2001 From: Paul d'Aoust Date: Tue, 11 Feb 2020 21:23:05 -0800 Subject: [PATCH 2/2] added fix for #2097 to changelog --- CHANGELOG-UNRELEASED.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG-UNRELEASED.md b/CHANGELOG-UNRELEASED.md index 2f730af61f..2efb290200 100644 --- a/CHANGELOG-UNRELEASED.md +++ b/CHANGELOG-UNRELEASED.md @@ -14,5 +14,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Fixed +- `.bashrc` files that echo to STDOUT should no longer cause `hc package` to fail. [PR#2108](https://github.com/holochain/holochain-rust/pull/2108) + ### Security