From 3acc2b2e88d6e8e64b9612624cbc10769e410724 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Sun, 7 Feb 2021 17:47:31 -0800 Subject: [PATCH] Tweak testing cargo-binutils While following the instructions for cargo-binutils in 03-setup the `cargo size -- -version` caused an error when following the instructions: ``` console $ cargo size -- -version error: Error during execution of `cargo metadata`: error: could not find `Cargo.toml` in `C:\Users\wink` or any parent directory ``` The cause of the error is that you're not told to be in a rust project directory. The solution I've chosen is to create a rust bin project, cd into the project, run it and then do the `cargo size -- -version`. --- src/03-setup/README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/03-setup/README.md b/src/03-setup/README.md index db1787b4e..6943ab75e 100644 --- a/src/03-setup/README.md +++ b/src/03-setup/README.md @@ -90,13 +90,24 @@ itmdump 0.3.1 ``` console $ rustup component add llvm-tools-preview -$ cargo install cargo-binutils --vers 0.3.0 +$ cargo install cargo-binutils + +$ cargo new test-size + Created binary (application) `test-size` package + +$ cd test-size + +$ cargo run + Finished dev [unoptimized + debuginfo] target(s) in 0.01s + Running `target\debug\test-size.exe` +Hello, world! $ cargo size -- -version + Finished dev [unoptimized + debuginfo] target(s) in 0.50s LLVM (http://llvm.org/): - LLVM version 8.0.0svn + LLVM version 11.0.0-rust-1.49.0-stable Optimized build. - Default target: x86_64-unknown-linux-gnu + Default target: x86_64-pc-windows-msvc Host CPU: skylake ```