aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/Compile.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2025-07-23 11:59:19 +0100
committerMatthew Lugg <mlugg@mlugg.co.uk>2025-07-25 16:24:02 +0100
commitbb71a18ede1f976ad6d6bb7e84b88f0edc7d30e9 (patch)
tree0e9e71ae3feab6895666cade38096a1a8e3e2bda /lib/std/Build/Step/Compile.zig
parentd407c4e52b49a23ba039c6e2f324bed95bc5130c (diff)
downloadzig-bb71a18ede1f976ad6d6bb7e84b88f0edc7d30e9.tar.gz
zig-bb71a18ede1f976ad6d6bb7e84b88f0edc7d30e9.zip
init: replace '--strip' with '--minimal'
This option never worked properly (it emitted wrongly-formatted code), and it doesn't seem particularly *useful* -- someone who's proficient enough with `std.Build` to not need explanations probably just wants to write their own thing. Meanwhile, the use case of writing your own `build.zig` was extremely poorly served, because `build.zig.zon` *needs* to be generated programmatically for a correct `fingerprint`, but the only ways to do that were to a) do it wrong and get an error, or b) get the full init template and delete the vast majority of it. Both of these were pretty clunky, and `-s` didn't really help. So, replace this flag with a new one, `--minimal`/`-m`, which uses a different template. This template is trivial enough that I opted to just hardcode it into the compiler for simplicity. The main job of `zig init -m` is to generate a correct `build.zig.zon` (if it is unable to do this, it exits with a fatal error). In addition, it will *attempt* to generate a tiny stub `build.zig`, with only an `std` import and an empty `pub fn build`. However, if `build.zig` already exists, it will avoid overwriting it, and doesn't even complain. This serves the use case of writing `build.zig` manually and *then* running `zig init -m` to generate an appropriate `build.zig.zon`.
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
0 files changed, 0 insertions, 0 deletions