From bdafd64910bb2b861cf90fa15f1fc93318b6fbf6 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Mon, 18 Dec 2023 18:52:07 -0700 Subject: [PATCH] Fix build on Darwin Working around https://github.com/NixOS/nixpkgs/issues/166205 --- crane.nix | 10 ++++++++++ package.nix | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/crane.nix b/crane.nix index 0c02289..e741a39 100644 --- a/crane.nix +++ b/crane.nix @@ -62,6 +62,11 @@ let ATTIC_DISTRIBUTOR = "attic"; + # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 + env = lib.optionalAttrs stdenv.cc.isClang { + NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; + }; + # See comment in `attic-tests` doCheck = false; @@ -130,6 +135,11 @@ let nativeBuildInputs = nativeBuildInputs ++ [ jq ]; + # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 + env = lib.optionalAttrs stdenv.cc.isClang { + NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; + }; + doCheck = true; buildPhaseCargoCommand = ""; diff --git a/package.nix b/package.nix index 1770f68..e97d464 100644 --- a/package.nix +++ b/package.nix @@ -49,6 +49,11 @@ in rustPlatform.buildRustPackage rec { ATTIC_DISTRIBUTOR = "attic"; + # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 + env = lib.optionalAttrs stdenv.cc.isClang { + NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; + }; + # Recursive Nix is not stable yet doCheck = false;