Skip to content

build: a strip option, and the release recipe passes it - #9

Merged
mattrobenolt merged 1 commit into
mainfrom
release-strip
Nov 26, 2026
Merged

mattrobenolt merged 1 commit into
mainfrom
release-strip

Conversation

@mattrobenolt

Copy link
Copy Markdown
Member

The release binaries carry debug info. That is why the macOS archive is not reproducible, and it is why the archives are large.

-Dstrip removes the debug map. Zig 0.16's Mach-O linker writes each object file's mtime into the binary through that map's N_OSO stabs, and LC_UUID and the signature are computed over the result, so two builds of one tag differ. With the map gone they do not. The same flag drops debug info everywhere.

just release-build aarch64-linux /tmp/out, before and after this change:

6134296  bin/zigdoc   with debug_info, not stripped
 647960  bin/zigdoc   stripped

A 6.1 MB binary becomes 648 KB. The stripped binary runs: --help prints the usage, and zigdoc std.mem.Allocator resolves the same location.

The option has no default, so zig build on its own still builds with debug info; only the release recipe passes it. just test and just lint pass.

Part of baskingspot/gh-actions#2.

@mattrobenolt
mattrobenolt merged commit 879ed2a into main Nov 26, 2026
10 checks passed
@mattrobenolt
mattrobenolt deleted the release-strip branch November 26, 2026 19:34
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.

1 participant