Skip to content

Commit

Permalink
bazel_4: Fix Bazel-built protoc segfault on macOS Monterey
Browse files Browse the repository at this point in the history
This was fixed by enabling the user_link_flags_feature for macosx cc_toolchain_config.

References:
- bazelbuild/bazel#14216
- bazelbuild/bazel#14275

(cherry picked from commit dc8d4f3)
  • Loading branch information
kalbasit authored and github-actions[bot] committed Nov 24, 2021
1 parent 71683e8 commit 4aef02d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkgs/development/tools/build-managers/bazel/bazel_4/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, callPackage, lib, fetchurl, fetchFromGitHub, installShellFiles
{ stdenv, callPackage, lib, fetchurl, fetchpatch, fetchFromGitHub, installShellFiles
, runCommand, runCommandCC, makeWrapper, recurseIntoAttrs
# this package (through the fixpoint glass)
, bazel_self
Expand Down Expand Up @@ -214,6 +214,14 @@ stdenv.mkDerivation rec {
src = ../bazel_rc.patch;
bazelSystemBazelRCPath = bazelRC;
})

# On macOS Monterey, protoc segfaults.
# Issue: https://github.com/bazelbuild/bazel/issues/14216
# Fix: https://github.com/bazelbuild/bazel/pull/14275
(fetchpatch {
url = "https://github.com/bazelbuild/bazel/commit/ae0a6c98d4f94abedbedb2d51c27de5febd7df67.patch";
sha256 = "sha256-YcdxqjTMGI86k1wgFqxJqghv0kknAjlFQFpt4VccCTE=";
})
] ++ lib.optional enableNixHacks ../nix-hacks.patch;


Expand Down

0 comments on commit 4aef02d

Please sign in to comment.