ci: Strip release binaries of debug symbols used by debuggers #3309
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 403 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.359
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3309"
general
weight: 0.35
mariomac
Linking with
-s -wcould reduce the binary size significantly. Alloy has also been using these flags.According to Go's documentation:
My AI agent says that only debuggers will be impacted by this:
<details>
<summary>What <code>-s -w</code> changes in a release build</summary>
| Feature | With
-s -w| Why ||---|---|---|
| Runtime | | |
| Program behavior and performance | ✅ Unchanged | The code and data the OS loads are identical; only unloaded sections are removed. |
| Panic and crash stack traces (function names, file:line) | ✅ Works | Built from
.gopclntab, which is kept. || Goroutine dumps (
SIGQUIT,/debug/pprof/goroutine?debug=2) | ✅ Works | Same as above. ||
runtime.Caller,runtime.FuncForPC,debug.Stack(), logfile:line| ✅ Works | Same as above. || Reflection and type names | ✅ Works | Type metadata (
.go.type) is kept. || Profiling | | |
| pprof profiles (
BEYLA_PROFILE_PORT,go tool pprof) | ✅ Works | The Go runtime writes function names into the profile itself. || Go-aware continuous profilers (Pyroscope, OTel eBPF profiler) | ✅ Works | They read
.gopclntab. || Linux
perf report| ❌ Raw addresses only |perfreads.symtab/DWARF, not.gopclntab. || Build info and scanning | | |
|
go version -m,debug.ReadBuildInfo()| ✅ Works |.go.buildinfois kept. || Dependency and CVE scanners (Trivy, Grype, Syft) | ✅ Works | They read the module list from build info. |
|
govulncheck -mode=binary| ⚠️ Should work | It reads build info and.gopclntab. Not tested on a stripped binary. || Go build ID (
go tool buildid) | ✅ Works | It's in a kept note section. || Debugging and inspection | | |
| Delve / gdb: breakpoints, stepping, printing variables | ❌ Disabled | Needs DWARF (removed by
-w). Usemise run compile:debug. || Core dump analysis with variables and types (
dlv core) | ❌ Disabled | Needs DWARF. ||
nm,go tool nm,objdump,go tool objdumpfunction names | ❌ Disabled | They read the symbol table (removed by-s). ||
addr2lineand other address-to-source tools | ❌ Disabled | Needs DWARF or the symbol table. || External uprobes on Beyla's own functions by name (
bpftrace,perf probe) | ❌ Disabled | They resolve function names through.symtab. Beyla instrumenting other apps is unaffected. || Size | | |
| Binary size (v3.43.0, linux/amd64) | ⬇️ 193.2 → ~141 MB | DWARF and symbol table removed (~52 MB). |
| Release tarball (gzip) | ⬇️ 72.9 → ~39.7 MB | Debug info compresses poorly, so stripping saves even more after compression. |
Linker flag reference:
cmd/link. Debug builds (compile:debug) and the coverage builds used by integration tests are unchanged.</details>
A few open questions:
It'd be good to test this, but I'm not sure what the most worthwhile tests would be?
Is this change a
cior afeat? One could argue that it's removing a feature...