Add workaround for symlink/directory conflict (bz 2097773).

Modify the jmol patch to timeout after 5 minutes.  This is a workaround
for recently observed jmol hangs, but is not a proper fix.
This commit is contained in:
Jerry James 2022-07-07 08:34:58 -06:00
parent aed4db5045
commit bbf8c7d8ee
2 changed files with 40 additions and 12 deletions

View file

@ -1,6 +1,6 @@
diff -up src/sage/interfaces/jmoldata.py.orig src/sage/interfaces/jmoldata.py diff -up src/sage/interfaces/jmoldata.py.orig src/sage/interfaces/jmoldata.py
--- src/sage/interfaces/jmoldata.py.orig 2021-05-09 16:00:11.000000000 -0600 --- src/sage/interfaces/jmoldata.py.orig 2022-05-15 16:11:11.000000000 -0600
+++ src/sage/interfaces/jmoldata.py 2021-05-28 11:36:18.844565672 -0600 +++ src/sage/interfaces/jmoldata.py 2022-07-06 11:03:43.155375965 -0600
@@ -148,8 +148,6 @@ class JmolData(SageObject): @@ -148,8 +148,6 @@ class JmolData(SageObject):
sage: print(os.path.exists(testfile)) # optional -- java sage: print(os.path.exists(testfile)) # optional -- java
True True
@ -10,16 +10,24 @@ diff -up src/sage/interfaces/jmoldata.py.orig src/sage/interfaces/jmoldata.py
target_native = targetfile target_native = targetfile
if sys.platform == 'cygwin': if sys.platform == 'cygwin':
@@ -173,10 +171,8 @@ class JmolData(SageObject): @@ -171,12 +169,14 @@ class JmolData(SageObject):
with open(scratchout, 'w') as jout:
# Now call the java application and write the file.
env = dict(os.environ) env = dict(os.environ)
env['LC_ALL'] = 'C' - env['LC_ALL'] = 'C'
env['LANG'] = 'C' - env['LANG'] = 'C'
- subprocess.call(["java", "-Xmx512m", "-Djava.awt.headless=true", - subprocess.call(["java", "-Xmx512m", "-Djava.awt.headless=true",
- "-jar", jmolpath, "-iox", "-g", size_arg, - "-jar", jmolpath, "-iox", "-g", size_arg,
- "-J", launchscript, "-j", imagescript], - "-J", launchscript, "-j", imagescript],
- stdout=jout, stderr=jout, env=env) - stdout=jout, stderr=jout, env=env)
+ env['LC_ALL'] = 'C.UTF-8'
+ env['LANG'] = 'C.UTF-8'
+ try:
+ subprocess.call(["jmol", "-n", "-g", size_arg, + subprocess.call(["jmol", "-n", "-g", size_arg,
+ "-J", launchscript, "-j", imagescript], stdout=jout) + "-J", launchscript, "-j", imagescript],
+ timeout=300, stdout=jout, stderr=jout, env=env)
+ except:
+ pass
if not os.path.isfile(targetfile): if not os.path.isfile(targetfile):
raise RuntimeError(f"Jmol failed to create file {targetfile}: {Path(scratchout).read_text()}") raise RuntimeError(f"Jmol failed to create file {targetfile}: {Path(scratchout).read_text()}")
os.unlink(scratchout) os.unlink(scratchout)

View file

@ -84,7 +84,7 @@
Name: sagemath Name: sagemath
Summary: A free open-source mathematics software system Summary: A free open-source mathematics software system
Version: 9.6 Version: 9.6
Release: 1%{?dist} Release: 2%{?dist}
# The file ${SAGE_ROOT}/COPYING.txt is the upstream license breakdown file # The file ${SAGE_ROOT}/COPYING.txt is the upstream license breakdown file
# Additionally, every $files section has a comment with the license name # Additionally, every $files section has a comment with the license name
# before files with that license # before files with that license
@ -1030,6 +1030,9 @@ sed -i 's/3\.11\.0/3.12.0/g' configure
# Allow use of libfplll 5.4.2 # Allow use of libfplll 5.4.2
sed -i 's/5\.4\.1/5.4.2/g' configure sed -i 's/5\.4\.1/5.4.2/g' configure
# Allow use of eclib 20220621
sed -i 's/20210625/20220621/g' configure
# Do not build with -march=native # Do not build with -march=native
sed -i 's/CFLAGS_MARCH="-march=native"/CFLAGS_MARCH=""/' configure sed -i 's/CFLAGS_MARCH="-march=native"/CFLAGS_MARCH=""/' configure
@ -1037,7 +1040,6 @@ sed -i 's/CFLAGS_MARCH="-march=native"/CFLAGS_MARCH=""/' configure
######################################################################## ########################################################################
%build %build
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
export CC=%{__cc}
export CPPFLAGS="-I%{_includedir}/4ti2 -I%{_includedir}/arb -I%{_includedir}/cddlib" export CPPFLAGS="-I%{_includedir}/4ti2 -I%{_includedir}/arb -I%{_includedir}/cddlib"
export ECMBIN=%{_bindir}/gmp-ecm export ECMBIN=%{_bindir}/gmp-ecm
export SAGE_ROOT=%{buildroot}%{SAGE_ROOT} export SAGE_ROOT=%{buildroot}%{SAGE_ROOT}
@ -1678,10 +1680,9 @@ mkdir -p %{SAGE_LOCAL}/var/lib/sage/installed/database_cremona_ellcurve-%{cremon
rm -fr %{SAGE_LOCAL}/var/lib/sage/installed/database_cremona_ellcurve-%{cremona_ver} rm -fr %{SAGE_LOCAL}/var/lib/sage/installed/database_cremona_ellcurve-%{cremona_ver}
%if %{with docs} %if %{with docs}
########################################################################
# Fix directory/symlink conflicts introduced by fix for bz 1875606.
# This can be removed when Fedora 36 reaches EOL.
%pretrans -n sagemath-doc-en -p <lua> %pretrans -n sagemath-doc-en -p <lua>
-- Fix directory/symlink conflicts introduced by fix for bz 1875606.
-- This can be removed when Fedora 36 reaches EOL.
paths = { paths = {
"%{SAGE_DOC}/html/en/_static/config", "%{SAGE_DOC}/html/en/_static/config",
"%{SAGE_DOC}/html/en/_static/extensions", "%{SAGE_DOC}/html/en/_static/extensions",
@ -1765,6 +1766,20 @@ for _, path in ipairs(paths) do
end end
end end
end end
-- Fix directory/symlink conflicts introduced by sagemath 3.5 -> 3.6 upgrade.
-- This can be removed when Fedora 40 reaches EOL.
paths2 = {
"%{SAGE_DOC}/html/en/reference/plot3d/_static",
"%{SAGE_DOC}/html/en/reference/repl/_static"
}
for _, path in ipairs(paths2) do
st = posix.stat(path)
if st and st.type == "link" then
os.remove(path)
end
end
%endif %endif
@ -2021,6 +2036,11 @@ end
######################################################################## ########################################################################
%changelog %changelog
* Tue Jul 5 2022 Jerry James <loganjerry@gmail.com> - 9.6-2
- Add workaround for symlink/directory conflict (bz 2097773)
- Modify the jmol patch to timeout after 5 minutes. This is a workaround for
recently observed jmol hangs, but is not a proper fix.
* Wed Jun 1 2022 Jerry James <loganjerry@gmail.com> - 9.6-1 * Wed Jun 1 2022 Jerry James <loganjerry@gmail.com> - 9.6-1
- Version 9.6 - Version 9.6
- Fix path to libSingular.so (bz 2073208) - Fix path to libSingular.so (bz 2073208)