git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #65802 from timokau/sage-transient-debug

sage: add patch to debug transient issue

commit192197dc6cd7b04984c07a4d99ed84b161776e39 authorTimo Kaufmann <timokau@zoho.com> dateSat 17 Aug 2019, 00:33 (7 years ago) parent63ce6bf41bb319
4 files changed+45−1
pkgs/applications/science/math/sage/dist-tests.nix+17 pkgs/applications/science/math/sage/patches/configurationpy-error-verbose.patch+19 pkgs/applications/science/math/sage/sage-src.nix+5−1 pkgs/applications/science/math/sage/sage-tests.nix+4
pkgs/applications/science/math/sage/dist-tests.nixnew file+17
@@ -0,0 +1,17 @@
1+# Lists past failures and files associated with it. The intention is to build
2+# up a subset of a testsuite that catches 95% of failures that are relevant for
3+# distributions while only taking ~5m to run. This in turn makes it more
4+# reasonable to re-test sage on dependency changes and makes it easier for
5+# users to override the sage derivation.
6+# This is an experiment for now. If it turns out that there really is a small
7+# subset of files responsible for the vast majority of packaging tests, we can
8+# think about moving this upstream.
9+[
10+ "src/sage/env.py" # [1]
11+ "src/sage/misc/persist.pyx" # [1]
12+ "src/sage/misc/inline_fortran.py" # [1]
13+ "src/sage/repl/ipython_extension.py" # [1]
14+]
15+
16+# Numbered list of past failures to annotate files with
17+# [1] PYTHONPATH related issue https://github.com/NixOS/nixpkgs/commit/ec7f569211091282410050e89e68832d4fe60528
pkgs/applications/science/math/sage/patches/configurationpy-error-verbose.patchnew file+19
@@ -0,0 +1,19 @@
1+diff --git a/src/sage/repl/configuration.py b/src/sage/repl/configuration.py
2+index 67d7d2accf..18279581e2 100644
3+--- a/src/sage/repl/configuration.py
4++++ b/src/sage/repl/configuration.py
5+@@ -9,10 +9,11 @@ the IPython simple prompt is being used::
6+ sage: cmd = 'print([sys.stdin.isatty(), sys.stdout.isatty()])'
7+ sage: import pexpect
8+ sage: output = pexpect.run(
9+- ....: 'bash -c \'echo "{0}" | sage\''.format(cmd),
10++ ....: 'bash -c \'export SAGE_BANNER=no; echo "{0}" | sage\''.format(cmd),
11+ ....: ).decode('utf-8', 'surrogateescape')
12+- sage: 'sage: [False, True]' in output
13+- True
14++ sage: print(output)
15++ sage...[False, True]
16++ sage...Exiting Sage ...
17+ """
18+
19+ #*****************************************************************************
pkgs/applications/science/math/sage/sage-src.nix+5−1
@@ -61,7 +61,11 @@ stdenv.mkDerivation rec {
6161 # Since sage unfortunately does not release bugfix releases, packagers must
6262 # fix those bugs themselves. This is for critical bugfixes, where "critical"
6363 # == "causes (transient) doctest failures / somebody complained".
64− bugfixPatches = [ ];
64+ bugfixPatches = [
65+ # To help debug the transient error in
66+ # https://trac.sagemath.org/ticket/23087 when it next occurs.
67+ ./patches/configurationpy-error-verbose.patch
68+ ];
6569
6670 # Patches needed because of package updates. We could just pin the versions of
6771 # dependencies, but that would lead to rebuilds, confusion and the burdons of
pkgs/applications/science/math/sage/sage-tests.nix+4
@@ -51,6 +51,10 @@ stdenv.mkDerivation rec {
5151 export HOME="$TMPDIR/sage-home"
5252 mkdir -p "$HOME"
5353
54+ # avoid running out of memory with many threads in subprocesses, see
55+ # https://github.com/NixOS/nixpkgs/pull/65802
56+ export GLIBC_TUNABLES=glibc.malloc.arena_max=4
57+
5458 echo "Running sage tests with arguments ${timeSpecifier} ${patienceSpecifier} ${testArgs}"
5559 "sage" -t --nthreads "$NIX_BUILD_CORES" --optional=sage ${timeSpecifier} ${patienceSpecifier} ${testArgs}
5660 '';