Hi Tony,

On 16.5.2012 17:01, tony mancill wrote:
In any event, I'm still able to run tuxguitar on sid with both 3.5 and 3
packages installed, so I'm not convinced we've ironed out the precise
cause of the bug.

Ok, I will try to describe it more thoroughly:

The direct cause of crash is that required JNI library libswt-cairo-gtk-3555.so
(from package libswt-cairo-gtk-3.5-jni) is not installed when it has to be.

On a clean system where neither SWT nor tuxguitar is installed we can get into
this situation with following sequence of events:

(1) Install tuxguitar:

  $ apt-get install tuxguitar
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following extra packages will be installed:
    libswt-cairo-gtk-3-jni libswt-gtk-3-java
  Suggested packages:
    libswt-gtk-3-java-gcj tuxguitar-jsa lilypond
  Recommended packages:
    tuxguitar-alsa tuxguitar-oss
  The following NEW packages will be installed:
    libswt-cairo-gtk-3-jni libswt-gtk-3-java tuxguitar
  0 upgraded, 3 newly installed, 0 to remove and 15 not upgraded.
  ...
  Setting up libswt-gtk-3-java (3.7.2-2) ...
  update-alternatives: using /usr/share/java/swt-gtk-3.7.jar to provide 
/usr/share/java/swt.jar (swt.jar) in auto mode.
  ...

  Now we have libswt-gtk-3-java, libswt-cairo-gtk-3-jni and 
/usr/share/java/swt.jar
  is provided by swt-gtk-3.7.jar. So far good, we can successfully launch 
tuxguitar
  and it will use SWT 3.7

(2) Now let's add libswt-gtk-3.5-java to the installation

  $ apt-get install libswt-gtk-3.5-java
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following extra packages will be installed:
    libswt-gtk-3.5-jni
  Suggested packages:
    libswt-gtk-3.5-java-gcj libswt-gnome-gtk-3.5-jni
  The following NEW packages will be installed:
    libswt-gtk-3.5-java libswt-gtk-3.5-jni
  0 upgraded, 2 newly installed, 0 to remove and 15 not upgraded.
  ...

  We have libswt-gtk-3.5-java installed, *BUT NOT* libswt-cairo-gtk-3.5-jni and
  /usr/share/java/swt.jar is symlinked to swt-gtk-3.5.1.jar. When you now try to
  start tuxguitar, it will use SWT 3.5 and crashes with exception we already 
know
  from Grant:

  Exception in thread "main" org.eclipse.swt.SWTException: Unable to load 
graphics library [Cairo is required]
  (java.lang.UnsatisfiedLinkError: no swt-cairo-gtk-3555 or swt-cairo-gtk in 
swt.library.path, java.library.path
  or the jar file)

(3) To fix this, we can manually install libswt-cairo-gtk-3.5-jni. Then 
tuxguitar
finally runs also with SWT 3.5 - this is most probably your (Tony's) situation,
when you have both SWTs and application is working:

||/ Name                        Version                     Description
+++-===========================-===========================-====================================================
ii  libswt-cairo-gtk-3-jni      3.7.2-2                     Standard Widget 
Toolkit for GTK+ Cairo JNI library
ii  libswt-cairo-gtk-3.5-jni    3.5.1-2.1                   Standard Widget 
Toolkit for GTK+ Cairo JNI library
un  libswt-gnome-gtk-3-jni      <none>                      (no description 
available)
un  libswt-gnome-gtk-3.5-jni    <none>                      (no description 
available)
ii  libswt-gtk-3-java           3.7.2-2                     Standard Widget 
Toolkit for GTK+ Java library
un  libswt-gtk-3-java-gcj       <none>                      (no description 
available)
ii  libswt-gtk-3-jni            3.7.2-2                     Standard Widget 
Toolkit for GTK+ JNI library
ii  libswt-gtk-3.5-java         3.5.1-2.1                   Standard Widget 
Toolkit for GTK+ Java library
un  libswt-gtk-3.5-java-gcj     <none>                      (no description 
available)
ii  libswt-gtk-3.5-jni          3.5.1-2.1                   Standard Widget 
Toolkit for GTK+ JNI library
ii  libswt-webkit-gtk-3-jni     3.7.2-2                     Standard Widget 
Toolkit for GTK+ WebKit JNI library

It's that tuxguitar sometimes needs libswt-cairo-gtk-3.5-jni, but it's
not depending on it in any way.

Do you see where is the problem now or did I confuse you even more? :)

So I think we would have to change its Depends to something like:

   Depends: libswt-gtk-3-java | libswt-gtk-3.5-java,
            libswt-cairo-gtk-3-jni | libswt-cairo-gtk-3.5-jni,
            ... etc


That change to depends won't have the desired effect.  All that
expresses is "either libswt-gtk-3-java or libswt-gtk-3.5-java or both"
which is what we are trying to avoid.  I believe you want to express an
exclusive (XOR) in there - one or other, but not both.

You are right, my change is not sufficient. XOR might work, but I'm not
sure if this can be expressed in Depends.

When you say "get rid of the alternatives," I'm not sure what you mean.
  Tuxguitar only lists the following swt dependencies:
libswt-gtk-3-java, libswt-cairo-gtk-3-jni, and libswt-webkit-gtk-3-jni.
  It sounds like we might be back to conflicting with libswt-gtk-3.5-java.

I mean Niels' suggestion to remove old SWT packages, from one of previous mails:

On 15.5.2012 07:52, Niels Thykier wrote:
Personally, I think the swt alternatives is... "weird" at best.  So I
would vote for breaking the old packages to force their removal and then
remove the usage of alternatives in Wheezy+1.
   I think the original idea was to allow co-installation of two
(API/ABI) incompatiable swt jars to smoothing transitions - however they
are not going to enabled at the same time, so we would end up breaking
some programs during a transition anyway.

In this scenario libswt-gtk-3-java will conflict with libswt-gtk-3.5-java
and other old SWT packages, so that situations in (2) and (3) will never
occur. Here, no change to tuxguitar package is needed.

Regards,

Jakub



__
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