#jdeps dies on nearly-identical dependencies. What do?

1 messages · Page 1 of 1 (latest)

burnt spoke
#

I've been using github actions and jpackage to make releases of my apps. Recently noticed that jpackage doesn't know how to tell users they have an old version of java.
I was told the solution is to use jlink. jlink won't run wtihout knowing which dependencies to add. That leads to jdeps. The relevant part of the action script is

name: Build installation package
shell: bash
run: |
  set -x
  set -o pipefail
  APP_VERSION=$(ls -1 target/package/RobotOverlord-*-with-dependencies.jar | sed "s/.*RobotOverlord-\([^-]*\)-with-dependencies.jar/\1/")
  sed -i.bak "s/\(--app-version\).*/\1 $APP_VERSION/" src/main/package/jpackage.cfg
  APP_NAME="RobotOverlord-${{ matrix.os_label }}"

  # copy runtime dependencies into `target/dependency`
  mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=target/dependency

  # compute module list from the fat jar, ignore missing deps to avoid failure on unknown automatic modules
  JAR="target/package/RobotOverlord-$APP_VERSION-with-dependencies.jar"
  MODULES=$(jdeps --multi-release ${{ env.JAVA_VERSION }} --module-path target/dependency --print-module-deps --ignore-missing-deps "$JAR")
  echo "jdeps modules: $MODULES"  

(continued...)

brisk parrotBOT
#

<@&987246964494204979> please have a look, thanks.

burnt spoke
#
  # add any known extras (e.g. jdk.zipfs) and run jlink
  EXTRAS="jdk.zipfs"
  jlink --add-modules "${MODULES},${EXTRAS}" --output img

  jpackage "@src/main/package/jpackage.cfg" "@src/main/package/jpackage-${{matrix.runs_on}}.cfg" \
    --main-jar "RobotOverlord-$APP_VERSION-with-dependencies.jar" \
    --runtime-image img \
    --name "$APP_NAME"
  ...

The expanded jdep line would read

jdeps --multi-release 22 --module-path dependency --print-module-deps --ignore-missing-deps .\RobotOverlord-3.122.0.jar

which produces the error

Error: Two versions of module gluegen.rt found in dependency (gluegen-rt-2.6.0-natives-android-x86_64.jar and gluegen-rt-2.6.0-natives-android-aarch64.jar)

I'm not good at this package overhead stuff. If this is the wrong forum, I apologize. I figured you've run across this long ago and know what to do. Please advise.

Thank you!

visual canyon
#

and don't include the module path

burnt spoke
#

?