Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

ci(test): build the test job without workspace debug info (#9753)

teo768ec25fad61
diff --git a/.github/workflows/code_check_cloud_storage.yml b/.github/workflows/code_check_cloud_storage.yml
index 71e62776cc..c4c0258b0a 100644
--- a/.github/workflows/code_check_cloud_storage.yml
+++ b/.github/workflows/code_check_cloud_storage.yml
@@ -683,6 +683,8 @@ jobs:
env:
RUST_PACKAGES: ${{ needs.path-check.outputs.rust_packages }}
NEXTEST_TEST_THREADS: '32'
+ CARGO_PROFILE_DEV_DEBUG: '0'
+ CARGO_PROFILE_TEST_DEBUG: '0'
RUSTFLAGS: '-Dwarnings -C link-arg=-fuse-ld=mold'
SCCACHE_IDLE_TIMEOUT: '0'
services:
@@ -840,9 +842,9 @@ jobs:
# Unconstrained `-p` still runs that package's tests.
: "${RUST_PACKAGES:?RUST_PACKAGES is required}"
- # Dependencies build without debug info, which cuts compile, link and disk cost.
- # Workspace crates keep CARGO_PROFILE_*_DEBUG=limited, so backtraces still carry
- # line numbers in our own code.
+ # Nothing in this build carries debug info: the job sets CARGO_PROFILE_*_DEBUG=0 for
+ # workspace crates, and this flag covers dependencies. Panic messages keep their
+ # file and line; backtrace frames keep function names only.
common=(
--config 'profile.dev.package."*".debug=false'
--all-features --no-tests=pass
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
index 452a2262f8..00ef805a92 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
@@ -181,6 +181,10 @@ fn test() -> Job {
"${{ needs.path-check.outputs.rust_packages }}",
))
.add_env(("NEXTEST_TEST_THREADS", vars::NEXTEST_TEST_THREADS))
+ // Debug info is most of what test builds write and link. Panic locations
+ // don't depend on it; only backtrace frames lose their file and line.
+ .add_env(("CARGO_PROFILE_DEV_DEBUG", "0"))
+ .add_env(("CARGO_PROFILE_TEST_DEBUG", "0"))
.add_env(("RUSTFLAGS", "-Dwarnings -C link-arg=-fuse-ld=mold"))
// The default 10-minute idle timeout can stop the server during long
// link or test phases, which resets the stats reported at the end.
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage/test.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage/test.rs
index 40c2fbbefd..0193e8d16a 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage/test.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage/test.rs
@@ -236,6 +236,13 @@ fn tests_build_dependencies_without_debug_info() {
);
}
+#[test]
+fn test_job_builds_workspace_crates_without_debug_info() {
+ let job = serde_json::to_value(test()).unwrap();
+ assert_eq!(job["env"]["CARGO_PROFILE_DEV_DEBUG"], "0");
+ assert_eq!(job["env"]["CARGO_PROFILE_TEST_DEBUG"], "0");
+}
+
#[test]
fn test_job_keeps_one_sccache_server_for_the_whole_run() {
let job = serde_json::to_value(test()).unwrap();
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/run_tests.sh b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/run_tests.sh
index 6b4a3625b6..152577051d 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/run_tests.sh
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/run_tests.sh
@@ -15,9 +15,9 @@ set -euo pipefail
# Unconstrained `-p` still runs that package's tests.
: "${RUST_PACKAGES:?RUST_PACKAGES is required}"
-# Dependencies build without debug info, which cuts compile, link and disk cost.
-# Workspace crates keep CARGO_PROFILE_*_DEBUG=limited, so backtraces still carry
-# line numbers in our own code.
+# Nothing in this build carries debug info: the job sets CARGO_PROFILE_*_DEBUG=0 for
+# workspace crates, and this flag covers dependencies. Panic messages keep their
+# file and line; backtrace frames keep function names only.
common=(
--config 'profile.dev.package."*".debug=false'
--all-features --no-tests=pass