Using bazel in a nix shell on macOS


I’m trying to setup a nix development environment for the monorepo that I work on at my job and I’m hitting an issue when running any bazel target that has to compile C/C++. It’s like it’s using the wrong compiler (C compiler for C++) as I get errors like fatal error: 'iostream' file not found
#include <iostream>

I’ve created a simple reproduction repo with steps in the README to show it working outside of nix and then failing when run in nix.

I’ve got everything else working so this is the last thing I need to figure out before I can show it to the rest of my team.

Has anyone run into this before or have any ideas how to fix it?

1 Like