onetbb: never treat warnings as fatal

onetbb often triggers compiler warnings upstream, and works around them
in an ad-hoc, per version manner:
88482f5f1a
bdbec20606
we encountered this failing while preparing for a gcc 16 upgrade in
Nixpkgs, and the same issue came up for gcc 15 and similar (#446139). it
is likely to come up again, as -Werror is extremely susceptible to
compiler and library changes (though onetbb admittedly has few
dependencies). additionally, while it may be useful for upstream onetbb,
it seems to provide little value to us downstream; we just end up
working around it. thus, we never treat warnings as errors by disabling
upstream's cmake flag for this purpose.
This commit is contained in:
whispers
2026-07-01 22:10:28 -04:00
parent 1dd0a5d9e5
commit 2012d325a3

View File

@@ -76,6 +76,9 @@ stdenv.mkDerivation (finalAttrs: {
cmakeFlags = [
(lib.cmakeBool "TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH" false)
# Treating compiler errors as warnings creates churn each compiler update,
# and provides little utility to us downstream.
(lib.cmakeBool "TBB_STRICT" false)
(lib.cmakeBool "TBB_TEST" finalAttrs.finalPackage.doCheck)
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
@@ -83,10 +86,6 @@ stdenv.mkDerivation (finalAttrs: {
];
env = {
# Fix build with modern gcc
# In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]',
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=stringop-overflow";
# Fix undefined reference errors with version script under LLVM.
NIX_LDFLAGS = lib.optionalString (
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"