git.iko.soy/typeable/nixpkgs
on master help sign in
bazel_4: Fix Bazel-built protoc segfault on macOS Monterey (#147097)

This was fixed by enabling the user_link_flags_feature for macosx cc_toolchain_config. References: - https://github.com/bazelbuild/bazel/issues/14216 - https://github.com/bazelbuild/bazel/pull/14275

commitc691e088d79dc154b15568b6dbaece1c1aa473e3 authorWael Nasreddine <wael.nasreddine@gmail.com> dateWed 24 Nov 2021, 10:55 (5 years ago) parent86c48e8
1 file changed+9−1
pkgs/development/tools/build-managers/bazel/bazel_4/default.nix+9−1
pkgs/development/tools/build-managers/bazel/bazel_4/default.nix+9−1
@@ -1,4 +1,4 @@
1−{ stdenv, callPackage, lib, fetchurl, fetchFromGitHub, installShellFiles
1+{ stdenv, callPackage, lib, fetchurl, fetchpatch, fetchFromGitHub, installShellFiles
22, runCommand, runCommandCC, makeWrapper, recurseIntoAttrs
33# this package (through the fixpoint glass)
44, bazel_self
@@ -214,6 +214,14 @@ stdenv.mkDerivation rec {
214214 src = ../bazel_rc.patch;
215215 bazelSystemBazelRCPath = bazelRC;
216216 })
217+
218+ # On macOS Monterey, protoc segfaults.
219+ # Issue: https://github.com/bazelbuild/bazel/issues/14216
220+ # Fix: https://github.com/bazelbuild/bazel/pull/14275
221+ (fetchpatch {
222+ url = "https://github.com/bazelbuild/bazel/commit/ae0a6c98d4f94abedbedb2d51c27de5febd7df67.patch";
223+ sha256 = "sha256-YcdxqjTMGI86k1wgFqxJqghv0kknAjlFQFpt4VccCTE=";
224+ })
217225 ] ++ lib.optional enableNixHacks ../nix-hacks.patch;
218226
219227