summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-11-09 18:48:38 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-12 11:29:26 +0100
commitbb58293296f843654045d7b0eba6899d11533a4a (patch)
treebd5db38bab2e271e7f8a444e677dee0bc8d1b086 /external
parentf8a30a87a9d0c68dc16d5fa2ca63f687b1d90da1 (diff)
rhino: unbreak build on Fedora 34
Sometime during the Fedora 34 lifecycle, ant started to put /usr/share/java/rhino.jar on the classpath used to invoke javac, which results in: [javac] workdir/UnpackedTarball/rhino/src/org/mozilla/javascript/optimizer/Codegen.java:202: error: reference to Hashtable is ambiguous [javac] Hashtable possibleDirectCalls = null; [javac] ^ [javac] both class java.util.Hashtable in java.util and class org.mozilla.javascript.Hashtable in org.mozilla.javascript match Indeed /usr/share/java/rhino.jar contains a class org.mozilla.javascript.Hashtable, while it doesn't exist yet in the older rhino1_5R5.zip that is bundled. The problem is that the package ant-apache-bsf contains the file /etc/ant.d/apache-bsf which references the system rhino jar. It turns out that reading the /etc/ant.d/* files in the shell script /usr/bin/ant can be suppressed by setting the variable OPT_JAR_LIST to a non-empty value, which is documented as "A user should request optional jars and their dependencies via the OPT_JAR_LIST variable", but which is sadly ignored if set to an empty value. Another way to fix the problem is to patch the property build.sysclasspath to "ignore" in build.xml. http://ant.apache.org/manual/sysclasspath.html Change-Id: I6d82eb226e5d01d094ebe044dbdada85b8687814 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124934 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'external')
-rw-r--r--external/rhino/UnpackedTarball_rhino.mk1
-rw-r--r--external/rhino/rhino-classpath.patch.113
2 files changed, 14 insertions, 0 deletions
diff --git a/external/rhino/UnpackedTarball_rhino.mk b/external/rhino/UnpackedTarball_rhino.mk
index 0a1492b88da6..15a596eb1b0f 100644
--- a/external/rhino/UnpackedTarball_rhino.mk
+++ b/external/rhino/UnpackedTarball_rhino.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,rhino,\
external/rhino/rhino1_5R5.patch \
external/rhino/rhino1_5R5-find_swing.patch \
external/rhino/rhino1_5R5-updateToolTip.patch \
+ external/rhino/rhino-classpath.patch.1 \
))
$(eval $(call gb_UnpackedTarball_add_file,rhino,toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java,external/rhino/OfficeScriptInfo.java))
diff --git a/external/rhino/rhino-classpath.patch.1 b/external/rhino/rhino-classpath.patch.1
new file mode 100644
index 000000000000..c751b95b5d9b
--- /dev/null
+++ b/external/rhino/rhino-classpath.patch.1
@@ -0,0 +1,13 @@
+/usr/bin/ant will put dozens of jars on the classpath, including a
+rhino.jar that breaks the build
+
+--- rhino/build.xml.orig 2021-11-11 17:25:07.284267174 +0100
++++ rhino/build.xml 2021-11-11 17:25:38.689242510 +0100
+@@ -33,6 +33,7 @@
+ <property file="apiClasses.properties"/>
+ <property name="docsrc.dir" value="docs"/>
+ <property name="dist.docsrc.dir" value="src/docs"/>
++ <property name="build.sysclasspath" value="ignore"/>
+ </target>
+
+ <target name="init" depends="properties">