From 6165a22be30adc7ae8fbf4474e84878c1d17ef77 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Fri, 27 Feb 2026 09:03:32 +0900 Subject: [PATCH] Suppress cc-wrapper --target mismatch warning on aarch64-darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GNU config.sub normalises to "aarch64-apple-darwin" while Apple's LLVM toolchain (and nix cc-wrapper's @defaultTarget@) uses "arm64-apple-darwin". Older GHC versions pass --target=aarch64-apple-darwin which triggers a noisy warning from the cc-wrapper's add-clang-cc-cflags-before hook on every compiler invocation. The warning is harmless — clang handles both triples identically — but it pollutes stderr and causes thousands of GHC testsuite failures due to unexpected compiler output. Set NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1 in the env script before sourcing stdenv/setup to suppress this warning. --- flake.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flake.nix b/flake.nix index 13a910a..efdba66 100644 --- a/flake.nix +++ b/flake.nix @@ -369,6 +369,16 @@ # ''${NIX_ENFORCE_PURITY-1} keep the empty value instead of defaulting. export NIX_ENFORCE_PURITY= + # Suppress the cc-wrapper --target mismatch warning on aarch64-darwin. + # GNU config.sub normalises to "aarch64-apple-darwin" while Apple's + # LLVM toolchain (and nix cc-wrapper's @defaultTarget@) uses + # "arm64-apple-darwin". GHC passes --target=aarch64-apple-darwin which + # triggers a noisy warning from cc-wrapper's add-clang-cc-cflags-before + # hook. The warning itself is harmless — clang handles both triples + # identically — but it pollutes stderr and causes thousands of GHC + # testsuite failures via unexpected compiler output. + export NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1 + # Source stdenv's setup.sh to initialize the development # environment. This runs all setup hooks (cc-wrapper, # pkg-config-wrapper, etc.) and populates NIX_CFLAGS_COMPILE,