ziglang / zig-bootstrap

take off every zig
368 stars 86 forks source link

build: add BUILDMODE #150

Open motiejus opened 1 year ago

motiejus commented 1 year ago

We currently have 2 "popular" kinds of release modes:

This script intends to be as prescriptive as possible, so we specifically avoid other valid combinations (e.g. ReleaseSmall). Therefore no such things like unvalidated "extra args" for zig.

If you want to add a new build mode and feel like a wide population would benefit from it, submit a new issue and let's talk.

Example invocation:

$ ./build x86_64-linux-gnu.2.28 baseline ReleaseSafeDbgSym
Build configuration:
Version:       0.11.0-dev.2680+a1aa55ebe
Target:        x86_64-linux-gnu.2.28
MCPU:          baseline
Optimize:      ReleaseSafe
Debug symbols: Yes

<... build output ...>
motiejus commented 1 year ago

Since I like compressing things and comparing see how well they do it:

$ ls --block-size=K -1sS *.tar.xz | tac
36404K zig-x86_64-linux-musl-baseline-min.tar.xz
40932K zig-x86_64-linux-musl-baseline.tar.xz
53520K zig-x86_64-linux-musl-baseline-dbg.tar.xz

The first one is ReleaseSmall, dependencies compiled with -DCMAKE_BUILD_TYPE=MinSizeRel. The baseline is what we have today (ReleaseFast+strip) and the last one is ReleaseSafe + debug symbols.