From acc5ae74745868427a2e74f53d1c0b6236aa04a9 Mon Sep 17 00:00:00 2001 From: Liam Murphy Date: Tue, 14 Apr 2026 08:50:53 +1000 Subject: [PATCH] gfan: disable hardening, enable tests `libcxxhardeningfast` was causing some of Sage's tests to fail on Darwin. I disabled it, and then enabled gfan's tests so that failures like this will be attributed to gfan itself in future. --- pkgs/by-name/gf/gfan/package.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/gf/gfan/package.nix b/pkgs/by-name/gf/gfan/package.nix index 9c1d1864dc48..9ca8ed038811 100644 --- a/pkgs/by-name/gf/gfan/package.nix +++ b/pkgs/by-name/gf/gfan/package.nix @@ -35,7 +35,14 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = lib.optionalString stdenv.cc.isClang '' + # This test assumes that our implementation of sort behaves identically to the + # one used during development, which is not necessarily the case; update the + # expected result to be sorted using our copy of sort. + postPatch = '' + sort testsuite/0008PolynomialSetUnion/output -o testsuite/0008PolynomialSetUnion/output + sort testsuite/0008PolynomialSetUnion/outputNew -o testsuite/0008PolynomialSetUnion/outputNew + '' + + lib.optionalString stdenv.cc.isClang '' substituteInPlace Makefile --replace "-fno-guess-branch-probability" "" for f in $(find -name "*.h" -or -name "*.cpp"); do @@ -53,6 +60,15 @@ stdenv.mkDerivation (finalAttrs: { mpir cddlib ]; + hardeningDisable = [ "libcxxhardeningfast" ]; + + doCheck = true; + # The test runner still exits successfully when there are failed tests, so check + # stdout to see if anything failed. + checkPhase = '' + make check | tee "$TMPDIR/test.log" + ! grep -q "Failed tests:" "$TMPDIR/test.log" + ''; meta = { description = "Software package for computing Gröbner fans and tropical varieties";