bazel_7: fix darwin compilation with CLang 16 & recent nixpkgs/master

Workaround for #166205 similar to
https://github.com/NixOS/nixpkgs/commit/51451ac4069e18b5813b38d57cb68cd72b7ec51e

And warning fix similar to `bazel_6` fix for
```
external/upb~0.0.0-20220923-a547704/upb/mini_table.c:634:14: error: defining a type within '__builtin_offsetof' is a Clang extension [-Werror,-Wgnu-offsetof-extensions]
UPB_ASSERT(UPB_ALIGN_OF(upb_StringView) ==
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

authored by Dmitry Ivankov and committed by Guillaume Maudoux 306e8eaf 4d54ca89

+5 -1
+5 -1
pkgs/development/tools/build-managers/bazel/bazel_7/default.nix
··· 270 271 postPatch = 272 let 273 darwinPatches = '' 274 bazelLinkFlags () { 275 eval set -- "$NIX_LDFLAGS" ··· 284 285 # Framework search paths aren't added by bintools hook 286 # https://github.com/NixOS/nixpkgs/pull/41914 287 - export NIX_LDFLAGS+=" -F${CoreFoundation}/Library/Frameworks -F${CoreServices}/Library/Frameworks -F${Foundation}/Library/Frameworks -F${IOKit}/Library/Frameworks" 288 289 # libcxx includes aren't added by libcxx hook 290 # https://github.com/NixOS/nixpkgs/pull/41589 291 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1" 292 293 # This variable is used by bazel to propagate env vars for homebrew, 294 # which is exactly what we need too.
··· 270 271 postPatch = 272 let 273 + # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 274 + nixpkgs166205ldflag = lib.optionalString stdenv.cc.isClang "-l${stdenv.cc.libcxx.cxxabi.libName}"; 275 darwinPatches = '' 276 bazelLinkFlags () { 277 eval set -- "$NIX_LDFLAGS" ··· 286 287 # Framework search paths aren't added by bintools hook 288 # https://github.com/NixOS/nixpkgs/pull/41914 289 + export NIX_LDFLAGS+=" -F${CoreFoundation}/Library/Frameworks -F${CoreServices}/Library/Frameworks -F${Foundation}/Library/Frameworks -F${IOKit}/Library/Frameworks ${nixpkgs166205ldflag}" 290 291 # libcxx includes aren't added by libcxx hook 292 # https://github.com/NixOS/nixpkgs/pull/41589 293 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1" 294 + # for CLang 16 compatibility in external/upb dependency 295 + export NIX_CFLAGS_COMPILE+=" -Wno-gnu-offsetof-extensions" 296 297 # This variable is used by bazel to propagate env vars for homebrew, 298 # which is exactly what we need too.