This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2182697 - msgfmt --java2 option doesn't work with java-17-openjdk
Summary: msgfmt --java2 option doesn't work with java-17-openjdk
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: gettext
Version: 8.7
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Jens Petersen
QA Contact: QE Internationalization Bugs
URL:
Whiteboard:
Depends On: 2062407
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-29 12:02 UTC by Nikos Moumoulidis
Modified: 2023-09-05 16:49 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2062407
Environment:
Last Closed: 2023-09-05 16:49:26 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-2275 0 None Migrated None 2023-09-05 16:49:20 UTC
Red Hat Issue Tracker RHELPLAN-153412 0 None None None 2023-03-29 12:02:35 UTC

Description Nikos Moumoulidis 2023-03-29 12:02:05 UTC
I am cloning this bug because we recently moved our project (Candlepin) to Java17 and we are stuck because we cannot compile our translation classes any more. Can you please include this fix in RHEL8?

+++ This bug was initially created as a clone of Bug #2062407 +++

Description of problem:
I noticed while building jmol that every invocation of msgfmt failed, e.g.:

update-application-catalog-lang:
     [echo] msgfmt Updating messages_ar.class file for Jmol ...
     [exec] msgfmt: Java compiler not found, try installing gcj or set $JAVAC
     [exec] msgfmt: compilation of Java class failed, please try --verbose or set $JAVAC
     [exec] 65 translated messages, 3 fuzzy translations, 380 untranslated messages.
     [exec] Result: 1

Setting JAVAC does *not* help.  I used strace to see how javac is invoked and found the problem: msgfmt passes -target 1.6, and sometimes -source 1.6, to javac.  Now that OpenJDK 17 is the default in Fedora, those arguments are no longer valid.  I don't remember if the minimum allowed is 1.7 or 1.8, but it is one of the two.  Since Fedora doesn't ship a JDK lower than 1.8, then 1.8 might as well be used.

Version-Release number of selected component (if applicable):
gettext-0.21-11.fc37.0.20220228

How reproducible:
Always

Steps to Reproduce:
1. fedpkg clone jmol
2. cd jmol
3. fedpkg srpm
4. mock -r fedora-rawhide-x86_64 --rebuild jmol-14.32.22-1.fc37.src.rpm

Actual results:
The msgfmt invocations all fail.

Expected results:
The msgfmt invocations should succeed.

Additional info:

--- Additional comment from Mamoru TASAKA on 2022-03-20 14:16:57 UTC ---

So the simple reproducer for this is:

$ mock --verbose -r fedora-rawhide-x86_64 --uniqueext gettext-test --init
$ mock --verbose -r fedora-rawhide-x86_64 --uniqueext gettext-test --install java-devel gettext
$ mock --verbose -r fedora-rawhide-x86_64 --uniqueext gettext-test --copyin ./ar.po /builddir/build/BUILD
$ mock --verbose -r fedora-rawhide-x86_64 --uniqueext gettext-test --chroot -- msgfmt  --statistics --java2 -l ar -d /builddir/build/BUILD/TMP -r org.jmol.translation.Jmol.ar.Messages /builddir/build/BUILD/ar.po

Then:
msgfmt: Java compiler not found, try installing gcj or set $JAVAC
msgfmt: compilation of Java class failed, please try --verbose or set $JAVAC
65 translated messages, 3 fuzzy translations, 380 untranslated messages.
DEBUG: Child return code was: 1

--- Additional comment from Mamoru TASAKA on 2022-03-20 14:25:47 UTC ---

So this is actually msgfmt calls javac with "-source 1.5 -target 1.6" explicitly:
 
  see gettext-tools/src/write-java.c "compile_java_class" call in "msgdomain_write_java" and related functions in gettext-tools/gnulib-lib/javacomp.c .

The attached patch is a draft for fixing this issue. Note that get_goodcode_snippet() and get_failcode_snippet() may need more adjustment: I guess get_goodcode_snippet() needs the code which compiles with JDK17 but fails with JDK11, however I don't know such code in detail.

--- Additional comment from Mamoru TASAKA on 2022-03-30 11:50:50 UTC ---

Are there any updates here? I think all needed information is provided.

--- Additional comment from Jens Petersen on 2022-03-31 03:27:32 UTC ---

Thank you very much, Tasaka-san!

Sorry, Sundeep has been away on holiday for two weeks.

I have added your patch to the rawhide branch.

We have one more problem: currently gettext-0.21 FTBFS on F36+.
So we have a git snapshot currently in Rawhide,
but maybe we can use that for F36 now to address this.

--- Additional comment from Jens Petersen on 2022-03-31 03:28:20 UTC ---

Can you try testing gettext-0.21-13.fc37.0.20220203 to see if it works for you?

--- Additional comment from Mamoru TASAKA on 2022-03-31 07:16:05 UTC ---

Yes, gettext-0.21-13.fc37.0.20220203 looks working. Thank you.

Comment 3 Jens Petersen 2023-04-25 05:05:20 UTC
Okay I had missed this one: so you want for both RHEL 8 and 9: okay makes sense I guess
I think it should be possible.

Comment 8 RHEL Program Management 2023-09-05 16:47:48 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 9 RHEL Program Management 2023-09-05 16:49:26 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.


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