From 8beab6363491e2a8757cc9fc0fa1eccc98ece916 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 11 Feb 2022 11:38:10 -0300 Subject: [PATCH] fix(cli): build freezing on Windows, closes #3399 (#3402) --- .changes/fix-cli.js-windows-freezing.md | 6 ++++++ tooling/bundler/src/bundle/common.rs | 4 +++- tooling/bundler/src/bundle/windows/msi/wix.rs | 5 +---- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changes/fix-cli.js-windows-freezing.md diff --git a/.changes/fix-cli.js-windows-freezing.md b/.changes/fix-cli.js-windows-freezing.md new file mode 100644 index 000000000..bae8abcd6 --- /dev/null +++ b/.changes/fix-cli.js-windows-freezing.md @@ -0,0 +1,6 @@ +--- +"cli.rs": patch +"cli.js": patch +--- + +Fixes CLI freezing when running `light.exe` on Windows without the `--verbose` flag. diff --git a/tooling/bundler/src/bundle/common.rs b/tooling/bundler/src/bundle/common.rs index 11bc5d15d..adbb3fc0b 100644 --- a/tooling/bundler/src/bundle/common.rs +++ b/tooling/bundler/src/bundle/common.rs @@ -8,7 +8,7 @@ use std::{ fs::{self, File}, io::{self, BufWriter, Write}, path::Path, - process::Command, + process::{Command, Stdio}, }; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; @@ -198,6 +198,8 @@ pub fn print_info(message: &str) -> crate::Result<()> { pub fn execute_with_verbosity(cmd: &mut Command, settings: &Settings) -> crate::Result<()> { if settings.is_verbose() { cmd.pipe()?; + } else { + cmd.stdout(Stdio::null()).stderr(Stdio::null()); } let status = cmd.status().expect("failed to spawn command"); diff --git a/tooling/bundler/src/bundle/windows/msi/wix.rs b/tooling/bundler/src/bundle/windows/msi/wix.rs index 5aa094e0b..5b059a1b6 100644 --- a/tooling/bundler/src/bundle/windows/msi/wix.rs +++ b/tooling/bundler/src/bundle/windows/msi/wix.rs @@ -343,10 +343,7 @@ fn run_light( } let mut cmd = Command::new(&light_exe); - cmd - .args(&args) - .stdout(Stdio::piped()) - .current_dir(build_path); + cmd.args(&args).current_dir(build_path); common::execute_with_verbosity(&mut cmd, settings).map_err(|_| { crate::Error::ShellScriptError(format!(