Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional provides for debian packages #190

Closed
ALRyanAdams opened this issue Nov 26, 2019 · 7 comments
Closed

Additional provides for debian packages #190

ALRyanAdams opened this issue Nov 26, 2019 · 7 comments
Labels
enhancement New feature or request linux Linux-related issue
Milestone

Comments

@ALRyanAdams
Copy link

Describe the bug

When trying to use the deb package that's built from Corretto, I have to jump through some hoops in order to install other OS packages that depend on Java. The issue is that those pacakges depend on default-jre-headless or default-jdk-headless, and Corretto does not list this in the provides. As a result, both Debian and Ubuntu eventually end up trying to pull in a version of OpenJDK.

To Reproduce

This can be reproduced on any Debian or Ubuntu box, but the easiest way to reproduce is with the Corretto docker file

  1. Build the Debian docker container by running docker build -t amazon-corretto-8 github.com/corretto/corretto-8-docker/#8-al2-full:contrib/debian
  2. Exec into the container docker run -ti amazon-corretto-8:latest /bin/bash
  3. Try installing groovy apt-get update && apt-get install --simulate groovy. Note that it pulls in default-jre-headless and ultimately openjdk-11-jre-headless.

Current list of files:

The following additional packages will be installed:
  ant ant-optional antlr ca-certificates-java dbus default-jre-headless ivy junit4 krb5-locales libantlr-java libapache-pom-java libapparmor1 libasm-java libasound2
  libasound2-data libavahi-client3 libavahi-common-data libavahi-common3 libbsd0 libbsf-java libcommons-cli-java libcommons-logging-java libcommons-parent-java libcups2
  libdbus-1-3 libel-api-java libgpars-groovy-java libgssapi-krb5-2 libhamcrest-java libhawtjni-runtime-java libjansi-java libjansi-native-java libjcommander-java
  libjcsp-java libjline2-java libjpeg62-turbo libjsp-api-java libjsr166y-java libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblcms2-2 libmultiverse-core-java
  libnspr4 libnss3 libpcsclite1 libqdox-java libservlet-api-java libservlet3.1-java libsqlite3-0 libwebsocket-api-java libx11-6 libx11-data libxau6 libxcb1 libxdmcp6
  libxext6 libxi6 libxpp3-java libxrender1 libxstream-java libxtst6 openjdk-11-jre-headless x11-common
Suggested packages:
  ant-doc javacc junit jython libactivation-java libbcel-java libcommons-net-java libmail-java libjaxp1.3-java libjdepend-java libjsch-java liblog4j1.2-java liboro-java
  libregexp-java libxalan2-java libxml-commons-resolver1.1-java libxz-java default-dbus-session-bus | dbus-session-bus default-jre groovy-doc default-jre | java2-runtime
  ivy-doc libbcpg-java libbcprov-java libjsch-agent-proxy-java libasound2-plugins alsa-utils bsh rhino libavalon-framework-java libcommons-logging-java-doc
  libexcalibur-logkit-java cups-common libgpars-groovy-java-doc krb5-doc krb5-user libjcommander-java-doc libjcsp-java-doc liblcms2-utils pcscd libqdox-java-doc
  libcglib-nodep-java libdom4j-java libjdom1-java libjdom2-java libjettison-java libjoda-time-java libkxml2-java libwoodstox-java libxom-java libnss-mdns
  fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei fonts-indic
The following NEW packages will be installed:
  ant ant-optional antlr ca-certificates-java dbus default-jre-headless groovy ivy junit4 krb5-locales libantlr-java libapache-pom-java libapparmor1 libasm-java
  libasound2 libasound2-data libavahi-client3 libavahi-common-data libavahi-common3 libbsd0 libbsf-java libcommons-cli-java libcommons-logging-java libcommons-parent-java
  libcups2 libdbus-1-3 libel-api-java libgpars-groovy-java libgssapi-krb5-2 libhamcrest-java libhawtjni-runtime-java libjansi-java libjansi-native-java libjcommander-java
  libjcsp-java libjline2-java libjpeg62-turbo libjsp-api-java libjsr166y-java libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblcms2-2 libmultiverse-core-java
  libnspr4 libnss3 libpcsclite1 libqdox-java libservlet-api-java libservlet3.1-java libsqlite3-0 libwebsocket-api-java libx11-6 libx11-data libxau6 libxcb1 libxdmcp6
  libxext6 libxi6 libxpp3-java libxrender1 libxstream-java libxtst6 openjdk-11-jre-headless x11-common
0 upgraded, 66 newly installed, 0 to remove and 0 not upgraded.

Expected behavior

The groovy install would not bring in the additional openjdk requirements.

Screenshots

n/a

Platform information

OS: Debian 10
Version openjdk version "1.8.0_232"

OpenJDK Runtime Environment Corretto-8.232.09.1 (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM Corretto-8.232.09.1 (build 25.232-b09, mixed mode)
Package version - java-1.8.0-amazon-corretto-jdk:amd64 1:8.232.09-1

Additional context

I think the fix would just be to add in the additional provides in https://github.com/corretto/corretto-8/blob/master/installers/linux/universal/deb/build.gradle , but I may be wrong.

@ziyiluo
Copy link
Contributor

ziyiluo commented Dec 2, 2019

@ALRyanAdams You are right, the Corretto 8 debian package does not provide default-jre-headless or default-jdk-headless because the current Corretto 8 deb package we provide on the download page is a "headful" JDK. This request is equivalent to the headless JRE of Corretto 8 (and 11).

I'm linking this issue to corretto-8-docker#17 & corretto-8#65.

@ziyiluo
Copy link
Contributor

ziyiluo commented Dec 2, 2019

Discussed with the team, short-term we will add both default-jre-headless and default-jdk-headless to corretto-8 .deb JDK package.

@ziyiluo ziyiluo added enhancement New feature or request linux Linux-related issue labels Dec 2, 2019
@ziyiluo
Copy link
Contributor

ziyiluo commented Dec 10, 2019

Learned a little bit more about default-jre-headless. It is a pointer package that creates a symlink /usr/lib/jvm/default-java that points to the real jre-headless directory. Adding default-jre-headless in Corretto-8 "provides" list is inappropriate for three reasons: 1. Amazon corretto does not and should not create the symlink /usr/lib/jvm/default-java therefore it does not actually provide the file default-jre-headless package creates. 2. The expected behavior of default-jre-headless should create a symlink that points to the latest stable JRE version (i.e., "JRE-11" at this moment). Even Corretto-8 can provide default-jre-headless, it should only provide an early version ("2:1.8") of the package. 3. According to Debian's documentation, packages in the "Provides" field should be virtual but default-jre-headless is not.

I've found another workaround. On Debian's package page, groovy requires either default-jre-headless or java7-runtime-headless. Adding the latter to Corretto-8 Debian "provides" list should fix your issue.

@ALRyanAdams
Copy link
Author

I think that would work for Groovy since it explicitly is looking for the Java 7 runtime... but looking at the openjdk packages it looks like they also provide other runtime-headless packages. For instance, looking at the latest openjdk for 8 on Ubuntu, I see the following list of provides:
8u222-b10-1ubuntu1~18.04.1 - java8-runtime-headless (= ) java7-runtime-headless (= ) java6-runtime-headless (= ) java5-runtime-headless (= ) java2-runtime-headless (= )

Similarly, openjdk 11 provides for java5 to java11.

I would think we would want to have a similar list to openjdk.

@ziyiluo
Copy link
Contributor

ziyiluo commented Jan 21, 2020

This has been fixed in the most recent 8.242.08.1. Please check out our download page.

@ziyiluo ziyiluo closed this as completed Jan 21, 2020
@ALRyanAdams
Copy link
Author

So... commenting here as a start (though I can file a different ticket if you want). I tested with the latest build and we appear to have missed adding java2-runtime-headless to the list. For some sort of reason, at least ivy references that specific virtual package (see https://packages.debian.org/sid/ivy ), and groovy depends on ivy. As a result, we get the same type of behavior that we saw before.

@ziyiluo
Copy link
Contributor

ziyiluo commented Mar 3, 2020

@ALRyanAdams We almost missed your comment. Feel free to reopen it next time to raise more attention. I'll add java2-runtime-headless as additional provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request linux Linux-related issue
Projects
None yet
Development

No branches or pull requests

3 participants