From 49b69469e3cf0896230cb514e43cce02bed467bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 4 Aug 2021 14:21:40 -0400 Subject: [PATCH 01/27] [BROKEN] Add memory test for not consuming stdout --- .gitignore | 4 +-- justfile | 5 +++- memory-test/Cargo.lock | 30 +++++++++++++++++++ memory-test/Cargo.toml | 8 +++++ memory-test/src/bin/cradle_user.rs | 8 +++++ memory-test/src/bin/produce_bytes.rs | 13 ++++++++ memory-test/src/bin/run_test.rs | 44 ++++++++++++++++++++++++++++ 7 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 memory-test/Cargo.lock create mode 100644 memory-test/Cargo.toml create mode 100644 memory-test/src/bin/cradle_user.rs create mode 100644 memory-test/src/bin/produce_bytes.rs create mode 100644 memory-test/src/bin/run_test.rs diff --git a/.gitignore b/.gitignore index ca98cd96..3b37adf0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/target/ -Cargo.lock +target/ +/Cargo.lock diff --git a/justfile b/justfile index 0db31358..3129e0de 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -ci: test build doc clippy fmt context-integration-tests run-examples forbidden-words render-readme-check +ci: test build doc clippy fmt context-integration-tests memory-test run-examples forbidden-words render-readme-check build: cargo build --all-targets --all-features @@ -21,6 +21,9 @@ clippy: fmt: cargo fmt --all -- --check +memory-test: + cd memory-test; cargo run --bin run_test + run-examples: cargo run --example readme diff --git a/memory-test/Cargo.lock b/memory-test/Cargo.lock new file mode 100644 index 00000000..b8f37128 --- /dev/null +++ b/memory-test/Cargo.lock @@ -0,0 +1,30 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anyhow" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486" + +[[package]] +name = "cradle" +version = "0.0.17" +dependencies = [ + "rustversion", +] + +[[package]] +name = "memory-test" +version = "0.1.0" +dependencies = [ + "anyhow", + "cradle", +] + +[[package]] +name = "rustversion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" diff --git a/memory-test/Cargo.toml b/memory-test/Cargo.toml new file mode 100644 index 00000000..563aacb5 --- /dev/null +++ b/memory-test/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "memory-test" +version = "0.1.0" +edition = "2018" + +[dependencies] +anyhow = "1.0.42" +cradle = { path = ".." } diff --git a/memory-test/src/bin/cradle_user.rs b/memory-test/src/bin/cradle_user.rs new file mode 100644 index 00000000..d16d6a9e --- /dev/null +++ b/memory-test/src/bin/cradle_user.rs @@ -0,0 +1,8 @@ +use cradle::prelude::*; + +fn main() { + let args = std::env::args(); + let bytes: usize = args.skip(1).next().unwrap().parse().unwrap(); + eprintln!("consuming {} kB", bytes / 2_usize.pow(10)); + cmd_unit!("./target/release/produce_bytes", bytes.to_string()); +} diff --git a/memory-test/src/bin/produce_bytes.rs b/memory-test/src/bin/produce_bytes.rs new file mode 100644 index 00000000..e3727c35 --- /dev/null +++ b/memory-test/src/bin/produce_bytes.rs @@ -0,0 +1,13 @@ +use anyhow::Result; +use std::io::{stdout, Write}; + +fn main() -> Result<()> { + let args = std::env::args(); + let bytes: usize = args.skip(1).next().unwrap().parse()?; + eprintln!("producing {} kB", bytes / 2_usize.pow(10)); + let bytes = vec![b'x'; bytes]; + let mut stdout = stdout(); + stdout.write_all(&bytes)?; + stdout.flush()?; + Ok(()) +} diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs new file mode 100644 index 00000000..ad0a8159 --- /dev/null +++ b/memory-test/src/bin/run_test.rs @@ -0,0 +1,44 @@ +use anyhow::Result; +use cradle::prelude::*; +use std::process::{Command, Stdio}; + +fn from_mb(mega_bytes: usize) -> usize { + mega_bytes * 2_usize.pow(20) +} + +fn main() -> Result<()> { + Split("cargo build --release").run_unit(); + let bytes = from_mb(64); + let memory_consumption = measure_memory_consumption(bytes)?; + let allowed_memory_consumption = from_mb(16); + assert!( + memory_consumption < allowed_memory_consumption, + "Maximum resident set size: {}, allowed upper limit: {}", + memory_consumption, + allowed_memory_consumption + ); + Ok(()) +} + +fn measure_memory_consumption(bytes: usize) -> Result { + let output = Command::new("/usr/bin/time") + .arg("-v") + .arg("./target/release/cradle_user") + .arg(bytes.to_string()) + .stdout(Stdio::null()) + .output()?; + let stderr = String::from_utf8(output.stderr)?; + eprintln!("{}", stderr); + let memory_size_prefix = "Maximum resident set size (kbytes): "; + let kilo_bytes: usize = stderr + .lines() + .map(|x| x.trim()) + .filter(|line| line.starts_with(memory_size_prefix)) + .next() + .unwrap() + .strip_prefix(memory_size_prefix) + .unwrap() + .parse()?; + let bytes = kilo_bytes * 1024; + Ok(bytes) +} From 469a187425cb95072cc23ce0d706f5ab52e15c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 4 Aug 2021 15:01:14 -0400 Subject: [PATCH 02/27] !fixup --- justfile | 1 + memory-test/src/bin/cradle_user.rs | 4 ++-- memory-test/src/bin/produce_bytes.rs | 16 ++++++++++++---- memory-test/src/bin/run_test.rs | 6 ++++-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/justfile b/justfile index 3129e0de..ea980812 100644 --- a/justfile +++ b/justfile @@ -17,6 +17,7 @@ doc +args="": clippy: cargo clippy --all-targets --all-features + cd memory-test; cargo clippy fmt: cargo fmt --all -- --check diff --git a/memory-test/src/bin/cradle_user.rs b/memory-test/src/bin/cradle_user.rs index d16d6a9e..9b1c4ccd 100644 --- a/memory-test/src/bin/cradle_user.rs +++ b/memory-test/src/bin/cradle_user.rs @@ -1,8 +1,8 @@ use cradle::prelude::*; fn main() { - let args = std::env::args(); - let bytes: usize = args.skip(1).next().unwrap().parse().unwrap(); + let mut args = std::env::args(); + let bytes: usize = args.nth(1).unwrap().parse().unwrap(); eprintln!("consuming {} kB", bytes / 2_usize.pow(10)); cmd_unit!("./target/release/produce_bytes", bytes.to_string()); } diff --git a/memory-test/src/bin/produce_bytes.rs b/memory-test/src/bin/produce_bytes.rs index e3727c35..069a7d0d 100644 --- a/memory-test/src/bin/produce_bytes.rs +++ b/memory-test/src/bin/produce_bytes.rs @@ -2,12 +2,20 @@ use anyhow::Result; use std::io::{stdout, Write}; fn main() -> Result<()> { - let args = std::env::args(); - let bytes: usize = args.skip(1).next().unwrap().parse()?; + let mut args = std::env::args(); + let mut bytes: usize = args.nth(1).unwrap().parse()?; eprintln!("producing {} kB", bytes / 2_usize.pow(10)); - let bytes = vec![b'x'; bytes]; + let buffer = &[b'x'; 1024]; let mut stdout = stdout(); - stdout.write_all(&bytes)?; + while bytes > 0 { + if bytes >= buffer.len() { + stdout.write_all(buffer)?; + bytes -= buffer.len(); + } else { + stdout.write_all(&[b'x'])?; + bytes -= 1; + } + } stdout.flush()?; Ok(()) } diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index ad0a8159..90f79107 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -29,12 +29,14 @@ fn measure_memory_consumption(bytes: usize) -> Result { .output()?; let stderr = String::from_utf8(output.stderr)?; eprintln!("{}", stderr); + if !output.status.success() { + panic!("running 'cradle_user' failed"); + } let memory_size_prefix = "Maximum resident set size (kbytes): "; let kilo_bytes: usize = stderr .lines() .map(|x| x.trim()) - .filter(|line| line.starts_with(memory_size_prefix)) - .next() + .find(|line| line.starts_with(memory_size_prefix)) .unwrap() .strip_prefix(memory_size_prefix) .unwrap() From a06ff8173621aa0f60bda15c6fa6346b728e056b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 4 Aug 2021 15:09:38 -0400 Subject: [PATCH 03/27] Fix memory-test for rustc <= 1.44 --- memory-test/src/bin/run_test.rs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index 90f79107..f97cf3f7 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -33,14 +33,23 @@ fn measure_memory_consumption(bytes: usize) -> Result { panic!("running 'cradle_user' failed"); } let memory_size_prefix = "Maximum resident set size (kbytes): "; - let kilo_bytes: usize = stderr - .lines() - .map(|x| x.trim()) - .find(|line| line.starts_with(memory_size_prefix)) - .unwrap() - .strip_prefix(memory_size_prefix) - .unwrap() - .parse()?; + let kilo_bytes: usize = strip_prefix( + stderr + .lines() + .map(|x| x.trim()) + .find(|line| line.starts_with(memory_size_prefix)) + .unwrap(), + memory_size_prefix, + ) + .parse()?; let bytes = kilo_bytes * 1024; Ok(bytes) } + +fn strip_prefix<'a>(string: &'a str, prefix: &'a str) -> &'a str { + if string.starts_with(prefix) { + &string[prefix.len()..] + } else { + panic!("{} doesn't start with {}", string, prefix); + } +} From 8fb21652bf2771632b0b609a2d5ec6339608fc11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 4 Aug 2021 15:10:00 -0400 Subject: [PATCH 04/27] [CI] Make memory test pass temporarily --- memory-test/src/bin/run_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index f97cf3f7..1716414e 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -10,7 +10,7 @@ fn main() -> Result<()> { Split("cargo build --release").run_unit(); let bytes = from_mb(64); let memory_consumption = measure_memory_consumption(bytes)?; - let allowed_memory_consumption = from_mb(16); + let allowed_memory_consumption = from_mb(70); assert!( memory_consumption < allowed_memory_consumption, "Maximum resident set size: {}, allowed upper limit: {}", From 05c046fc3302f9f23661d7cde561b3ed7ddf261c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 4 Aug 2021 15:13:37 -0400 Subject: [PATCH 05/27] Fix clippy warnings --- memory-test/src/bin/run_test.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index 1716414e..0a1f1109 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -10,7 +10,7 @@ fn main() -> Result<()> { Split("cargo build --release").run_unit(); let bytes = from_mb(64); let memory_consumption = measure_memory_consumption(bytes)?; - let allowed_memory_consumption = from_mb(70); + let allowed_memory_consumption = from_mb(70); // should be 16 assert!( memory_consumption < allowed_memory_consumption, "Maximum resident set size: {}, allowed upper limit: {}", @@ -47,6 +47,7 @@ fn measure_memory_consumption(bytes: usize) -> Result { } fn strip_prefix<'a>(string: &'a str, prefix: &'a str) -> &'a str { + #[allow(clippy::manual_strip)] if string.starts_with(prefix) { &string[prefix.len()..] } else { From 3e6e5550bab3447cf997792a42c2ee65f76abb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 4 Aug 2021 15:41:11 -0400 Subject: [PATCH 06/27] Fix clippy warnings for real --- memory-test/Cargo.lock | 1 + memory-test/Cargo.toml | 1 + memory-test/src/bin/run_test.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/memory-test/Cargo.lock b/memory-test/Cargo.lock index b8f37128..fcc1e1ff 100644 --- a/memory-test/Cargo.lock +++ b/memory-test/Cargo.lock @@ -21,6 +21,7 @@ version = "0.1.0" dependencies = [ "anyhow", "cradle", + "rustversion", ] [[package]] diff --git a/memory-test/Cargo.toml b/memory-test/Cargo.toml index 563aacb5..20f6e4b3 100644 --- a/memory-test/Cargo.toml +++ b/memory-test/Cargo.toml @@ -6,3 +6,4 @@ edition = "2018" [dependencies] anyhow = "1.0.42" cradle = { path = ".." } +rustversion = "1.0.5" diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index 0a1f1109..cddb85ce 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -46,8 +46,8 @@ fn measure_memory_consumption(bytes: usize) -> Result { Ok(bytes) } +#[rustversion::attr(since(1.48), allow(clippy::manual_strip))] fn strip_prefix<'a>(string: &'a str, prefix: &'a str) -> &'a str { - #[allow(clippy::manual_strip)] if string.starts_with(prefix) { &string[prefix.len()..] } else { From d390b04e705294d5e39af4cb185c9f7acc11a693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 4 Aug 2021 16:03:02 -0400 Subject: [PATCH 07/27] Only run memory-test on linux on ci --- justfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index ea980812..488887cc 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,9 @@ -ci: test build doc clippy fmt context-integration-tests memory-test run-examples forbidden-words render-readme-check +ci: test build doc clippy fmt context-integration-tests run-examples forbidden-words render-readme-check + #!/bin/bash + set -eux + if [[ $(uname) == "Linux" ]]; then + just memory-test + fi build: cargo build --all-targets --all-features From a7ca759a60332a108c05144dc9b935902e550cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 4 Aug 2021 23:41:27 -0400 Subject: [PATCH 08/27] Put real memory limit back in place --- memory-test/src/bin/run_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index cddb85ce..6cc8e7ab 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -10,7 +10,7 @@ fn main() -> Result<()> { Split("cargo build --release").run_unit(); let bytes = from_mb(64); let memory_consumption = measure_memory_consumption(bytes)?; - let allowed_memory_consumption = from_mb(70); // should be 16 + let allowed_memory_consumption = from_mb(16); assert!( memory_consumption < allowed_memory_consumption, "Maximum resident set size: {}, allowed upper limit: {}", From e8cbb49fcdc3b684cdeacc0826192f98d850ca1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Fri, 6 Aug 2021 14:31:53 -0400 Subject: [PATCH 09/27] Save stdout as Option internally to avoid masking bugs --- src/collected_output.rs | 12 ++++++----- src/config.rs | 1 + src/error.rs | 45 +++++++++++++++++++++++++++++++---------- src/lib.rs | 2 +- src/output.rs | 3 ++- 5 files changed, 45 insertions(+), 18 deletions(-) diff --git a/src/collected_output.rs b/src/collected_output.rs index e39131be..83f6b6bf 100644 --- a/src/collected_output.rs +++ b/src/collected_output.rs @@ -7,7 +7,7 @@ use std::{ pub(crate) struct Waiter { stdin: JoinHandle>, - stdout: JoinHandle>>, + stdout: JoinHandle>>>, stderr: JoinHandle>>, } @@ -30,8 +30,8 @@ impl Waiter { }); let mut context_clone = context.clone(); let relay_stdout = config.relay_stdout; - let stdout_join_handle = thread::spawn(move || -> io::Result> { - let mut collected_stdout = Vec::new(); + let stdout_join_handle = thread::spawn(move || -> io::Result>> { + let mut collected_stdout = if relay_stdout { None } else { Some(Vec::new()) }; let buffer = &mut [0; 256]; loop { let length = child_stdout.read(buffer)?; @@ -41,7 +41,9 @@ impl Waiter { if relay_stdout { context_clone.stdout.write_all(&buffer[..length])?; } - collected_stdout.extend(&buffer[..length]); + if let Some(collected_stdout) = &mut collected_stdout { + collected_stdout.extend(&buffer[..length]); + } } Ok(collected_stdout) }); @@ -87,6 +89,6 @@ impl Waiter { } pub(crate) struct CollectedOutput { - pub(crate) stdout: Vec, + pub(crate) stdout: Option>, pub(crate) stderr: Vec, } diff --git a/src/config.rs b/src/config.rs index abbb8ca3..ad412572 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,6 +4,7 @@ use std::{ffi::OsString, path::PathBuf, sync::Arc}; #[doc(hidden)] #[rustversion::attr(since(1.48), allow(clippy::rc_buffer))] +#[derive(Debug, Clone)] pub struct Config { pub(crate) arguments: Vec, pub(crate) log_command: bool, diff --git a/src/error.rs b/src/error.rs index be242c2e..384a42e8 100644 --- a/src/error.rs +++ b/src/error.rs @@ -26,6 +26,10 @@ pub enum Error { full_command: String, source: Arc, }, + CradleBug { + full_command: String, + config: Config, + }, } impl Error { @@ -35,6 +39,13 @@ impl Error { source: Arc::new(error), } } + + pub(crate) fn cradle_bug(config: &Config) -> Error { + Error::CradleBug { + full_command: config.full_command(), + config: config.clone(), + } + } } #[doc(hidden)] @@ -48,15 +59,16 @@ pub fn panic_on_error(result: Result) -> T { impl Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + use Error::*; match self { - Error::NoArgumentsGiven => write!(f, "no arguments given"), - Error::FileNotFoundWhenExecuting { executable, .. } => write!( + NoArgumentsGiven => write!(f, "no arguments given"), + FileNotFoundWhenExecuting { executable, .. } => write!( f, "File not found error when executing '{}'", executable.to_string_lossy() ), - Error::CommandIoError { message, .. } => write!(f, "{}", message), - Error::NonZeroExitCode { + CommandIoError { message, .. } => write!(f, "{}", message), + NonZeroExitCode { full_command, exit_status, } => { @@ -70,24 +82,35 @@ impl Display for Error { write!(f, "{}:\n exited with {}", full_command, exit_status) } } - Error::InvalidUtf8ToStdout { full_command, .. } => { + InvalidUtf8ToStdout { full_command, .. } => { write!(f, "{}:\n invalid utf-8 written to stdout", full_command) } - Error::InvalidUtf8ToStderr { full_command, .. } => { + InvalidUtf8ToStderr { full_command, .. } => { write!(f, "{}:\n invalid utf-8 written to stderr", full_command) } + CradleBug { .. } => { + let snippets = vec![ + "Congratulations, you've found a bug in cradle! :/", + "Please, consider reporting a bug on https://github.com/soenkehahn/cradle/issues,", + "including the following information:", + ]; + writeln!(f, "{}\n{:#?}", snippets.join(" "), self) + } } } } impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + use Error::*; match self { - Error::FileNotFoundWhenExecuting { source, .. } - | Error::CommandIoError { source, .. } => Some(&**source), - Error::InvalidUtf8ToStdout { source, .. } - | Error::InvalidUtf8ToStderr { source, .. } => Some(&**source), - Error::NoArgumentsGiven | Error::NonZeroExitCode { .. } => None, + FileNotFoundWhenExecuting { source, .. } | CommandIoError { source, .. } => { + Some(&**source) + } + InvalidUtf8ToStdout { source, .. } | InvalidUtf8ToStderr { source, .. } => { + Some(&**source) + } + NoArgumentsGiven | NonZeroExitCode { .. } | CradleBug { .. } => None, } } } diff --git a/src/lib.rs b/src/lib.rs index 9328ec7d..1486a138 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -320,7 +320,7 @@ where #[doc(hidden)] #[derive(Clone)] pub struct RunResult { - stdout: Vec, + stdout: Option>, stderr: Vec, exit_status: ExitStatus, } diff --git a/src/output.rs b/src/output.rs index 083af887..ce356ea2 100644 --- a/src/output.rs +++ b/src/output.rs @@ -171,7 +171,8 @@ impl Output for StdoutUntrimmed { #[doc(hidden)] fn from_run_result(config: &Config, result: Result) -> Result { let result = result?; - Ok(StdoutUntrimmed(String::from_utf8(result.stdout).map_err( + let stdout = result.stdout.ok_or_else(|| Error::cradle_bug(config))?; + Ok(StdoutUntrimmed(String::from_utf8(stdout).map_err( |source| Error::InvalidUtf8ToStdout { full_command: config.full_command(), source: Arc::new(source), From 5455ffc73e97e33a79ab8707988a232285c37c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sat, 7 Aug 2021 13:09:13 -0400 Subject: [PATCH 10/27] Tweaks --- justfile | 4 ++-- memory-test/Cargo.lock | 2 +- memory-test/Cargo.toml | 2 +- memory-test/src/bin/run_test.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/justfile b/justfile index 488887cc..6b4ae345 100644 --- a/justfile +++ b/justfile @@ -22,13 +22,13 @@ doc +args="": clippy: cargo clippy --all-targets --all-features - cd memory-test; cargo clippy + (cd memory-test && cargo clippy) fmt: cargo fmt --all -- --check memory-test: - cd memory-test; cargo run --bin run_test + (cd memory-test && cargo run --bin run_test) run-examples: cargo run --example readme diff --git a/memory-test/Cargo.lock b/memory-test/Cargo.lock index fcc1e1ff..918f6c05 100644 --- a/memory-test/Cargo.lock +++ b/memory-test/Cargo.lock @@ -17,7 +17,7 @@ dependencies = [ [[package]] name = "memory-test" -version = "0.1.0" +version = "0.0.0" dependencies = [ "anyhow", "cradle", diff --git a/memory-test/Cargo.toml b/memory-test/Cargo.toml index 20f6e4b3..7b10f4ac 100644 --- a/memory-test/Cargo.toml +++ b/memory-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "memory-test" -version = "0.1.0" +version = "0.0.0" edition = "2018" [dependencies] diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index 6cc8e7ab..2ba69963 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -36,7 +36,7 @@ fn measure_memory_consumption(bytes: usize) -> Result { let kilo_bytes: usize = strip_prefix( stderr .lines() - .map(|x| x.trim()) + .map(|line| line.trim()) .find(|line| line.starts_with(memory_size_prefix)) .unwrap(), memory_size_prefix, From 6dca1756628c0e5ff0a194b95cf65aeb7040e050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sat, 7 Aug 2021 13:28:54 -0400 Subject: [PATCH 11/27] Integrate memory-test with cargo test suite --- .gitignore | 2 +- Cargo.toml | 3 +++ justfile | 17 ++++------------- tests/integration.rs | 7 +++++++ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 3b37adf0..e9e21997 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -target/ +/target/ /Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index 137bdfa8..2b88e432 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ homepage = "https://github.com/soenkehahn/cradle" keywords = ["child", "child-process", "command", "process", "shell"] categories = ["filesystem", "os"] +[workspace] +members = [".", "memory-test"] + [dependencies] rustversion = "1.0.4" diff --git a/justfile b/justfile index 6b4ae345..1d50a554 100644 --- a/justfile +++ b/justfile @@ -1,15 +1,10 @@ ci: test build doc clippy fmt context-integration-tests run-examples forbidden-words render-readme-check - #!/bin/bash - set -eux - if [[ $(uname) == "Linux" ]]; then - just memory-test - fi build: - cargo build --all-targets --all-features + cargo build --all-targets --all-features --workspace test +pattern="": - cargo test --all {{ pattern }} + cargo test {{ pattern }} test-lib-fast +pattern="": cargo test --lib {{ pattern }} @@ -18,18 +13,14 @@ context-integration-tests: cargo run --features "test_executables" --bin context_integration_tests doc +args="": - cargo doc --all {{args}} + cargo doc --workspace {{args}} clippy: - cargo clippy --all-targets --all-features - (cd memory-test && cargo clippy) + cargo clippy --all-targets --all-features --workspace fmt: cargo fmt --all -- --check -memory-test: - (cd memory-test && cargo run --bin run_test) - run-examples: cargo run --example readme diff --git a/tests/integration.rs b/tests/integration.rs index 316872e1..77220b31 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -313,3 +313,10 @@ mod run_interface { ); } } + +#[test] +fn memory_test() { + use cradle::prelude::*; + cmd_unit!(%"cargo build -p memory-test --release"); + cmd_unit!(%"cargo run -p memory-test --bin run_test"); +} From 8cf5664854dce9c0e0c6f7ebf6fc7b95c911e7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:25:47 -0400 Subject: [PATCH 12/27] Use `mib` for mebibyte Co-authored-by: Casey Rodarmor --- memory-test/src/bin/run_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index 2ba69963..e3809bd5 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -2,7 +2,7 @@ use anyhow::Result; use cradle::prelude::*; use std::process::{Command, Stdio}; -fn from_mb(mega_bytes: usize) -> usize { +fn from_mib(mebibytes: usize) -> usize { mega_bytes * 2_usize.pow(20) } From 73b36da9b9750c01541a53c0ead2f1c77cfb3959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:26:22 -0400 Subject: [PATCH 13/27] kibibytes Co-authored-by: Casey Rodarmor --- memory-test/src/bin/run_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index e3809bd5..8162ec46 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -33,7 +33,7 @@ fn measure_memory_consumption(bytes: usize) -> Result { panic!("running 'cradle_user' failed"); } let memory_size_prefix = "Maximum resident set size (kbytes): "; - let kilo_bytes: usize = strip_prefix( + let kibibytes: usize = strip_prefix( stderr .lines() .map(|line| line.trim()) From 1449f40acf3cb91369ee59002e63ca28b9dc829f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:36:44 -0400 Subject: [PATCH 14/27] Tweak error message --- src/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/error.rs b/src/error.rs index 384a42e8..3b6fbc08 100644 --- a/src/error.rs +++ b/src/error.rs @@ -90,9 +90,9 @@ impl Display for Error { } CradleBug { .. } => { let snippets = vec![ - "Congratulations, you've found a bug in cradle! :/", - "Please, consider reporting a bug on https://github.com/soenkehahn/cradle/issues,", - "including the following information:", + "Congratulations, you've found a bug in cradle! :/", + "Please, open an issue on https://github.com/soenkehahn/cradle/issues", + "including the following information:", ]; writeln!(f, "{}\n{:#?}", snippets.join(" "), self) } From 16d9402aaf2a0677082697802e935ee7b9ca3937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:38:00 -0400 Subject: [PATCH 15/27] Tweak error message --- src/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index 3b6fbc08..53dccbcc 100644 --- a/src/error.rs +++ b/src/error.rs @@ -92,7 +92,7 @@ impl Display for Error { let snippets = vec![ "Congratulations, you've found a bug in cradle! :/", "Please, open an issue on https://github.com/soenkehahn/cradle/issues", - "including the following information:", + "with the following information:", ]; writeln!(f, "{}\n{:#?}", snippets.join(" "), self) } From 0e5b5abed073deb8f5dcc6375904b40b06933692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:40:22 -0400 Subject: [PATCH 16/27] Fix compilation --- memory-test/src/bin/run_test.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/memory-test/src/bin/run_test.rs b/memory-test/src/bin/run_test.rs index 8162ec46..cc7a51a2 100644 --- a/memory-test/src/bin/run_test.rs +++ b/memory-test/src/bin/run_test.rs @@ -3,14 +3,14 @@ use cradle::prelude::*; use std::process::{Command, Stdio}; fn from_mib(mebibytes: usize) -> usize { - mega_bytes * 2_usize.pow(20) + mebibytes * 2_usize.pow(20) } fn main() -> Result<()> { Split("cargo build --release").run_unit(); - let bytes = from_mb(64); + let bytes = from_mib(64); let memory_consumption = measure_memory_consumption(bytes)?; - let allowed_memory_consumption = from_mb(16); + let allowed_memory_consumption = from_mib(16); assert!( memory_consumption < allowed_memory_consumption, "Maximum resident set size: {}, allowed upper limit: {}", @@ -42,7 +42,7 @@ fn measure_memory_consumption(bytes: usize) -> Result { memory_size_prefix, ) .parse()?; - let bytes = kilo_bytes * 1024; + let bytes = kibibytes * 1024; Ok(bytes) } From f4ee803945bd5b481bb088b068e1f85b2890a3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:41:37 -0400 Subject: [PATCH 17/27] Rename CradleBug -> Internal --- src/error.rs | 10 +++++----- src/output.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/error.rs b/src/error.rs index 53dccbcc..a3edb442 100644 --- a/src/error.rs +++ b/src/error.rs @@ -26,7 +26,7 @@ pub enum Error { full_command: String, source: Arc, }, - CradleBug { + Internal { full_command: String, config: Config, }, @@ -40,8 +40,8 @@ impl Error { } } - pub(crate) fn cradle_bug(config: &Config) -> Error { - Error::CradleBug { + pub(crate) fn internal(config: &Config) -> Error { + Error::Internal { full_command: config.full_command(), config: config.clone(), } @@ -88,7 +88,7 @@ impl Display for Error { InvalidUtf8ToStderr { full_command, .. } => { write!(f, "{}:\n invalid utf-8 written to stderr", full_command) } - CradleBug { .. } => { + Internal { .. } => { let snippets = vec![ "Congratulations, you've found a bug in cradle! :/", "Please, open an issue on https://github.com/soenkehahn/cradle/issues", @@ -110,7 +110,7 @@ impl std::error::Error for Error { InvalidUtf8ToStdout { source, .. } | InvalidUtf8ToStderr { source, .. } => { Some(&**source) } - NoArgumentsGiven | NonZeroExitCode { .. } | CradleBug { .. } => None, + NoArgumentsGiven | NonZeroExitCode { .. } | Internal { .. } => None, } } } diff --git a/src/output.rs b/src/output.rs index ce356ea2..533919a9 100644 --- a/src/output.rs +++ b/src/output.rs @@ -171,7 +171,7 @@ impl Output for StdoutUntrimmed { #[doc(hidden)] fn from_run_result(config: &Config, result: Result) -> Result { let result = result?; - let stdout = result.stdout.ok_or_else(|| Error::cradle_bug(config))?; + let stdout = result.stdout.ok_or_else(|| Error::internal(config))?; Ok(StdoutUntrimmed(String::from_utf8(stdout).map_err( |source| Error::InvalidUtf8ToStdout { full_command: config.full_command(), From 8e5e2891c3c0696b419c0f0be42898f47a0f367b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:45:06 -0400 Subject: [PATCH 18/27] KiB Co-authored-by: Casey Rodarmor --- memory-test/src/bin/produce_bytes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-test/src/bin/produce_bytes.rs b/memory-test/src/bin/produce_bytes.rs index 069a7d0d..2c636164 100644 --- a/memory-test/src/bin/produce_bytes.rs +++ b/memory-test/src/bin/produce_bytes.rs @@ -4,7 +4,7 @@ use std::io::{stdout, Write}; fn main() -> Result<()> { let mut args = std::env::args(); let mut bytes: usize = args.nth(1).unwrap().parse()?; - eprintln!("producing {} kB", bytes / 2_usize.pow(10)); + eprintln!("producing {} KiB", bytes / 2_usize.pow(10)); let buffer = &[b'x'; 1024]; let mut stdout = stdout(); while bytes > 0 { From 789536ebdeb8dc3bddf68c3920fe4686dd370826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:45:57 -0400 Subject: [PATCH 19/27] KiB Co-authored-by: Casey Rodarmor --- memory-test/src/bin/cradle_user.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-test/src/bin/cradle_user.rs b/memory-test/src/bin/cradle_user.rs index 9b1c4ccd..33259980 100644 --- a/memory-test/src/bin/cradle_user.rs +++ b/memory-test/src/bin/cradle_user.rs @@ -3,6 +3,6 @@ use cradle::prelude::*; fn main() { let mut args = std::env::args(); let bytes: usize = args.nth(1).unwrap().parse().unwrap(); - eprintln!("consuming {} kB", bytes / 2_usize.pow(10)); + eprintln!("consuming {} KiB", bytes / 2_usize.pow(10)); cmd_unit!("./target/release/produce_bytes", bytes.to_string()); } From 4c3cf4b83f1347cc1274e3600c0688a6e5d00352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:47:26 -0400 Subject: [PATCH 20/27] Simplify produce_bytes Co-authored-by: Casey Rodarmor --- memory-test/src/bin/produce_bytes.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/memory-test/src/bin/produce_bytes.rs b/memory-test/src/bin/produce_bytes.rs index 2c636164..42118f86 100644 --- a/memory-test/src/bin/produce_bytes.rs +++ b/memory-test/src/bin/produce_bytes.rs @@ -8,13 +8,8 @@ fn main() -> Result<()> { let buffer = &[b'x'; 1024]; let mut stdout = stdout(); while bytes > 0 { - if bytes >= buffer.len() { - stdout.write_all(buffer)?; - bytes -= buffer.len(); - } else { - stdout.write_all(&[b'x'])?; - bytes -= 1; - } + stdout.write_all(&buffer[..bytes])?; + bytes -= bytes; } stdout.flush()?; Ok(()) From 13dd24ea396fbb0b3fc0a78a35486675d9c26c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 11:56:25 -0400 Subject: [PATCH 21/27] Fix produce_bytes --- memory-test/src/bin/produce_bytes.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/memory-test/src/bin/produce_bytes.rs b/memory-test/src/bin/produce_bytes.rs index 42118f86..60c9ad6f 100644 --- a/memory-test/src/bin/produce_bytes.rs +++ b/memory-test/src/bin/produce_bytes.rs @@ -8,8 +8,9 @@ fn main() -> Result<()> { let buffer = &[b'x'; 1024]; let mut stdout = stdout(); while bytes > 0 { - stdout.write_all(&buffer[..bytes])?; - bytes -= bytes; + let chunk_size = bytes.min(1024); + stdout.write_all(&buffer[..chunk_size])?; + bytes -= chunk_size; } stdout.flush()?; Ok(()) From 92a1a135e9b9866ff53c656644a78e1ea058658e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 12:00:48 -0400 Subject: [PATCH 22/27] Refactor relay_stdout to capture_stdout --- src/collected_output.rs | 14 +++++++++----- src/config.rs | 4 ++-- src/output.rs | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/collected_output.rs b/src/collected_output.rs index 83f6b6bf..3740a6f3 100644 --- a/src/collected_output.rs +++ b/src/collected_output.rs @@ -29,21 +29,25 @@ impl Waiter { Ok(()) }); let mut context_clone = context.clone(); - let relay_stdout = config.relay_stdout; + let capture_stdout = config.capture_stdout; let stdout_join_handle = thread::spawn(move || -> io::Result>> { - let mut collected_stdout = if relay_stdout { None } else { Some(Vec::new()) }; + let mut collected_stdout = if capture_stdout { + Some(Vec::new()) + } else { + None + }; let buffer = &mut [0; 256]; loop { let length = child_stdout.read(buffer)?; if (length) == 0 { break; } - if relay_stdout { - context_clone.stdout.write_all(&buffer[..length])?; - } if let Some(collected_stdout) = &mut collected_stdout { collected_stdout.extend(&buffer[..length]); } + if !capture_stdout { + context_clone.stdout.write_all(&buffer[..length])?; + } } Ok(collected_stdout) }); diff --git a/src/config.rs b/src/config.rs index ad412572..f4bff207 100644 --- a/src/config.rs +++ b/src/config.rs @@ -11,7 +11,7 @@ pub struct Config { pub(crate) working_directory: Option, pub(crate) added_environment_variables: Vec<(OsString, OsString)>, pub(crate) stdin: Arc>, - pub(crate) relay_stdout: bool, + pub(crate) capture_stdout: bool, pub(crate) relay_stderr: bool, pub(crate) error_on_non_zero_exit_code: bool, } @@ -45,7 +45,7 @@ impl Default for Config { working_directory: None, added_environment_variables: Vec::new(), stdin: Arc::new(Vec::new()), - relay_stdout: true, + capture_stdout: false, relay_stderr: true, error_on_non_zero_exit_code: true, } diff --git a/src/output.rs b/src/output.rs index 533919a9..47a5b6e5 100644 --- a/src/output.rs +++ b/src/output.rs @@ -165,7 +165,7 @@ pub struct StdoutUntrimmed(pub String); impl Output for StdoutUntrimmed { #[doc(hidden)] fn configure(config: &mut Config) { - config.relay_stdout = false; + config.capture_stdout = true; } #[doc(hidden)] From 9e5334da267639e36941e1f0f7ab35e8f1f0c9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 12:03:25 -0400 Subject: [PATCH 23/27] Rename relay_stderr to capture_stderr for consistency --- src/collected_output.rs | 6 +++--- src/config.rs | 4 ++-- src/output.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/collected_output.rs b/src/collected_output.rs index 3740a6f3..86f3173d 100644 --- a/src/collected_output.rs +++ b/src/collected_output.rs @@ -52,7 +52,7 @@ impl Waiter { Ok(collected_stdout) }); let mut context_clone = context.clone(); - let relay_stderr = config.relay_stderr; + let capture_stderr = config.capture_stderr; let stderr_join_handle = thread::spawn(move || -> io::Result> { let mut collected_stderr = Vec::new(); let buffer = &mut [0; 256]; @@ -61,10 +61,10 @@ impl Waiter { if (length) == 0 { break; } - if relay_stderr { + collected_stderr.extend(&buffer[..length]); + if !capture_stderr { context_clone.stderr.write_all(&buffer[..length])?; } - collected_stderr.extend(&buffer[..length]); } Ok(collected_stderr) }); diff --git a/src/config.rs b/src/config.rs index f4bff207..46b3dff3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -12,7 +12,7 @@ pub struct Config { pub(crate) added_environment_variables: Vec<(OsString, OsString)>, pub(crate) stdin: Arc>, pub(crate) capture_stdout: bool, - pub(crate) relay_stderr: bool, + pub(crate) capture_stderr: bool, pub(crate) error_on_non_zero_exit_code: bool, } @@ -46,7 +46,7 @@ impl Default for Config { added_environment_variables: Vec::new(), stdin: Arc::new(Vec::new()), capture_stdout: false, - relay_stderr: true, + capture_stderr: false, error_on_non_zero_exit_code: true, } } diff --git a/src/output.rs b/src/output.rs index 47a5b6e5..f4e04928 100644 --- a/src/output.rs +++ b/src/output.rs @@ -204,7 +204,7 @@ pub struct Stderr(pub String); impl Output for Stderr { #[doc(hidden)] fn configure(config: &mut Config) { - config.relay_stderr = false; + config.capture_stderr = true; } #[doc(hidden)] From 32f1fffe583c7befca96578ff19423d4138c74cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 20:15:02 -0400 Subject: [PATCH 24/27] Do something --- .github/workflows/ci.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 20cae4c2..72829e05 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,11 @@ jobs: - name: Install just run: | - if ! which just; then + if ! which just + then + TEMPDIR=$(mktemp -d) + echo $TEMPDIR + cd $TEMPDIR git clone https://github.com/casey/just cd just git checkout v0.9.3 @@ -82,6 +86,7 @@ jobs: - name: Install clippy and rustfmt run: | + pwd echo '${{ matrix.rust }}' > rust-toolchain rustup component add clippy rustfmt From 478c938103b032b74128f899ea9655863e5a5a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 21:53:43 -0400 Subject: [PATCH 25/27] Disable memory test for non-Linux --- tests/integration.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration.rs b/tests/integration.rs index 77220b31..6ac20f33 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -314,6 +314,7 @@ mod run_interface { } } +#[cfg(target_os = "linux")] #[test] fn memory_test() { use cradle::prelude::*; From 04db67a55b0ee8469b35173b3bc442e62e9918e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Sun, 8 Aug 2021 21:55:41 -0400 Subject: [PATCH 26/27] [CI] Bump cache key --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 72829e05..9ed8a781 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,7 +15,7 @@ defaults: shell: bash env: - CACHE_KEY: 2 + CACHE_KEY: 3 jobs: all: From b538bfe8e5a87a1e988999b91b39b012fbffe0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Mon, 9 Aug 2021 11:09:09 -0400 Subject: [PATCH 27/27] [CI] Fixup --- .github/workflows/ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9ed8a781..bcb45db4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,7 +75,6 @@ jobs: if ! which just then TEMPDIR=$(mktemp -d) - echo $TEMPDIR cd $TEMPDIR git clone https://github.com/casey/just cd just @@ -86,7 +85,6 @@ jobs: - name: Install clippy and rustfmt run: | - pwd echo '${{ matrix.rust }}' > rust-toolchain rustup component add clippy rustfmt