On 12/29/2014 02:15 PM, Markus Koschany wrote:
> On Sun, 21. Dec 09:57 tony mancill <tmanc...@debian.org> wrote:
>> On 12/15/2014 12:06 AM, Mathieu Malaterre wrote:
>>> On Sun, Dec 14, 2014 at 6:50 PM, Markus Koschany <a...@gambaru.de> wrote:
>>> [...]
>>>> Actually what was the reasoning behind the choice to use a custom shell
>>>> script like jarwrapper instead of jexec to register executable jars with
>>>> binfmt-misc? This question also came up in the bug report.
>>>
>>> Here is my guess:
>>> `jexec` only works with openjdk installed. At one point debian had
>>> multiple java implementation (sun, kaffe...). These days only two
>>> really remains, so maybe an easier solution would be to have a
>>> `gcj-exec` provided by `gcj-jdk` to mimic openjdk package. Which means
>>> it would be much easier to handle the LD_LIBRARY_PATH issue within the
>>> `gcj-exec` executable.
>>>
>>> jarwrapper is only really needed with a custom jre installation...
>>
>> That sounds reasonable to me, although it can be hard in practice to
>> keep things functional for users running non-Debian JRE packages.  Which
>> is not to say that we shouldn't generally discourage jarwrapper...
> 
> I think before we create another solution like gcj-exec, it is easier to
> maintain the current implementation of jarwrapper. I agree that gcj's
> handling of LD_LIBRARY_PATH and Multiarch could be improved but in my
> opinion there are other aspects about gcj which deserve even more
> attention. Most modern Java applications just don't work with it.
> 
> I suggest to upload the fix for #764630 now. I just saw tony's email
> from the 21th. The current state on master is final. I haven't planned
> any further changes to jarwrapper. Please go ahead.

Uploaded to unstable.  Markus, would you be willing to file the unblock
request for this bug?  Attached are the debdiffs for the upload I
performed.  As the author of this change, you're in the best position to
discuss specifics with the Release Team if there are any questions.

If you'd rather not, please let me know and I'll do it.  I think we want
this change for jessie, if that's still possible.

Thank you,
tony




diff -Nru javatools-0.47/debian/changelog javatools-0.48/debian/changelog
--- javatools-0.47/debian/changelog	2014-09-10 13:42:21.000000000 -0700
+++ javatools-0.48/debian/changelog	2014-12-11 22:44:41.000000000 -0800
@@ -1,3 +1,16 @@
+javatools (0.48) unstable; urgency=medium
+
+  * Team upload.
+  * jarwrapper: Add MULTIARCH_LIBRARY_PATH variables for 32bit and 64bit arches
+    which contain all known multiarch jni library paths and use this as
+    value for -Djava.library.path depending on the JVM that is used to
+    launch the application. Add an additional check for the GIJ bytecode
+    interpreter and let it handle the library path by itself.
+    This ensures that all JVM will find the corresponding libraries correctly.
+    (Closes: #764630)
+
+ -- Markus Koschany <a...@gambaru.de>  Fri, 05 Dec 2014 10:38:23 +0100
+
 javatools (0.47) unstable; urgency=medium
 
   * Team upload.
diff -Nru javatools-0.47/jarwrapper javatools-0.48/jarwrapper
--- javatools-0.47/jarwrapper	2014-09-10 12:33:53.000000000 -0700
+++ javatools-0.48/jarwrapper	2014-12-11 22:44:41.000000000 -0800
@@ -19,7 +19,7 @@
 JAVAOPTS="$(perl -0nE 's{\r?\n\s}{}gsm; print $1 if m{^Debian-Java-Parameters:\s*([^\r\n]+)}m;' "$TEMP/META-INF/MANIFEST.MF")"
 rm -rf "$TEMP"
 
-for i in $NEW_JAVA_HOMES; do 
+for i in $NEW_JAVA_HOMES; do
    if [ -x "$i/bin/java" ]; then
       JAVA="$i/bin/java"
       JAVA_HOME="$i"
@@ -33,9 +33,25 @@
    JAVA=java
 fi
 
+MULTIARCH_LIBRARY_PATH_32BIT="/usr/lib/jni:/usr/lib/arm-linux-gnueabi/jni:/usr/lib/arm-linux-gnueabihf/jni:/usr/lib/i386-gnu/jni:/usr/lib/i386-linux-gnu/jni:/usr/lib/i386-kfreebsd-gnu/jni:/usr/lib/mips-linux-gnu/jni:/usr/lib/mipsel-linux-gnu/jni:/usr/lib/powerpc-linux-gnu/jni:/usr/lib/powerpc-linux-gnuspe/jni:/usr/lib/sparc-linux-gnu/jni:/usr/lib/x86_64-linux-gnux32/jni:/usr/lib/hppa-linux-gnu/jni:/usr/lib/sh4-linux-gnu/jni:/usr/lib/m68k-linux-gnu/jni"
+
+MULTIARCH_LIBRARY_PATH_64BIT="/usr/lib/jni:/usr/lib/alpha-linux-gnu/jni:/usr/lib/x86_64-linux-gnu/jni:/usr/lib/aarch64-linux-gnu/jni:/usr/lib/x86_64-kfreebsd-gnu/jni:/usr/lib/powerpc64-linux-gnu/jni:/usr/lib/powerpc64le-linux-gnu/jni:/usr/lib/s390x-linux-gnu/jni:/usr/lib/sparc64-linux-gnu/jni"
+
 if which "$JAVA" >/dev/null 2>&1; then
-	export LD_LIBRARY_PATH=/usr/lib/jni 
-	exec $JAVA $JAVAOPTS -Djava.library.path=/usr/lib/jni -jar "$JAR" "$@"
+    if java --version 2>&1 | grep "GNU libgcj" > /dev/null; then
+        # Let GNU gij handle the library path by itself
+        export LD_LIBRARY_PATH=/usr/lib/jni
+        exec $JAVA $JAVAOPTS -jar "$JAR" "$@"
+    fi
+    if java -d32 2>&1 | grep "does not support" > /dev/null; then
+        # 64bit
+        export LD_LIBRARY_PATH=$MULTIARCH_LIBRARY_PATH_64BIT
+        exec $JAVA $JAVAOPTS -Djava.library.path=$MULTIARCH_LIBRARY_PATH_64BIT -jar "$JAR" "$@"
+    else
+        # 32bit
+        export LD_LIBRARY_PATH=$MULTIARCH_LIBRARY_PATH_32BIT
+        exec $JAVA $JAVAOPTS -Djava.library.path=$MULTIARCH_LIBRARY_PATH_32BIT -jar "$JAR" "$@"
+    fi
 else
-	echo "In order to run Java programs you must install a compatible JRE. If you don't know what JRE you need, default-jre is probably a good bet"
+    echo "In order to run Java programs you must install a compatible JRE. If you don't know what JRE you need, default-jre is probably a good bet"
 fi
File lists identical (after any substitutions)

Control files of package jarwrapper: lines which differ (wdiff format)
----------------------------------------------------------------------
Installed-Size: [-61-] {+62+}
Version: [-0.47-] {+0.48+}

Control files of package java-propose-classpath: lines which differ (wdiff format)
----------------------------------------------------------------------------------
Depends: gcj-jdk, javahelper (= [-0.47),-] {+0.48),+} fastjar
Version: [-0.47-] {+0.48+}

Control files of package javahelper: lines which differ (wdiff format)
----------------------------------------------------------------------
Version: [-0.47-] {+0.48+}

Attachment: signature.asc
Description: OpenPGP digital signature

__
This is the maintainer address of Debian's Java team
<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers>. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Reply via email to