Skip to content

build(flags): add -trimpath to binary builds#264

Merged
CalvinAllen merged 1 commit into
mainfrom
build/rnr/trimpath-binaries
May 13, 2026
Merged

build(flags): add -trimpath to binary builds#264
CalvinAllen merged 1 commit into
mainfrom
build/rnr/trimpath-binaries

Conversation

@CalvinAllen
Copy link
Copy Markdown
Contributor

Summary

  • Add -trimpath to go build in rnr.yaml (local builds) and both .github/workflows/build.yml and .github/workflows/release.yml (CI / release).
  • Drops the shim from 8.20 MB → 5.70 MB (-30%) and the main CLI by a similar proportion, with zero runtime behavior change.
  • First step in a broader effort to slim the shim; structural follow-up (provider import split) will be a separate PR.

Measured impact (local, Windows amd64, -s -w already in place)

Binary Before After Δ
dtvem-shim.exe 8.20 MB 5.70 MB -2.50 MB (-30%)
dtvem.exe 14.83 MB 10.94 MB -3.88 MB (-26%)

Savings compound across the five release platforms (windows-amd64/arm64, darwin-amd64/arm64, linux-amd64).

What -trimpath does

Replaces absolute filesystem paths in the compiled binary with the module path. Runtime behavior is unchanged. The only user-visible difference is in panic stack traces, which show module-relative paths instead of build-machine paths — a positive for reproducibility/debuggability of shipped binaries.

Test plan

  • ./rnr.cmd check passes (format, lint, full test suite — all packages OK)
  • Direct go build with new flags produces working binaries at the expected sizes
  • CI build workflow succeeds on this PR for all five matrix platforms
  • Smoke test: install the shim from a built artifact and run python --version / node --version to verify the runtime hot path is unaffected

Notes

Resolves #262

Strips local filesystem paths from compiled binaries, dropping the shim
from 8.2 MB to 5.7 MB (-30%) and the main CLI by a similar proportion,
with no runtime behavior change. Applied consistently across the rnr
task runner, the PR build workflow, and the release workflow.
@CalvinAllen CalvinAllen merged commit 62341f1 into main May 13, 2026
11 checks passed
@CalvinAllen CalvinAllen deleted the build/rnr/trimpath-binaries branch May 13, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

build(rnr): add -trimpath to binary builds

1 participant