Subject: bazel-zig-cc v0.4.0-rc2

From: Motiejus Jakštys <[email-masked]>
Date: Wed, 15 Dec 2021 15:13:06 +0200

Hi folks,

I released v0.4.0-rc2, this time only upgrading zig to
0.9.0-dev.1968+ff93486d0 (from 1950). Two notable changes with regards
to `zig cc`:

- [darwin] zig cc will now fail hard if `-framework` is specified, but
  not found. It used to produce a strange-looking, likely-unworkable
  binary.
- glibc stubs are fixed[2]. I have been waiting for this for a long
  time. More on this in HN[3].

These resolve the last known high-severity issues. Thanks zig team! As I
am not expecting any final-day fixes in zig itself, there likely won't
be an rc3. A few weeks after 0.9.0 is released, I am planning to remove
the dev versions from my mirror[4].

Tip of the day
--------------

This is helpful in `.bazelrc`:

    build --compilation_mode=opt

This makes non-tests to be compiled with -O2. Tests will be compiled
without optimizations, making compilation faster, and retaining
UBSAN[5].

Open questions
--------------

The question from last week[6] still holds: how to adjust CFLAGS for an
external Bazel project?

Motiejus

[1]: https://github.com/ziglang/zig/pull/10312
[2]: https://github.com/ziglang/zig/pull/10330
[3]: https://news.ycombinator.com/item?id=29538264
[4]: https://dl.jakstys.lt/zig/
[5]: https://github.com/ziglang/zig/issues/4830#issuecomment-605491606
[6]: https://lists.sr.ht/~motiejus/bazel-zig-cc/%3C20211213023816.obgjrpaxt445lzpn%40mtpad.i.jakstys.lt%3E