Bug 2051202 - protobuf fails to build with java-17-openjdk
Summary: protobuf fails to build with java-17-openjdk
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: protobuf
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Igor Raits
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2024265
TreeView+ depends on / blocked
 
Reported: 2022-02-06 15:38 UTC by jiri vanek
Modified: 2022-02-16 08:14 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-16 08:09:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github protocolbuffers protobuf issues 9477 0 None open Build failure with OpenJDK 1.17 2022-02-08 04:26:18 UTC

Description jiri vanek 2022-02-06 15:38:42 UTC
protobuf fails to build with java-17-openjdk as sytem JDK. See https://fedoraproject.org/wiki/Changes/Java17 .
See especially part about known failures: https://fedoraproject.org/wiki/Changes/Java17#common_issues_packagers_can_face_and_gathered_solutions

For the build logs, see: https://koji.fedoraproject.org/koji/taskinfo?taskID=82434010
https://kojipkgs.fedoraproject.org/work/tasks/4060/82434060/mock_output.log
https://kojipkgs.fedoraproject.org/work/tasks/4060/82434060/hw_info.log
https://kojipkgs.fedoraproject.org/work/tasks/4060/82434060/state.log
https://kojipkgs.fedoraproject.org/work/tasks/4060/82434060/build.log
https://kojipkgs.fedoraproject.org/work/tasks/4060/82434060/root.log
We run the rebuild in side tag f36-java17, but as fail ratio was small, we expect this side tag to be merged into rawhide 7 or 8 of February 2022.
To reproduce before this date simply: fedpkg clone protobuf; cd protobuf;  fedpkg build --target f36-java17; #The target is crucial.
After this date the usual fedpkg build in f36 and up should do.

We run two reruns your package failed both.

We had also run the mass rebuilds in copr since November. We keep all encountered failures. See them here: https://copr.fedorainfracloud.org/coprs/jvanek/java17//package/protobuf
You may find interesting additional informations here. Also we were spamming maintainers regualrly, check you spam folder.
              

We had tried aprox 500 packages, and aprox 65 had failed, so the java-17-openjdk will be system JDK in f36, and you should fix your package if you want to keep it alive. Usually the fix is simple, and best is to update the package to latest upstream version.
There will be usual mass rebuild once f36 branches. You may got another FTBFS bug.
Let us know here if you have any questions, here in bug, or at java-devel.org .

We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side if needed.

Comment 1 jiri vanek 2022-02-06 16:11:54 UTC
[ERROR]   ServiceTest.testCallMethod:83 » NoClassDefFound Could not initialize class org...
[ERROR]   ServiceTest.testGetPrototype:107 » ExceptionInInitializer
[INFO] 
[ERROR] Tests run: 1145, Failures: 0, Errors: 2, Skipped: 1


but:
[ERROR] com.google.protobuf.ServiceTest.testGetPrototype  Time elapsed: 0.021 s  <<< ERROR!
java.lang.ExceptionInInitializerError
	at com.google.protobuf.ServiceTest.testGetPrototype(ServiceTest.java:107)
Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @12d5624a
	at com.google.protobuf.ServiceTest.testGetPrototype(ServiceTest.java:107)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @12d5624a
	at com.google.protobuf.ServiceTest.testGetPrototype(ServiceTest.java:107)
[ERROR] com.google.protobuf.ServiceTest.testCallMethod  Time elapsed: 0.001 s  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.easymock.internal.ClassProxyFactory$2
	at com.google.protobuf.ServiceTest.testCallMethod(ServiceTest.java:83)


is caused by jdk17. You need to add opens/exports as java/javac args, or to bump to upstream sources supporting that.
Maybe jsut disable the tests, but afik the seen issue is correct.

Comment 2 Orion Poplawski 2022-02-08 04:26:19 UTC
Reported upstream - https://github.com/protocolbuffers/protobuf/issues/9477

Comment 3 Ben Cotton 2022-02-08 20:06:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 4 Mamoru TASAKA 2022-02-13 12:54:43 UTC
So following the above error seems to make build success:
https://koji.fedoraproject.org/koji/taskinfo?taskID=82757599

PR submitted:
https://src.fedoraproject.org/rpms/protobuf/pull-request/10

Note that now even on i686 reducing java heap usage seems needed.

Comment 6 Adrian Reber 2022-02-16 08:14:46 UTC
@mtasaka thanks for doing the F36 build.


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