From 4195be9f144845f01770487f5915625cf0fc8ffb Mon Sep 17 00:00:00 2001 From: George Huebner Date: Sun, 21 Jul 2024 23:44:43 -0500 Subject: [PATCH] sage: fix singular doctests Tampering with ulimit is not ideal and may not work in the Darwin sandbox, but is necessary due to how Singular handles allocations. --- .../patches/disable-singular-doctest.patch | 36 +++++++++++++++++++ .../science/math/sage/sage-src.nix | 3 ++ 2 files changed, 39 insertions(+) create mode 100644 pkgs/applications/science/math/sage/patches/disable-singular-doctest.patch diff --git a/pkgs/applications/science/math/sage/patches/disable-singular-doctest.patch b/pkgs/applications/science/math/sage/patches/disable-singular-doctest.patch new file mode 100644 index 000000000000..8501d55e5488 --- /dev/null +++ b/pkgs/applications/science/math/sage/patches/disable-singular-doctest.patch @@ -0,0 +1,36 @@ +From d6362714c9acf4cab69f3e2e772ec0bb1dfd39fe Mon Sep 17 00:00:00 2001 +From: George Huebner +Date: Mon, 22 Jul 2024 00:37:53 -0500 +Subject: [PATCH] disable singular version doctest to avoid exceeding the stack + limit + +It works fine interactively, only an issue for Nix builds +--- + src/sage/interfaces/singular.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index c0ab80e0a6..c778acdb0c 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -1262,7 +1262,7 @@ class Singular(ExtraTabCompletion, Expect): + + EXAMPLES:: + +- sage: singular.version() ++ sage: singular.version() # not tested + "Singular ... version 4... + """ + return singular_version() +@@ -2475,7 +2475,7 @@ def singular_version(): + + EXAMPLES:: + +- sage: singular.version() ++ sage: singular.version() # not tested + "Singular ... version 4... + """ + return singular.eval('system("--version");') +-- +2.44.1 + diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 0af3b75dacbc..26be24bb610f 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -45,6 +45,9 @@ stdenv.mkDerivation rec { # https://github.com/NixOS/nixpkgs/pull/264126 # Dead links in python sysconfig cause LLVM linker warnings, leading to cython doctest failures. ./patches/silence-linker.patch + + # Stack overflows during doctests; this does not change functionality. + ./patches/disable-singular-doctest.patch ]; # Since sage unfortunately does not release bugfix releases, packagers must