Skip to content

Restore Protobuf 3 runtime for cel-generated-pb3 - #1047

Merged
snazy merged 3 commits into
projectnessie:mainfrom
snazy:fix-pb3-protobuf3
Dec 1, 2026
Merged

snazy merged 3 commits into
projectnessie:mainfrom
snazy:fix-pb3-protobuf3

Conversation

@snazy

@snazy snazy commented Nov 28, 2026

Copy link
Copy Markdown
Member

A previous dependency update (#847) moved the protobuf3 version to a Protobuf 4.x release, so cel-generated-pb3 has been generated and published against Protobuf 4 instead of Protobuf 3.

Constrain protobuf3 to [3.25, 4[ (preferring 3.25.9) and use it for both the protobuf-java dependency and protoc of cel-generated-pb3.

The Quarkus BOM manages Protobuf 4, which conflicts with that constraint, so quarkus-smoke-core-pb3-jackson3 excludes protobuf-java from it.

Also register well-known type builders for native-image reflection:

With a Protobuf 3 runtime, the generated message field accessors look up methods such as Int32Value.Builder.getValue() reflectively.
Native images failed with Generated message class "com.google.protobuf.Int32Value$Builder" missing method "getValue", because only the well-known type messages, not their builders, were registered for reflection.

This was not noticed before because cel-generated-pb3 was built against Protobuf 4 when the native smoke tests were added.

A previous dependency update (projectnessie#847) moved the `protobuf3` version to a Protobuf 4.x release, so `cel-generated-pb3` has been generated and published against Protobuf 4 instead of Protobuf 3.

Constrain `protobuf3` to `[3.25, 4[` (preferring 3.25.9) and use it for both the `protobuf-java` dependency and `protoc` of `cel-generated-pb3`.

The Quarkus BOM manages Protobuf 4, which conflicts with that constraint, so `quarkus-smoke-core-pb3-jackson3` excludes `protobuf-java` from it.
With a Protobuf 3 runtime, the generated message field accessors look up methods such as `Int32Value.Builder.getValue()` reflectively.
Native images failed with `Generated message class "com.google.protobuf.Int32Value$Builder" missing method "getValue"`, because only the well-known type messages, not their builders, were registered for reflection.

This was not noticed before because `cel-generated-pb3` was built against Protobuf 4 when the native smoke tests were added.
@snazy
snazy force-pushed the fix-pb3-protobuf3 branch from a2d450c to aac6fe7 Compare November 28, 2026 10:14
Comment thread gradle/libs.versions.toml Resolved
Comment thread conformance/build.gradle.kts Resolved
@snazy
snazy requested a review from XN137 December 1, 2026 11:21
import org.projectnessie.cel.types.jackson.JacksonRegistry;

public class MyClass {} No newline at end of file
public class MyClass {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if we want the shared round-trip to catch another upgrade that moves both protoc and protobuf-java to 4, we could pass in the expected variant and check for com.google.protobuf.RuntimeVersion. Protobuf 4.36.2 exposes MAJOR, MINOR, and PATCH through that class, and 3.25.9 lacks it. A presence check would distinguish the two runtimes used here.

@snazy
snazy merged commit 4c308b6 into projectnessie:main Dec 1, 2026
3 checks passed
@snazy
snazy deleted the fix-pb3-protobuf3 branch December 1, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants