about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/math/sage/patches/fix-ecl-race.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/math/sage/patches/fix-ecl-race.patch')
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/patches/fix-ecl-race.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/fix-ecl-race.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/fix-ecl-race.patch
new file mode 100644
index 000000000000..6056416c3a28
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/patches/fix-ecl-race.patch
@@ -0,0 +1,19 @@
+diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
+index 02e18e67e7..2ebf6eb35f 100644
+--- a/src/sage/doctest/forker.py
++++ b/src/sage/doctest/forker.py
+@@ -1075,6 +1075,14 @@ class SageDocTestRunner(doctest.DocTestRunner, object):
+             sage: set(ex2.predecessors) == set([ex0,ex1])
+             True
+         """
++
++        # Fix ECL dir race conditions by using a separate dir for each process
++        # (https://trac.sagemath.org/ticket/26968)
++        os.environ['MAXIMA_USERDIR'] = "{}/sage-maxima-{}".format(
++            tempfile.gettempdir(),
++            os.getpid()
++        )
++
+         if isinstance(globs, RecordingDict):
+             globs.start()
+         example.sequence_number = len(self.history)