external/rhino/UnpackedTarball_rhino.mk |    1 +
 external/rhino/rhino-classpath.patch.1  |   13 +++++++++++++
 2 files changed, 14 insertions(+)

New commits:
commit d46f415553cdcfe736728bd8de551f6a2354a834
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Nov 9 18:48:38 2021 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Nov 12 14:20:39 2021 +0100

    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.st...@allotropia.de>
    (cherry picked from commit bb58293296f843654045d7b0eba6899d11533a4a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124980
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

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">

Reply via email to