Suppress cc-wrapper --target mismatch warning on aarch64-darwin#237
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1in the env script before sourcingstdenv/setup--target aarch64-apple-darwin != arm64-apple-darwinwarning on every compiler invocation on aarch64-darwinContext
GNU
config.subnormalises the Apple AArch64 triple toaarch64-apple-darwin, while Apple's LLVM toolchain and nix cc-wrapper's@defaultTarget@usearm64-apple-darwin. Older GHC versions (without stable-haskell/ghc#149) pass--target=aarch64-apple-darwinto the compiler, triggering the warning.The warning itself is harmless — clang handles both triples identically — but it pollutes stderr and causes 5,400+ GHC testsuite failures due to unexpected compiler output.
A companion fix in GHC's
ghc-toolchain(PR #149) normalises the LLVM target at build-system level, but this devx-level fix is needed for older GHC versions that don't have that change.Test plan
nix flake check --no-buildpasses (pre-existing store-path issues only)ghc98-minimal-envscript and verified it contains the export--targetmismatch warning