From f429d333618e5e4079d07b14958395aca8970b49 Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 10 Jul 2024 19:28:00 +0200 Subject: [PATCH] Print stderr always Signed-off-by: Danil --- .github/workflows/ci-zk-toolbox-reusable.yml | 5 +++++ zk_toolbox/crates/common/src/cmd.rs | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-zk-toolbox-reusable.yml b/.github/workflows/ci-zk-toolbox-reusable.yml index 102c3d56c331..7ff5eb3f1cf4 100644 --- a/.github/workflows/ci-zk-toolbox-reusable.yml +++ b/.github/workflows/ci-zk-toolbox-reusable.yml @@ -73,6 +73,7 @@ jobs: echo $(pwd)/bin >> $GITHUB_PATH echo IN_DOCKER=1 >> .env + - name: Start services run: | ci_localnet_up @@ -80,6 +81,10 @@ jobs: - name: Initialize ecosystem run: | + ci_run git config --global --add safe.directory /usr/src/zksync + ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts + ci_run git config --global --add safe.directory /usr/src/zksync/contracts + ci_run zk_inception ecosystem init --deploy-paymaster --deploy-erc20 \ --deploy-ecosystem --l1-rpc-url=http://reth:8545 \ --server-db-url=postgres://postgres:notsecurepassword@postgres:5432 \ diff --git a/zk_toolbox/crates/common/src/cmd.rs b/zk_toolbox/crates/common/src/cmd.rs index 128196b8a9d7..ca0f285882a3 100644 --- a/zk_toolbox/crates/common/src/cmd.rs +++ b/zk_toolbox/crates/common/src/cmd.rs @@ -93,7 +93,13 @@ impl<'a> Cmd<'a> { let output = if global_config().verbose || self.force_run { logger::debug(format!("Running: {}", self.inner)); logger::new_empty_line(); - run_low_level_process_command(self.inner.into())? + let output = run_low_level_process_command(self.inner.into())?; + if let Ok(data) = String::from_utf8(output.stderr.clone()) { + if !data.is_empty() { + logger::info(data) + } + } + output } else { // Command will be logged manually. self.inner.set_quiet(true); @@ -148,7 +154,7 @@ fn check_output_status(command_text: &str, output: &std::process::Output) -> Cmd fn run_low_level_process_command(mut command: Command) -> io::Result { command.stdout(Stdio::inherit()); - command.stderr(Stdio::inherit()); + command.stderr(Stdio::piped()); let child = command.spawn()?; child.wait_with_output() }