From e5f54ff351f25b9698acc7d4a144dc67b6549985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sat, 25 Oct 2025 11:52:38 +0200 Subject: [PATCH] Make rustc-perf example Cargo commands more bulletproof --- .../compile/table/shortcuts/binary-size-shortcut.vue | 8 ++++---- .../compare/compile/table/shortcuts/cachegrind-cmd.vue | 3 ++- .../compare/compile/table/shortcuts/profile-shortcut.vue | 4 ++-- site/frontend/src/pages/detailed-query/utils.ts | 7 ++++--- site/frontend/src/utils/cargo.ts | 9 +++++++++ 5 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 site/frontend/src/utils/cargo.ts diff --git a/site/frontend/src/pages/compare/compile/table/shortcuts/binary-size-shortcut.vue b/site/frontend/src/pages/compare/compile/table/shortcuts/binary-size-shortcut.vue index cbdef810f..dfc29540a 100644 --- a/site/frontend/src/pages/compare/compile/table/shortcuts/binary-size-shortcut.vue +++ b/site/frontend/src/pages/compare/compile/table/shortcuts/binary-size-shortcut.vue @@ -8,6 +8,7 @@ import {CompileTestCase} from "../../common"; import {ArtifactDescription} from "../../../types"; import Tooltip from "../../../tooltip.vue"; import {normalizeProfile} from "./utils"; +import {cargo_collector_command} from "../../../../../utils/cargo"; const props = defineProps<{ artifact: ArtifactDescription; @@ -30,13 +31,12 @@ function normalizeBackend(backend: string): string { Command for analyzing binary size locally Execute this command in a checkout of - rustc-perf, after a - `cargo build --release`, to compare binary section sizes. Add `--symbols` - to include a diff of symbol sizes. + rustc-perf. Add + `--symbols` to include a diff of symbol sizes. -
cargo run --release --bin collector \
+  
{{ cargo_collector_command() }} \
     binary_stats compile \
     +{{ props.baseArtifact.commit }} \
     --rustc2 +{{ props.artifact.commit }} \
diff --git a/site/frontend/src/pages/compare/compile/table/shortcuts/cachegrind-cmd.vue b/site/frontend/src/pages/compare/compile/table/shortcuts/cachegrind-cmd.vue
index eaa782ac7..51d188690 100644
--- a/site/frontend/src/pages/compare/compile/table/shortcuts/cachegrind-cmd.vue
+++ b/site/frontend/src/pages/compare/compile/table/shortcuts/cachegrind-cmd.vue
@@ -6,6 +6,7 @@
 import {CompileTestCase} from "../../common";
 import {computed} from "vue";
 import {normalizeProfile} from "./utils";
+import {cargo_collector_command} from "../../../../../utils/cargo";
 
 const props = defineProps<{
   commit: string;
@@ -36,7 +37,7 @@ function normalizeScenario(scenario: string): string {