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.
This commit is contained in:
whispers
2026-08-13 18:31:45 -04:00
parent e21a28da5e
commit fd0e56d606

View File

@@ -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)
];