Subject: recent changes in bazel-zig-cc

From: Motiejus Jakštys <[email-masked]>
Date: Fri, 10 Dec 2021 09:57:33 +0200

Hi bazel-zig-cc users,

Due to a recent bug-fixing spree in zig, bazel-zig-cc improved quite a
bit:

- `zig c++` no longer errs with the dreaded FileNotFound[1]. This was
  very prominent on many-core machines, and now unblocked larger-scale
  tests.
- can compile Darwin again: x86_64[2] and aarch64[3]. Although if you
  are interested in compiling for Darwin, Jakub's comments in [3] are
  must-read.

My only short-term wish-list from Zig today is [4]: if Foundation
framework is requested, but zig doesn't find it, the compiler should
fail. Currently only a warning is emitted, and the binary is wedged with
a possibly "difficult to track runtime exception"[5]:

```
warning(link): framework not found for '-framework CoreFoundation'
warning(link): Framework search paths:
```

I added an Upcoming Wishlist category to the README[6], which is:

- Move Zig cache path to bazel root, so bazel clean --expunge clears the
  zig cache.
- Provide a way to specify alternative URLs for the zig toolchain
  (currently zig is downloaded from jakstys.lt, which is nuts).
- Rename @zig_sdk//:<toolchain>_toolchain to
  @zig_sdk//toolchain:<toolchain> or similar; so the user-facing targets
  are in their own namespace.
- Provide a way to specify sysroot for Darwin (OSX). See [#Compiling OS X
  executables] for an ongoing discussion.

As bazel-zig-cc is only ~10% of my $dayjob, I am not planning to work on
the above any time soon. But it gives a nice starting point for a
question "how do I help/contribute"?

Zig 0.9.0 is 10 days away, I will cut bazel-zig-cc 0.4.0 once that
happens.

[1]: https://github.com/ziglang/zig/issues/9431
[2]: https://github.com/ziglang/zig/issues/10297
[3]: https://github.com/ziglang/zig/issues/10299
[4]: https://github.com/ziglang/zig/issues/10299#issuecomment-990404953
[5]: https://github.com/ziglang/zig/issues/10299#issuecomment-989153750