From fd0e56d60691efdb276dfa58e5b77f403ce7c53c Mon Sep 17 00:00:00 2001 From: whispers Date: Thu, 13 Aug 2026 18:31:45 -0400 Subject: [PATCH] taskflow: apply debian to work around gcc 16 regression GCC 16 has a regression in std::inclusive_scan where it modifies the input data instead of leaving it unchanged, causing some incorrect behavior and broken tests within taskflow. To work around this, Debian reimplemented equivalent correct behavior in one case and copied the input in another as appropriate. We adopt their approach to work around this regression. --- pkgs/by-name/ta/taskflow/package.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ta/taskflow/package.nix b/pkgs/by-name/ta/taskflow/package.nix index c7c88ff60060..5db3cbcd2e71 100644 --- a/pkgs/by-name/ta/taskflow/package.nix +++ b/pkgs/by-name/ta/taskflow/package.nix @@ -23,6 +23,21 @@ stdenv.mkDerivation (finalAttrs: { (replaceVars ./unvendor-doctest.patch { inherit doctest; }) + + # GCC 16 has a regression in std::inclusive_scan where it modifies the + # input data instead of leaving it unchanged, causing some incorrect + # behavior and broken tests within taskflow. To work around this, Debian + # reimplemented equivalent correct behavior in one case and copied the + # input in another as appropriate. We adopt their approach to work around + # this regression. + # gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126604 + # debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1133642 + # taskflow issue: https://github.com/taskflow/taskflow/issues/809 + (fetchpatch { + name = "gcc16-inclusive-scan-regression.patch"; + url = "https://salsa.debian.org/debian/taskflow/-/raw/039540a03c90cc825ce588f7ffae70db5472428f/debian/patches/fix-gcc16-inclusive-scan-move.patch"; + hash = "sha256-A8dUYKtjvvHAOrFGzDjat2hUHO1zoMbfdNnFJLZZbL0="; + }) ]; postPatch = '' @@ -37,8 +52,6 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - # FIXME remove once Taskflow is updated to 4.0.0 - (lib.cmakeFeature "CMAKE_CXX_STANDARD" "20") # building the tests implies running them in the buildPhase (lib.cmakeBool "TF_BUILD_TESTS" finalAttrs.finalPackage.doCheck) ];