[Xapian-tickets] [Xapian] #774: libxapian_jni.jnilib installed to preposterous location

Xapian nobody at xapian.org
Mon May 8 23:35:43 BST 2023


#774: libxapian_jni.jnilib installed to preposterous location
------------------------------------+---------------------------
 Reporter:  Ryan Schmidt            |             Owner:  (none)
     Type:  defect                  |            Status:  closed
 Priority:  normal                  |         Milestone:  1.4.21
Component:  Xapian-bindings (Java)  |           Version:  1.4.9
 Severity:  normal                  |        Resolution:  fixed
 Keywords:                          |        Blocked By:
 Blocking:                          |  Operating System:  All
------------------------------------+---------------------------
Changes (by Olly Betts):

 * status:  new => closed
 * resolution:   => fixed
 * milestone:   => 1.4.21

Comment:

 I tested using `tmptest.java` on the GCC compile farm macOS machine (which
 is apparently 12.6 and an M1 CPU in case that matters), and
 `java.library.path` is
 `/Users/olly/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.`
 while `java.ext.dir` and `java.ext.dirs` are both `null`.

 It seems the first entry (`/Users/olly/Library/Java/Extensions`) doesn't
 exist by default though (neither does `/Users/olly/Library/Java` but
 `/Users/olly/Library` does exist).  This would probably be an OK location
 as a default, but isn't where you'd want to install to as a packager
 anyway.  However the first entry on Debian is still
 `/usr/java/packages/lib` which doesn't exist, and seems a bad default.  I
 don't see a good way to tell if we should use the first entry on the path
 or not (e.g. directory existing or not doesn't work).

 The full `java.library.path` on Debian unstable is currently
 `/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-
 gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib`.  The second
 entry is probably the best place to install to (that's what the
 `libxapian-jni` uses).  However the `.jar` should go elsewhere, and I
 don't see a way to query that location (`libxapian-java` puts it in
 `/usr/share/java`).

 It really does seem it's just not possible to usefully query the
 appropriate directories from a Java install in a portable way, which seems
 stupid but sometimes the truth just is stupid.  Given that, we aren't
 going to be able to ever full resolve this (unless Java itself addresses
 this) and it doesn't seem useful to keep it open indefinitely so I'm going
 to close it.  We've documented this better at least.  If anyone can see
 how to improve the situation, please speak up.
-- 
Ticket URL: <https://trac.xapian.org/ticket/774#comment:5>
Xapian <https://xapian.org/>
Xapian


More information about the Xapian-tickets mailing list