From d2b03f987e8cab06e3932ea731e720f0900b24a3 Mon Sep 17 00:00:00 2001 From: George Pollard Date: Wed, 28 Jun 2023 22:52:29 +0000 Subject: [PATCH 1/2] Shrink the debug info --- src/agent/Cargo.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/agent/Cargo.toml b/src/agent/Cargo.toml index 852ac00af7..c3a7ba2276 100644 --- a/src/agent/Cargo.toml +++ b/src/agent/Cargo.toml @@ -22,4 +22,9 @@ members = [ [profile.release] lto = "thin" -debug = true \ No newline at end of file +# Per https://fasterthanli.me/articles/why-is-my-rust-build-so-slow: +# In Cargo.toml, debug = true actually means debug = 2, and it's usually overkill, +# unless you're doing the sort of debugging where you need to be able to inspect +# the value of local variables for example. +# If all you're after is a stack trace, debug = 1 is good enough. +debug = 1 From 034d730f62a48c8135f335a6ee51fb8118f48a2a Mon Sep 17 00:00:00 2001 From: George Pollard Date: Wed, 28 Jun 2023 23:07:31 +0000 Subject: [PATCH 2/2] Compress debug symbols after build --- src/ci/agent.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ci/agent.sh b/src/ci/agent.sh index 0d993077bb..f6ab72d205 100755 --- a/src/ci/agent.sh +++ b/src/ci/agent.sh @@ -49,6 +49,13 @@ echo "Checking dependencies of binaries" "$script_dir/check-dependencies.sh" +if [ "$(uname)" == 'Linux' ]; then + echo "Compressing debug symbols" + objcopy --compress-debug-sections target/release/onefuzz-task + objcopy --compress-debug-sections target/release/onefuzz-agent + objcopy --compress-debug-sections target/release/srcview +fi + echo "Copying artifacts to $output_dir" cp target/release/onefuzz-task* "$output_dir"