Heads up about Mac OS 27

Since updating to Mac OS 27 I am no longer able to build my project due to a mismatch in the libcxx headers when using Zig 0.16.0. The latest zig master works fine.

So if you rely on libcxx and are on 0.16.0 or older you might want to avoid Mac OS 27 for now.

Error:

error: sub-compilation of libcxx failed
    /Users/<me>/.zvm/0.16.0/lib/libcxx/include/__random/clamp_to_integral.h:47:58: note: use of undeclared identifier 'INFINITY'
      if (__r >= ::nextafter(static_cast<_RealT>(__max_val), INFINITY)) {
                                                             ^

If anyone has any ideas of how to get around this I would appreciate it.

When you pass a target to zig, it communicates to enter cross-compilation mode, which no longer observes your host system at all. So if you do that, then whether you are on Mac OS 27 or any other version, in theory should not matter.

I wasn’t aware of that trick, thanks!

I also had this issue when building another project while using the brew installed version of Zig 0.16 on macOS 27.0. Fixed it adding a fallback definition near the top of the clamp_to_integral header:

//
#include <cmath>
// ...
#ifndef INFINITY
#define INFINITY (__builtin_inff())
#endif

I’d go with andrewrk’s solution here, but I just wanted to throw in the fix that I used, and you’d likely have to go this route if you cannot use cross-compilation (e.g. using macOS system stuff).