From 2012d325a3adafdd79568e697338a045218ebc54 Mon Sep 17 00:00:00 2001 From: whispers Date: Wed, 1 Jul 2026 22:10:28 -0400 Subject: [PATCH] onetbb: never treat warnings as fatal onetbb often triggers compiler warnings upstream, and works around them in an ad-hoc, per version manner: https://github.com/uxlfoundation/oneTBB/commit/88482f5f1a122896336d19bbeed84af8773c2e9f https://github.com/uxlfoundation/oneTBB/commit/bdbec2060633e28b6b0e2f89e39297cf89b63e8c 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. --- pkgs/by-name/on/onetbb/package.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/on/onetbb/package.nix b/pkgs/by-name/on/onetbb/package.nix index c5aac8e1963a..de2f382d2517 100644 --- a/pkgs/by-name/on/onetbb/package.nix +++ b/pkgs/by-name/on/onetbb/package.nix @@ -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"