From ebf46e57648aa93b8e0a38e73473133291a38120 Mon Sep 17 00:00:00 2001 From: Tobias Bergkvist Date: Thu, 16 Dec 2021 21:29:21 +0100 Subject: [PATCH] makeBinaryWrapper: Fix issues on aarch64-darwin/macOS 12 (Monterey) Sanitizers don't seem to be present on aarch64-darwin/macOS 12 (Monterey), so they are removed from the aarch64-darwin tests. Switching from nativeBuildInputs to buildInputs and adding cc to the deps list caused some strange error messages to go away. --- pkgs/test/make-binary-wrapper/default.nix | 2 +- pkgs/top-level/all-packages.nix | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/test/make-binary-wrapper/default.nix b/pkgs/test/make-binary-wrapper/default.nix index 7b4d0b26b5cc..b5bbf994ffa3 100644 --- a/pkgs/test/make-binary-wrapper/default.nix +++ b/pkgs/test/make-binary-wrapper/default.nix @@ -1,7 +1,7 @@ { lib, coreutils, python3, gcc, writeText, writeScript, runCommand, makeBinaryWrapper }: let - env = { nativeBuildInputs = [ makeBinaryWrapper ]; }; + env = { buildInputs = [ makeBinaryWrapper ]; }; envCheck = runCommand "envcheck" env '' ${gcc}/bin/cc -Wall -Werror -Wpedantic -o $out ${./envcheck.c} ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b9645f975b3b..3755fd6bcd56 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -697,8 +697,15 @@ with pkgs; ''; in makeSetupHook { - deps = [ dieHook ]; - substitutions.passthru.tests = callPackage ../test/make-binary-wrapper { inherit makeBinaryWrapper; }; + deps = [ dieHook cc ]; + substitutions.passthru.tests = callPackage ../test/make-binary-wrapper { + makeBinaryWrapper = makeBinaryWrapper.override { + sanitizers = (if stdenv.isDarwin && stdenv.isAarch64 + then [ ] + else [ "undefined" "address" ] + ); + }; + }; } script; in lib.makeOverridable f {