You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
Every time I run jpackage 19 in verbose mode, I get multiple stack traces that are ignored by jpackage. I don't know if these are of value since my project still works but when I tried to quiet and resolve the errors, I found a flawed implementation.
In this segment, it calls dpkg -S <filepath>. It works for a number of files but not all of them because some of them are symlinks and dpkg does not seem to resolve symlinks or hard links for that matter (only exact paths).
For me, it fails on:
/lib/x86_64-linux-gnu/libmd.so.0
/lib/x86_64-linux-gnu/libx11.so.6
/lib/x86_64-linux-gnu/libxcb.so.1
/lib/x86_64-linux-gnu/libxdmcp.so.6
/lib/x86_64-linux-gnu/libxext.so.6
/lib/x86_64-linux-gnu/libxau.so.6
/lib/x86_64-linux-gnu/libbsd.so.0
/lib/x86_64-linux-gnu/libasound.so.2
The problem here is because on some distributions /lib is first a symlink to /usr/lib and secondly libmd.so.0 is a symlink to libmd.so.0.0.5 or other variant. I did confirm the same dpkg command does fail manually outside of the jpackage implementation, however, if you instead run:
dpkg -S "$(realpath /lib/x86_64-linux-gnu/libmd.so.0)"# libmd0:amd64: /usr/lib/x86_64-linux-gnu/libmd.so.0# it works!# rather than the current failure case:
dpkg -S /lib/x86_64-linux-gnu/libmd.so.0
# dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libmd.so.0
My first answer was readlink, but if its not a link then it returns nothing so realpath is the better answer to manage programmatically both files and possible symlinks. Once you have that path, then dpkg can find it properly across the package lists.
Jpackage Example Command & log
sudo apt update
# attempt to install the files that are missing supposedly
sudo apt install -y --no-install-recommends libmd0 libx11-6 libxcb1 libxdmcp6 libxext6 libxau6 libbsd0 libasound2
jpackage \
--type deb \
--name dynamictree \
--input DynamicTree \
--main-jar DynamicTree.jar \
--dest ./dist \
--verbose
log (some is snipped out with '...')
[03:51:18.686] Running dpkg
[03:51:18.699] Command [PID: 2619]:
dpkg --print-architecture
[03:51:18.699] Output:
amd64
[03:51:18.702] Returned: 0
[03:51:18.715] Running dpkg-deb
[03:51:18.726] Running dpkg-deb
[03:51:18.729] Running dpkg
[03:51:18.732] Running fakeroot
[03:51:18.738] Running dpkg
[03:51:18.755] Command [PID: 2627]:
dpkg -s coreutils
[03:51:18.755] Output:
Package: coreutils
Essential: yes
Status: install ok installed
Priority: required
Section: utils
Installed-Size: 7112
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: foreign
Version: 8.32-4.1ubuntu1
Pre-Depends: libacl1 (>= 2.2.23), libattr1 (>= 1:2.4.44), libc6 (>= 2.34), libgmp10 (>= 2:6.2.1+dfsg), libselinux1 (>= 3.1~)
Description: GNU core utilities
This package contains the basic file, shell and text manipulation
utilities which are expected to exist on every operating system.
.
Specifically, this package includes:
arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
csplit cut date dd df dir dircolors dirname du echo env expand expr
factor false flock fmt fold groups head hostid id install join link ln
logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc numfmt
od paste pathchk pinky pr printenv printf ptx pwd readlink realpath rm
rmdir runcon sha*sum seq shred sleep sort split stat stty sum sync tac
tail tee test timeout touch tr true truncate tsort tty uname unexpand
uniq unlink users vdir wc who whoami yes
Homepage: http://gnu.org/software/coreutils
Original-Maintainer: Michael Stone <mstone@debian.org>
[03:51:18.755] Returned: 0
[03:51:18.756] Running ldd
[03:51:26.446] Command [PID: -1]:
jlink --output /tmp/jdk.jpackage1797775926306423298/images/src/dynamictree/lib/runtime --module-path /opt/hostedtoolcache/Java_Corretto_jdk/19.0.2.7.1/x64/jmods --add-modules java.rmi,jdk.management.jfr,jdk.jdi,jdk.charsets,java.xml,jdk.xml.dom,java.datatransfer,jdk.jstatd,jdk.httpserver,java.desktop,java.security.sasl,jdk.zipfs,java.base,jdk.crypto.ec,jdk.javadoc,jdk.management.agent,jdk.jshell,jdk.editpad,jdk.sctp,java.sql.rowset,jdk.jsobject,java.smartcardio,jdk.unsupported,jdk.jlink,java.security.jgss,jdk.nio.mapmode,java.compiler,jdk.dynalink,jdk.unsupported.desktop,jdk.accessibility,jdk.security.jgss,java.sql,jdk.incubator.vector,java.logging,java.transaction.xa,java.xml.crypto,jdk.jfr,jdk.crypto.cryptoki,jdk.random,jdk.net,java.naming,jdk.internal.ed,java.prefs,java.net.http,jdk.compiler,jdk.naming.rmi,jdk.internal.opt,jdk.jconsole,jdk.attach,jdk.incubator.concurrent,jdk.internal.le,java.management,jdk.jdwp.agent,jdk.internal.jvmstat,java.instrument,jdk.management,jdk.security.auth,java.scripting,jdk.jdeps,jdk.jartool,java.management.rmi,jdk.jpackage,jdk.naming.dns,jdk.localedata --strip-native-commands --strip-debug --no-man-pages --no-header-files
[03:51:26.447] Output:
WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.concurrent
[03:51:26.447] Returned: 0
...
[03:51:27.064] Running ldd
[03:51:27.073] Command [PID: 2684]:
ldd /tmp/jdk.jpackage1797775926306423298/images/opt/dynamictree/lib/runtime/lib/libjli.so
[03:51:27.073] Output:
linux-vdso.so.1 (0x00007ffe0abc3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f89ababd000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f89abab8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f89ab5d8000)
/lib64/ld-linux-x86-64.so.2 (0x00007f89abad0000)
[03:51:27.073] Returned: 0
[03:51:27.073] Running ldd
[03:51:27.082] Command [PID: 2694]:
ldd /tmp/jdk.jpackage1797775926306423298/images/opt/dynamictree/lib/runtime/lib/libverify.so
[03:51:27.082] Output:
linux-vdso.so.1 (0x00007ffdaad66000)
libjvm.so => not found
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9035dd8000)
/lib64/ld-linux-x86-64.so.2 (0x00007f90363cb000)
[03:51:27.082] Returned: 0
...
[03:51:27.831] Running dpkg
[03:51:28.490] Command [PID: 3110]:
dpkg -S /lib/x86_64-linux-gnu/libmd.so.0
[03:51:28.490] Output:
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libmd.so.0
[03:51:28.490] Returned: 1
[03:51:28.490] java.io.IOException: Command [dpkg, -S, /lib/x86_64-linux-gnu/libmd.so.0] exited with 1 code
at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
at jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$initLibProvidersLookup$14(LinuxDebBundler.java:250)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:73)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:84)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:195)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.createDefaultReplacementData(LinuxPackageBundler.java:222)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:155)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[03:51:28.491] Running dpkg
[03:51:28.608] Command [PID: 3112]:
dpkg -S /lib/x86_64-linux-gnu/libpthread.so.0
[03:51:28.608] Output:
libc6:amd64: /lib/x86_64-linux-gnu/libpthread.so.0
[03:51:28.608] Returned: 0
[03:51:28.609] /lib/x86_64-linux-gnu/libpthread.so.0 is provided by [libc6]
[03:51:28.609] Running dpkg
[03:51:28.724] Command [PID: 3113]:
dpkg -S /lib/x86_64-linux-gnu/libX11.so.6
[03:51:28.724] Output:
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libX11.so.6
[03:51:28.724] Returned: 1
[03:51:28.724] java.io.IOException: Command [dpkg, -S, /lib/x86_64-linux-gnu/libX11.so.6] exited with 1 code
at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
at jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$initLibProvidersLookup$14(LinuxDebBundler.java:250)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:73)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:84)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:195)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.createDefaultReplacementData(LinuxPackageBundler.java:222)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:155)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[03:51:28.724] Running dpkg
[03:51:28.839] Command [PID: 3114]:
dpkg -S /lib/x86_64-linux-gnu/libm.so.6
[03:51:28.839] Output:
libc6:amd64: /lib/x86_64-linux-gnu/libm.so.6
[03:51:28.840] Returned: 0
[03:51:28.840] /lib/x86_64-linux-gnu/libm.so.6 is provided by [libc6]
[03:51:28.840] Running dpkg
[03:51:28.952] Command [PID: 3115]:
dpkg -S /lib/x86_64-linux-gnu/libxcb.so.1
[03:51:28.952] Output:
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libxcb.so.1
[03:51:28.952] Returned: 1
[03:51:28.952] java.io.IOException: Command [dpkg, -S, /lib/x86_64-linux-gnu/libxcb.so.1] exited with 1 code
at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
at jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$initLibProvidersLookup$14(LinuxDebBundler.java:250)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:73)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:84)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:195)
at jdk.jpackage/jdk.jpackage.internal.LinuxPa
ckageBundler.createDefaultReplacementData(LinuxPackageBundler.java:222)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:155)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[03:51:28.953] Running dpkg
[03:51:29.069] Command [PID: 3116]:
dpkg -S /lib/x86_64-linux-gnu/libdl.so.2
[03:51:29.069] Output:
libc6:amd64: /lib/x86_64-linux-gnu/libdl.so.2
[03:51:29.069] Returned: 0
[03:51:29.069] /lib/x86_64-linux-gnu/libdl.so.2 is provided by [libc6]
[03:51:29.069] Running dpkg
[03:51:29.183] Command [PID: 3118]:
dpkg -S /lib/x86_64-linux-gnu/librt.so.1
[03:51:29.183] Output:
libc6:amd64: /lib/x86_64-linux-gnu/librt.so.1
[03:51:29.183] Returned: 0
[03:51:29.184] /lib/x86_64-linux-gnu/librt.so.1 is provided by [libc6]
[03:51:29.184] Running dpkg
[03:51:29.299] Command [PID: 3119]:
dpkg -S /lib/x86_64-linux-gnu/libXdmcp.so.6
[03:51:29.299] Output:
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libXdmcp.so.6
[03:51:29.299] Returned: 1
[03:51:29.299] java.io.IOException: Command [dpkg, -S, /lib/x86_64-linux-gnu/libXdmcp.so.6] exited with 1 code
at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
at jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$initLibProvidersLookup$14(LinuxDebBundler.java:250)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:73)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:84)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:195)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.createDefaultReplacementData(LinuxPackageBundler.java:222)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:155)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[03:51:29.299] Running dpkg
[03:51:29.415] Command [PID: 3120]:
dpkg -S /lib/x86_64-linux-gnu/libXext.so.6
[03:51:29.415] Output:
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libXext.so.6
[03:51:29.415] Returned: 1
[03:51:29.415] java.io.IOException: Command [dpkg, -S, /lib/x86_64-linux-gnu/libXext.so.6] exited with 1 code
at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
at jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$initLibProvidersLookup$14(LinuxDebBundler.java:250)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:73)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:84)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:195)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.createDefaultReplacementData(LinuxPackageBundler.java:222)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:155)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[03:51:29.415] Running dpkg
[03:51:29.531] Command [PID: 3121]:
dpkg -S /lib/x86_64-linux-gnu/libXau.so.6
[03:51:29.531] Output:
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libXau.so.6
[03:51:29.531] Returned: 1
[03:51:29.531] java.io.IOException: Command [dpkg, -S, /lib/x86_64-linux-gnu/libXau.so.6] exited with 1 code
at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
at jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$initLibProvidersLookup$14(LinuxDebBundler.java:250)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:73)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:84)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:195)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.createDefaultReplacementData(LinuxPackageBundler.java:222)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:155)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[03:51:29.531] Running dpkg
[03:51:29.646] Command [PID: 3122]:
dpkg -S /lib/x86_64-linux-gnu/libc.so.6
[03:51:29.646] Output:
libc6:amd64: /lib/x86_64-linux-gnu/libc.so.6
[03:51:29.646] Returned: 0
[03:51:29.646] /lib/x86_64-linux-gnu/libc.so.6 is provided by [libc6]
[03:51:29.646] Running dpkg
[03:51:29.759] Command [PID: 3123]:
dpkg -S /lib/x86_64-linux-gnu/libbsd.so.0
[03:51:29.759] Output:
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libbsd.so.0
[03:51:29.759] Returned: 1
[03:51:29.760] java.io.IOException: Command [dpkg, -S, /lib/x86_64-linux-gnu/libbsd.so.0] exited with 1 code
at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
at
jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$initLibProvidersLookup$14(LinuxDebBundler.java:250)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:73)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:84)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:195)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.createDefaultReplacementData(LinuxPackageBundler.java:222)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:155)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[03:51:29.760] Running dpkg
[03:51:29.875] Command [PID: 3124]:
dpkg -S /lib/x86_64-linux-gnu/libasound.so.2
[03:51:29.876] Output:
dpkg-query: no path found matching pattern /lib/x86_64-linux-gnu/libasound.so.2
[03:51:29.876] Returned: 1
[03:51:29.876] java.io.IOException: Command [dpkg, -S, /lib/x86_64-linux-gnu/libasound.so.2] exited with 1 code
at jdk.jpackage/jdk.jpackage.internal.Executor.executeExpectSuccess(Executor.java:90)
at jdk.jpackage/jdk.jpackage.internal.LinuxDebBundler.lambda$initLibProvidersLookup$14(LinuxDebBundler.java:250)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:73)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.jpackage/jdk.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:84)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:195)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.createDefaultReplacementData(LinuxPackageBundler.java:222)
at jdk.jpackage/jdk.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:155)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:700)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[03:51:29.877] Required packages: [coreutils, grep, libc6, systemd, xdg-utils]
[03:51:29.879] Using default package resource template.desktop [Menu shortcut descriptor] (add dynamictree.desktop to the resource-dir to customize).
[03:51:29.883] Using custom package resource [systemd unit file] (loaded from dynamictree.service).
[03:51:29.897] Using default package resource template.control [DEB control file] (add control to the resource-dir to customize).
[03:51:29.902] Using custom package resource [DEB preinstall script] (loaded from preinst).
[03:51:29.908] Using custom package resource [DEB prerm script] (loaded from prerm).
[03:51:29.909] Using custom package resource [DEB postinstall script] (loaded from postinst).
[03:51:29.915] Using custom package resource [DEB postrm script] (loaded from postrm).
[03:51:29.915] Using custom package resource [Copyright file] (loaded from copyright).
[03:51:29.946] Generating DEB for installer to: /home/runner/work/dynamictree/dynamictree/./dist/dynamictree_1.0.0-1_amd64.deb.
[03:51:29.948] Running fakeroot
[03:52:25.801] Command [PID: 3125]:
fakeroot dpkg-deb --verbose -b /tmp/jdk.jpackage1797775926306423298/images /home/runner/work/dynamictree/dynamictree/./dist/dynamictree_1.0.0-1_amd64.deb
[03:52:25.801] Output:
dpkg-deb: building package 'dynamictree' in '/home/runner/work/dynamictree/dynamictree/./dist/dynamictree_1.0.0-1_amd64.deb'.
[03:52:25.801] Returned: 0
[03:52:25.801] Package (.deb) saved to: /home/runner/work/dynamictree/dynamictree/./dist/dynamictree_1.0.0-1_amd64.deb.
[03:52:25.801] Running dpkg-deb
[03:52:25.807] Command [PID: 3173]:
dpkg-deb -f ./dist/dynamictree_1.0.0-1_amd64.deb Package Version Architecture
[03:52:25.807] Output:
Package: dynamictree
Version: 1.0.0-1
Architecture: amd64
[03:52:25.807] Returned: 0
[03:52:25.809] Succeeded in building DEB Bundle package
The text was updated successfully, but these errors were encountered:
Bug Report
Every time I run jpackage 19 in verbose mode, I get multiple stack traces that are ignored by jpackage. I don't know if these are of value since my project still works but when I tried to quiet and resolve the errors, I found a flawed implementation.
I believe the faulty command call is here:
corretto-19/src/jdk.jpackage/linux/native/applauncher/LinuxPackage.c
Line 274 in 1e7f69c
In this segment, it calls
dpkg -S <filepath>
. It works for a number of files but not all of them because some of them are symlinks and dpkg does not seem to resolve symlinks or hard links for that matter (only exact paths).For me, it fails on:
The problem here is because on some distributions
/lib
is first a symlink to/usr/lib
and secondlylibmd.so.0
is a symlink tolibmd.so.0.0.5
or other variant. I did confirm the same dpkg command does fail manually outside of the jpackage implementation, however, if you instead run:My first answer was
readlink
, but if its not a link then it returns nothing sorealpath
is the better answer to manage programmatically both files and possible symlinks. Once you have that path, then dpkg can find it properly across the package lists.Jpackage Example Command & log
sudo apt update # attempt to install the files that are missing supposedly sudo apt install -y --no-install-recommends libmd0 libx11-6 libxcb1 libxdmcp6 libxext6 libxau6 libbsd0 libasound2 jpackage \ --type deb \ --name dynamictree \ --input DynamicTree \ --main-jar DynamicTree.jar \ --dest ./dist \ --verbose
log (some is snipped out with '...')
The text was updated successfully, but these errors were encountered: