about summary refs log tree commit diff
path: root/tvix/cli/src
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-01-26T10·17+0300
committertazjin <tazjin@tvl.su>2023-01-26T10·29+0000
commit2e66f7da9241a4245969321281a38f325891eefc (patch)
tree78e476d9b408ff2d4f87b0716a8ccce9e9c0d95c /tvix/cli/src
parentdaa3721f73265fd28cd39a88d64876c910e58df0 (diff)
fix(tvix/cli): correctly trim cppnix output in NixCompatIO r/5760
We only stripped one of the two uses of this string, leading to
extraneous newlines in the refscanner.

Change-Id: I25d9119be082c487352f0cf66b97ecdcc3e1de06
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7932
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/cli/src')
-rw-r--r--tvix/cli/src/nix_compat.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/tvix/cli/src/nix_compat.rs b/tvix/cli/src/nix_compat.rs
index c3b28c53f6c8..b20953f2b002 100644
--- a/tvix/cli/src/nix_compat.rs
+++ b/tvix/cli/src/nix_compat.rs
@@ -78,17 +78,18 @@ impl NixCompatIO {
         if !out.status.success() {
             return Err(io::Error::new(
                 io::ErrorKind::Other,
-                String::from_utf8_lossy(&out.stderr),
+                String::from_utf8_lossy(&out.stderr).trim().to_owned(),
             ));
         }
 
         let out_path_str = String::from_utf8(out.stdout)
             .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
+        let out_path_trimmed = out_path_str.trim();
 
-        self.known_paths.borrow_mut().plain(&out_path_str);
+        self.known_paths.borrow_mut().plain(out_path_trimmed);
 
         let mut out_path = PathBuf::new();
-        out_path.push(out_path_str.trim());
+        out_path.push(out_path_trimmed);
         Ok(out_path)
     }
 }