michaellass / AUR

PKGBUILDs of all my AUR packages
7 stars 11 forks source link

jabref does not build in clean chroot #34

Closed michaellass closed 1 year ago

michaellass commented 1 year ago

From https://aur.archlinux.org/packages/jabref#comment-892140

I am having trouble building in a clean chroot with makechrootpkg.

==> Starting build()... Your Java installation is not set up correctly. Try archlinux-java fix. Using JDK from to build JabRef.

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

==> ERROR: A failure occurred in build(). Aborting...

I am installing jdk18-openj9-bin and archlinux-java-run from the AUR.

resolving dependencies... looking for conflicting packages... Packages (6) java-environment-common-3-3 java-runtime-common-3-3 nspr-4.35-1 nss-3.85-1 archlinux-java-run-9-1 jdk18-openj9-bin-18.0.2.1-1

I think the recommendation to run "archlinux-java fix" is correct since if I manually enter the chroot and then run the "archlinux-java-run" command from the PKGBUILD, it does not return anything but if I run "archlinux-java fix", then the PKGBUILD command gives the correct version.

The issue, I think is that I cannot simply add "archlinux-java fix" to the build function in the PKGBUILD since the archlinux-java script requires root privileges and makechrootpkg drops privileges (I think).

danielshub commented 1 year ago

Thanks for maintaining the jabref package. Trying to use archlinux-java-run is dommed. It requires the symlink created by archlinux-java fix. You do not want to manually create the symlink in the PKGBUILD since this would be change the build machine configuration and not simply the build environment.

I looked at the PKGBUILDs for the packages in the community repo that depend on gradle and set JAVA_HOME (keycloak-archlinux-theme, freeplane, and zaproxy) and they all set JAVA_HOME directly.

I think this would work for jabref also since it requires a specific java version so you know the path in advance.

michaellass commented 1 year ago

I think this would work for jabref also since it requires a specific java version so you know the path in advance.

Not really. I suggest installing jdk18-openj9-bin currently but there are other JDK 18 packages in the AUR (although only few). And hopefully JabRef will be updated for newer (supported) JDKs soon.

I think this is actually an issue with the jdk18-openj9-bin package which is currently lacking any installation script that sets itself as default if no other JDK is installed. I am going to add one so that the java environment is valid within the chroot and archlinux-java-run will be able to work as expected.

michaellass commented 1 year ago

Could you please retry building jabref in a clean chroot, now with jdk18-openj9-bin-18.0.2.1-2 released?

danielshub commented 1 year ago

Still does not build in a clean chroot with makechrootpkg:

==> Starting build()...
Using JDK from /usr/lib/jvm/java-18-j9 to build JabRef.
16:02:16.063 0x16f00    j9vm.224    *   ** ASSERTION FAILED ** at ../../../../../openj9/runtime/vm/FlushProcessWriteBuffers.cpp:85: ((0 == mlockrc))
JVMDUMP039I Processing dump event "traceassert", detail "" at 2022/12/08 11:02:16 - please wait.
JVMDUMP032I JVM requested System dump using '/build/jabref/src/jabref-5.7/core.20221208.110216.877.0001.dmp' in response to an event
JVMPORT030W /proc/sys/kernel/core_pattern setting "|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" specifies that the core dump is to be piped to an external program.  Attempting to rename either core or core.902.

JVMDUMP012E Error in System dump: The core file created by child process with pid = 902 was not found. Expected to find core file with name "/build/jabref/src/jabref-5.7/core.902"
JVMDUMP032I JVM requested Java dump using '/build/jabref/src/jabref-5.7/javacore.20221208.110216.877.0002.txt' in response to an event
JVMDUMP010I Java dump written to /build/jabref/src/jabref-5.7/javacore.20221208.110216.877.0002.txt
JVMDUMP032I JVM requested Snap dump using '/build/jabref/src/jabref-5.7/Snap.20221208.110216.877.0003.trc' in response to an event
JVMDUMP010I Snap dump written to /build/jabref/src/jabref-5.7/Snap.20221208.110216.877.0003.trc
JVMDUMP013I Processed dump event "traceassert", detail "".
==> ERROR: A failure occurred in build().
    Aborting...

I have the new release of jdk18

resolving dependencies...
looking for conflicting packages...

Packages (6) java-environment-common-3-3  java-runtime-common-3-3  nspr-4.35-1  nss-3.85-1  archlinux-java-run-9-1  jdk18-openj9-bin-18.0.2.1-2
michaellass commented 1 year ago

Thanks for testing. So the initial issue with archlinux-java-run is now solved. I can reproduce the new issue:

I really do not want to add another JDK 18 package to the AUR which I think would be the only way to fix this. So unfortunately I have to close this as wontfix. For now, jabref will not build using makechrootpkg.

danielshub commented 1 year ago

Thanks for looking into this. I agree that it is no longer the original issue. Based on your links, the new issue does not seem like it is an issue with jabref and trying to patch out or spend extra effort packaging out of date java versions seems silly.

michaellass commented 1 year ago

I just pushed JabRef 5.8 to AUR which uses Java 17 to build, i.e., it can use the standard jdk17-openjdk package from the official repositories. it might be worth retrying to build JabRef in a chroot.