Skip to content

Commit

Permalink
Fix build on darwin_arm64 (Apple M1) (digital-asset#13951)
Browse files Browse the repository at this point in the history
Co-authored-by: Claudio Bley <[email protected]>
  • Loading branch information
avdv and cbley-da authored May 23, 2022
1 parent 25928d8 commit 46641db
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nix/bazel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ let shared = rec {
zip
;

ghc_lib_deps = pkgs.buildEnv {
# ghc-lib needs GHC 8.6.5, but the first version to support Darwin arm64 /
# Apple M1 is GHC 8.10.7. Use GHC 8.6.5 on aarch64_darwin via Rosetta to build
# the ghc-lib cabal sdist.
ghc_lib_pkgs = if system == "aarch64-darwin" then import ./nixpkgs.nix { system = "x86_64-darwin"; } else pkgs;

ghc_lib_deps = with ghc_lib_pkgs; buildEnv {
name = "ghc-lib-deps";
paths = with pkgs; [
paths = [
autoconf
automake
cabal-install
Expand All @@ -41,15 +46,15 @@ let shared = rec {
gnumake
ncurses
perl
pkgs.haskell.compiler.ghc865Binary
haskell.compiler.ghc865Binary
stdenv.cc # ghc-lib needs `gcc` or `clang`, but Bazel provides `cc`.
xz
] ++ (
if stdenv.isDarwin
then [stdenv.cc.bintools.bintools xcodebuild]
else []
);
ignoreCollisions = pkgs.stdenv.isDarwin;
ignoreCollisions = stdenv.isDarwin;
};

postgresql_10 = if pkgs.buildPlatform.libc == "glibc"
Expand Down

0 comments on commit 46641db

Please sign in to comment.