Skip to content

ci(release): strip the shipped tsc and fold identical code on Linux - #110

Merged
t3dotgg merged 6 commits into
mainfrom
goport-relsize2
Oct 28, 2026
Merged

t3dotgg merged 6 commits into
mainfrom
goport-relsize2

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Oct 25, 2026

Copy link
Copy Markdown
Member

The release linux-x64 tsc is 47.8 MB. Go's typescript@7.1.0-beta tsc is 24.5 MB. About 5 MB of ours is symbol tables (.symtab, .strtab) that Go strips from its release build (-ldflags "-s -w").

This PR changes the release recipe in two ways:

  • Strip the Linux and macOS tsc after all checks.
    • Linux uses strip --strip-all. A readelf -lW guard fails the step if the program headers move.
    • macOS uses Apple's strip -x, then runs --version to catch a bad arm64 signature.
    • The unstripped tsc is kept as the unstripped-tsc-<platform> artifact (90 days) for perf work.
    • This is not a cargo profile strip: a profile change changes -C metadata, and the PGO use build then silently matches no profile.
  • Identical code folding on both Linux PGO builds: rustup's rust-lld with --icf=all. build-pgo.sh gets an opt-in PGO_RUSTFLAGS, because it sets RUSTFLAGS itself.

Measured on a testbox with main's recipe (linux-x64):

bytes
before 47,838,008
icf only (unstripped artifact) 47,566,232 (-271,776)
shipped (icf + strip) 42,546,304 (-5,291,704, -11.1%)
  • Single-thread instructions: icf is 0.00% against a same-profile base. Cycles and dbook-lan wall are at noise level.
  • Output: equal on 6 projects in both modes, and pgo-train.sh compare gives the same output on 1,993 files.
  • Not tested off CI: the linux-arm64 icf link and the darwin strip. This PR's release.yml run (PR mode, no publish) is the first test of both.

Do not merge yet:

  • A stripped tsc prints panic frames as <unknown> in the API panic answer (api/session_p1.rs:2367) and in GOPORT_TRACE output. A follow-up lane prints frame addresses and the build-id there, so the unstripped artifact can name them. It should land first.
  • This changes the published binary, so it needs Theo's approval.

Part of the binary-size work (state notes size-plan-decisions-2026-10-25, size2a-result-2026-10-25).

This PR was made by Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

t3dotgg and others added 4 commits October 24, 2026 22:53
The linux-x64 tsc is 48.0 MB, about twice Go's 24.5 MB. 5.0 MB of it is the
symbol table, and about 0.27 MB is identical functions that GNU ld cannot fold.

- Strip the Linux tsc (strip --strip-all) and the macOS tsc (strip -x) after
  all checks. The Linux step fails if the program headers change. The
  unstripped tsc is the artifact unstripped-tsc-<platform>, for perf work.
  The strip is not a cargo profile setting: a profile change changes
  -C metadata, and the use build would then match no function of the profile.
- Both Linux PGO builds link with rustup's rust-lld and --icf=all, through a
  new PGO_RUSTFLAGS in build-pgo.sh (it sets RUSTFLAGS itself). The plain tsc
  keeps GNU ld, so the PGO check compares a folded tsc with an unfolded one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: e431d471-bae9-4f1b-8cf0-0184c2c850da

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

t3dotgg and others added 2 commits October 27, 2026 18:22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@t3dotgg
t3dotgg merged commit fef7dfd into main Oct 28, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant