Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package jython for openSUSE:Factory checked in at 2023-09-26 22:01:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jython (Old) and /work/SRC/openSUSE:Factory/.jython.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jython" Tue Sep 26 22:01:41 2023 rev:32 rq:1113522 version:2.7.3 Changes: -------- --- /work/SRC/openSUSE:Factory/jython/jython.changes 2023-06-30 19:59:52.406000765 +0200 +++ /work/SRC/openSUSE:Factory/.jython.new.1770/jython.changes 2023-09-26 22:24:26.921803443 +0200 @@ -1,0 +2,14 @@ +Mon Sep 25 16:49:29 UTC 2023 - Fridrich Strba <fst...@suse.com> + +- Added patches: + * jython-java8compat.patch + + use release=8 on compilers that support it + * jython-reproducible-builds.patch + + preserve mtimes of files since they get embedded in the + resultiong class files + + use relative paths of files that get included in antlr + getGrammar* methods + * jython-reproducible-now.patch + + use SOURCE_DATE_EPOCH for "now" if the variable is set + +------------------------------------------------------------------- New: ---- jython-java8compat.patch jython-reproducible-builds.patch jython-reproducible-now.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jython.spec ++++++ --- /var/tmp/diff_new_pack.hnLpsq/_old 2023-09-26 22:24:28.481859794 +0200 +++ /var/tmp/diff_new_pack.hnLpsq/_new 2023-09-26 22:24:28.481859794 +0200 @@ -32,6 +32,9 @@ Patch1: %{name}-dont-validate-pom.patch Patch2: %{name}-cachedir.patch Patch3: %{name}-fix-tty-detection.patch +Patch4: %{name}-reproducible-now.patch +Patch5: %{name}-reproducible-builds.patch +Patch6: %{name}-java8compat.patch BuildRequires: ant BuildRequires: ant-junit BuildRequires: antlr3-java ++++++ jython-java8compat.patch ++++++ diff --git a/build.xml b/build.xml index 52dfe71..43d7649 100644 --- a/build.xml +++ b/build.xml @@ -91,8 +91,8 @@ informix.jar = ../support/jdbc-4.10.12.jar <property file="${user.home}/ant.properties" /> <property file="${basedir}/ant.properties" /> - <property name="jython.java.version" value="1.8" /> - <property name="jdk.source.version" value="1.8" /> + <property name="jython.java.version" value="8" /> + <property name="jdk.source.version" value="8" /> <!-- Designate the official release encoded in parts. In normal times, this is the *next* official release, e.g. 2.7.2b2 while working towards 2.7.2b2, and sys.version will be @@ -681,6 +681,7 @@ The text for an official release would continue like ... destdir="${compile.dir}" target="${jdk.target.version}" source="${jdk.source.version}" + release="${jdk.target.version}" debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}" @@ -743,6 +744,7 @@ The text for an official release would continue like ... <javac destdir="${compile.dir}" target="${jdk.target.version}" source="${jdk.source.version}" + release="${jdk.target.version}" debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}" @@ -763,6 +765,7 @@ The text for an official release would continue like ... destdir="${compile.dir}" target="${jdk.target.version}" source="${jdk.source.version}" + release="${jdk.target.version}" debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}" @@ -795,6 +798,7 @@ The text for an official release would continue like ... destdir="${test.compile.dir}" target="${jdk.target.version}" source="${jdk.source.version}" + release="${jdk.target.version}" debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}" @@ -1209,6 +1213,7 @@ The text for an official release would continue like ... destdir="${compile.dir}" target="${jdk.target.version}" source="${jdk.source.version}" + release="${jdk.target.version}" debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}" ++++++ jython-reproducible-builds.patch ++++++ diff --git a/build.xml b/build.xml index 52dfe71..0d41bdf 100644 --- a/build.xml +++ b/build.xml @@ -721,8 +721,12 @@ The text for an official release would continue like ... <arg path="${out}"/> <arg value="-lib"/> <arg path="${out}"/> - <arg file="${basedir}/grammar/Python.g"/> - <arg file="${basedir}/grammar/PythonPartial.g"/> + <!-- Reproducible builds + Replace 'arg file=...' with 'arg value=...' to prevent using + the absolute filename, because these filenames are inserted + into the antlr generated getGrammar* methods --> + <arg value="grammar/Python.g"/> + <arg value="grammar/PythonPartial.g"/> <classpath refid="main.classpath"/> </java> @@ -1151,7 +1155,10 @@ The text for an official release would continue like ... </target> <target name="copy-lib" depends="common-dirs, copy-cpythonlib"> - <copy todir="${dist.dir}/Lib"> + <!-- Reproducible builds + Use attribute preservelastmodified="true" because these files' + mtime are stored into the generated $py.class files --> + <copy todir="${dist.dir}/Lib" preservelastmodified="true"> <fileset dir="${basedir}/Lib"> <exclude name="**/*.class"/> </fileset> @@ -1175,7 +1182,10 @@ The text for an official release would continue like ... <copy file="${basedir}/lib-python/LICENSE.txt" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" /> - <copy todir="${dist.dir}/Lib"> + <!-- Reproducible builds + Use attribute preservelastmodified="true" because these files' + mtime are stored into the generated $py.class files --> + <copy todir="${dist.dir}/Lib" preservelastmodified="true"> <fileset dir="${python.lib}" excludes="**/*.pyc, **/*.pyo" includesfile="${basedir}/CPythonLib.includes"> <!-- The include file gets all of lib-python/2.7's test directory, but we only want the ones from Jython's Lib. --> <present present="srconly" targetdir="${basedir}/Lib"/> ++++++ jython-reproducible-now.patch ++++++ diff --git a/src/org/python/modules/posix/PosixModule.java b/src/org/python/modules/posix/PosixModule.java index e3a8dd9..07d4b43 100644 --- a/src/org/python/modules/posix/PosixModule.java +++ b/src/org/python/modules/posix/PosixModule.java @@ -1144,7 +1144,7 @@ public class PosixModule implements ClassDictInit { if (times == Py.None) { // FIXME dynamically bind to java.time.Instant, available in Java 8, // to potentially get higher resolution (nanosecond) time - atime = mtime = FileTime.from( + atime = mtime = FileTime.from(System.getenv("SOURCE_DATE_EPOCH") != null ? 1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")) : System.currentTimeMillis(), TimeUnit.MILLISECONDS); } else if (times instanceof PyTuple && times.__len__() == 2) { atime = getFileTime(times.__getitem__(0)); diff --git a/src/org/python/modules/random/PyRandom.java b/src/org/python/modules/random/PyRandom.java index f5ea8d9..0dc4881 100644 --- a/src/org/python/modules/random/PyRandom.java +++ b/src/org/python/modules/random/PyRandom.java @@ -45,7 +45,7 @@ public class PyRandom extends PyObject { final void Random_seed(PyObject seed) { long n; if (seed == null) { - seed = new PyLong(System.currentTimeMillis()); + seed = new PyLong(System.getenv("SOURCE_DATE_EPOCH") != null ? 1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")) : System.currentTimeMillis()); } if (seed instanceof PyLong) { PyLong max = new PyLong(Long.MAX_VALUE); diff --git a/src/org/python/modules/time/Time.java b/src/org/python/modules/time/Time.java index ebd9871..cf2218d 100644 --- a/src/org/python/modules/time/Time.java +++ b/src/org/python/modules/time/Time.java @@ -131,6 +131,9 @@ public class Time implements ClassDictInit } public static double time() { + if (System.getenv("SOURCE_DATE_EPOCH") != null) { + return Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")); + } return System.currentTimeMillis()/1000.0; }