https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Bug ID: 2062407 Summary: msgfmt cannot invoke javac Product: Fedora Version: rawhide Hardware: All OS: Linux Status: NEW Component: gettext Severity: low Assignee: suanand@redhat.com Reporter: loganjerry@gmail.com QA Contact: extras-qa@fedoraproject.org CC: dueno@redhat.com, i18n-bugs@lists.fedoraproject.org, jjanco@redhat.com, nphilipp@redhat.com, petersen@redhat.com, praiskup@redhat.com, suanand@redhat.com Target Milestone: --- Classification: Fedora
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:
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Mamoru TASAKA mtasaka@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mtasaka@fedoraproject.org Doc Type|--- |If docs needed, set a value
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
--- Comment #1 from Mamoru TASAKA mtasaka@fedoraproject.org --- Created attachment 1866962 --> https://bugzilla.redhat.com/attachment.cgi?id=1866962&action=edit ar.po extracted from jmol source
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
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Mamoru TASAKA mtasaka@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|msgfmt cannot invoke javac |msgfmt --java2 option | |doesn't work with | |java-17-openjdk
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
--- Comment #2 from Mamoru TASAKA mtasaka@fedoraproject.org --- Created attachment 1866963 --> https://bugzilla.redhat.com/attachment.cgi?id=1866963&action=edit temtative patch to support jdk17
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.
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Mamoru TASAKA mtasaka@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |2024265
Referenced Bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=2024265 [Bug 2024265] java-17-openjdk as system JDK in F36
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Mamoru TASAKA mtasaka@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Flags| |needinfo?(suanand@redhat.co | |m)
--- Comment #3 from Mamoru TASAKA mtasaka@fedoraproject.org --- Are there any updates here? I think all needed information is provided.
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Jens Petersen petersen@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |POST Fixed In Version| |gettext-0.21-13.fc37.0.2022 | |0203
--- Comment #4 from Jens Petersen petersen@redhat.com --- 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.
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
--- Comment #5 from Jens Petersen petersen@redhat.com --- Can you try testing gettext-0.21-13.fc37.0.20220203 to see if it works for you?
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Mamoru TASAKA mtasaka@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(suanand@redhat.co | |m) |
--- Comment #6 from Mamoru TASAKA mtasaka@fedoraproject.org --- Yes, gettext-0.21-13.fc37.0.20220203 looks working. Thank you.
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Mamoru TASAKA mtasaka@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|POST |CLOSED Resolution|--- |RAWHIDE Last Closed| |2022-04-05 06:32:39
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Nikos Moumoulidis nmoumoul@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |2182696
Referenced Bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=2182696 [Bug 2182696] msgfmt --java2 option doesn't work with java-17-openjdk
https://bugzilla.redhat.com/show_bug.cgi?id=2062407
Nikos Moumoulidis nmoumoul@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |2182697
Referenced Bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=2182697 [Bug 2182697] msgfmt --java2 option doesn't work with java-17-openjdk
i18n-bugs@lists.fedoraproject.org