Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New armeria release 1.31.0 contains dependency on protobuf-java 4.28.2 #5990

Closed
smax48 opened this issue Nov 19, 2024 · 4 comments · Fixed by #5992
Closed

New armeria release 1.31.0 contains dependency on protobuf-java 4.28.2 #5990

smax48 opened this issue Nov 19, 2024 · 4 comments · Fixed by #5992
Labels
Milestone

Comments

@smax48
Copy link

smax48 commented Nov 19, 2024

Looks like this 4.28.2 comes from the updated protobuf-jackson.

Basically this new version breaks everything protobuf-related - as 4.x is not compatible with 3.x

@jrhee17
Copy link
Contributor

jrhee17 commented Nov 19, 2024

If protobuf4 was included, it's unintentional 😅 Let me check and release a patch version. Thanks for the report!

@trask
Copy link

trask commented Nov 20, 2024

we ran into this also: open-telemetry/opentelemetry-java-contrib#1550 (comment)

@anuraaga
Copy link
Collaborator

For context, protobuf-jackson supports both v3 and v4 while declaring a dependency on the latest version of protobuf when releasing as I think is standard for Java libraries. Perhaps protobuf is too weird to apply standard norms too... One note is that my understanding was the complete breakage in v4 was resolved

protocolbuffers/protobuf#17247

I wonder if that just leaves potentially small parts of Armeria left that may need fixing for compatibility. That being said, grpc-java hasn't updated yet which is a good sign. Let me know if it seems the practical approach is to sticking to a v3 dependency in protobuf-jackson for now (some work to wire v4 into the CI in that case, Google loves to cause us extra work :P).

@smax48
Copy link
Author

smax48 commented Nov 20, 2024

I quickly tested our project with the latest v4 and it just breaks everything... Even though code changes are not very complex (to fix compilation errors), runtime behaviour was broken. In our projects we use other components that are dependent on protobuf v3 serialization (Temporal) - and that simply didn't work with mixed v3/v4.

So it would be very good to keep using protobuf-java v3 in armeria as long as grpc-java itself is doing the same :-)

@jrhee17 jrhee17 added this to the 1.31.1 milestone Nov 21, 2024
@jrhee17 jrhee17 added the defect label Nov 21, 2024
jrhee17 added a commit that referenced this issue Nov 21, 2024
Motivation:

With the recent release of 1.31.0, we received a report that protobuf 4
has been included as an api dependency.
This is probably a mistake since 1) the community isn't ready for
protobuf 4 2) it's usually safer to follow the protobuf version used by
`grpc-java`.

The `api` configuration is a consumable configuration, which means it is
difficult to detect these kind of issues directly.
However, by checking the runtime dependencies for tests we can infer
whether a version is inadvertently bumped.

In order to detect such mishaps, I also propose that a
`failOnVersionConflict` variant is added.
Because naively introducing `failOnVersionConflict` introduces many
conflicts, I've added a variant which checks for specified dependencies
only. (inspired by gradle/gradle#8813)

One limitation is that the `dependencies` task is not available when a
`failOnVersionConflict` occurs. For this reason, once a failure due to a
conflict occurs, it is encouraged to use the `-PdebugDeps` flag with the
`dependencies` task.

e.g.
```
./gradlew :grpc:dependencies -PdebugDeps
```

Modifications:

- Excluded the `protobuf-java` dependency from `protobuf-jackson`
- Added a `failOnVersionConflict` method which checks version conflicts
for specific dependencies only

Result:

- Closes #5990 

<!--
Visit this URL to learn more about how to write a pull request
description:

https://armeria.dev/community/developer-guide#how-to-write-pull-request-description
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants