RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1993879 - javapackages-tools: wrong generated Requires: `java-headless >= 11`
Summary: javapackages-tools: wrong generated Requires: `java-headless >= 11`
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: javapackages-tools
Version: 8.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Mikolaj Izdebski
QA Contact: RHEL CS Apps Subsystem QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-16 10:23 UTC by Marián Konček
Modified: 2023-01-27 08:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-27 08:43:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-93604 0 None None None 2021-08-16 10:25:20 UTC

Description Marián Konček 2021-08-16 10:23:37 UTC
Description of problem:
See this build:
https://koji.fedoraproject.org/koji/buildinfo?buildID=1814863

The generated Requires on `java-headless >= 1:11` is not satisfiable in rhel-8.

Comment 1 jiri vanek 2021-08-16 10:55:41 UTC
The culprint *may* be xmvn, as there is (at least) one pkg in rhel8 which is jdk11 based but is build by Makefile, and do not suffer the issue.
More details about the java provides.

Each rhel, have system jdk. In rhel8 it is, and will remain jdk8. Such "system jdk", is th eonly jdks which provide version-less provides, lije java, java-headless, java-devel and so on (+ version-full alternatives like java-1.8.0-devel etc...). Every jdk, compatible with system jdk can keep the version-less provides.
Every other jdk (eg java-11-openjdk, or java-17-openjdk, or java-1.7.0-openjdk) have onny version-full provides like java-11-headless, java-17-devel and so on.

This is here so the system JDK may be changed smoothly. If jdk11 will become system JDK, ti will start to provide version-less provides, and jdk8 will stop provide them. 


Thus the version-less provide, accompanied by version is simply bug, as it can not be satisfied and actually breaking the smooth system-jdk change (which is unlikely to happen in rhel8, but may happen in rhel9 by jdk11->jdk17)

Comment 2 Marián Konček 2021-08-16 11:01:44 UTC
Adding relevant information:

Contents of the .spec file:
BuildRequires:  maven-local
BuildRequires:  mvn(com.beust:jcommander)
BuildRequires:  java-11-openjdk-devel

Requires:       java-11-headless
Requires:       beust-jcommander
Requires:       javapackages-tools

The built .rpm file Requires:
/bin/bash
beust-jcommander
java-11-headless
java-headless >= 1:11
javapackages-filesystem
javapackages-tools
mvn(com.beust:jcommander)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

Comment 3 jiri vanek 2021-08-16 14:39:25 UTC
> java-headless >= 1:11

Is the bad one

Comment 4 Mikolaj Izdebski 2021-08-17 09:41:46 UTC
Thank you for taking the time to report this issue to us. We appreciate the feedback and use reports such as this one to guide our efforts at improving our products. That being said, this bug tracking system is not a mechanism for requesting support, and we are not able to guarantee the timeliness or suitability of a resolution.

If this issue is critical or in any way time sensitive, please raise a ticket through the regular Red Hat support channels to ensure it receives the proper attention and prioritization to assure a timely resolution.

For information on how to contact the Red Hat production support team, please visit:
    https://access.redhat.com/support

Comment 5 jiri vanek 2021-08-30 13:09:09 UTC
(In reply to Mikolaj Izdebski from comment #4)
> Thank you for taking the time to report this issue to us. We appreciate the
> feedback and use reports such as this one to guide our efforts at improving
> our products. That being said, this bug tracking system is not a mechanism
> for requesting support, and we are not able to guarantee the timeliness or
> suitability of a resolution.
> 
> If this issue is critical or in any way time sensitive, please raise a
> ticket through the regular Red Hat support channels to ensure it receives
> the proper attention and prioritization to assure a timely resolution.
> 
> For information on how to contact the Red Hat production support team,
> please visit:
>     https://access.redhat.com/support

Hi, This is severe issue reprted by employees. Do you already have some opinions?

Comment 8 Mikolaj Izdebski 2021-09-25 09:53:10 UTC
The root cause is that "java-headless" provide means "default system JRE" and that there is no provide with meaning "any JRE".
Therefore it's not possible to require "any JRE", except by enumerating all of them, eg. "Requires: (java-headless or java-11-headless or java-17-headless)".
A proper long-term fix would mean redesigning how provides and auto-requires are supposed to work. There are several possibilities.
One is redefining java-headless to mean "any JRE" and adding generic provides to all JDKs - I still don't see any good reason why newer JDKs can't provide java-headless and such.
Another possibility is removing auto-requires on java-headless altogether - they add little value and cause much trouble.
There is no obvious best solution, so this needs discussion. The change should first happen in Fedora.

Comment 9 Stefan Bluhm 2021-10-05 20:30:19 UTC
This is how I worked around this issue when using xmvn:

...
%install
%mvn_install
sed -i '/requiresJava/d' %{buildroot}/usr/share/maven-metadata/<name>.xml
...

Now only the line without the version requirement is generated:
Requires: java-headless

You can then manually add the right java-11-headless requirement.

Certainly this will also require the system default and this is only a workaround.

Comment 12 Marián Konček 2023-01-27 08:43:22 UTC
Comment #8 explains the problem. This is not something that can be fixed within javapackages-tools. The cause is a design decision of the Fedora OpenJDK maintainers.


Note You need to log in before you can comment on or make changes to this bug.