-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Remove antlr from dependency from java-core pom #33030
base: master
Are you sure you want to change the base?
Conversation
I think that solution is even better than the previous one. |
Thanks for the feedback.
Yes. I think with current version user can still use a different version, but they need to pin the dependency like #32696 (comment) The problem on the current HEAD is that beam core "leaks" the antlr-runtime dependency while it was supposed to be shaded
Yes that is what I understood. |
R: @shunping |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
#Yes. I think with current version user can still use a different version, but they need to pin the dependency like #32696 (comment) Can you set the dependency as "compile only" in the gradle file? This would avoid us to do this |
After this change antlr will be a "compile only" dependency (more precisely its a custom gradle config, used for generating java code from antlr source), won't leak into the pom.
I mean there could be other Beam's dependency, not Beam itself, having transient antlr dependency, that could be conflict with user dependency. This is based on the observation of #33016 #14787 - bumping antlr version then some tests breaks elsewhere. |
Alright, understood. Thanks |
many tests failing in ':runners:direct-java:needsRunnerTests' target due to
checked that the same test, if running under ':runners:direct-java:test', will pass. The reason it failed is because the tests running on unshaded compiled class (haven't redirect antlr yet) |
Alternative fix of #32696
We already vendored and repackaged antlr runtime into the jar. It was intended to avoid dependency version conflict if user using different antlr versions. However, beam java core still declares it as a dependency.
Before:
java core pom has antlr4-runtime dependency, e.g. in https://repo1.maven.org/maven2/org/apache/beam/beam-sdks-java-core/2.60.0/beam-sdks-java-core-2.60.0.pom
after:
ran
./gradlew :sdks:java:core:publishToMavenLocal -Ppublishing
and checked that antlr-runtime is no longer a dependency of beam java core in generated pom.Also checked the jar still repackaged antlr runtime in
org/apache/beam/repackaged/core/org/antlr/v4/runtime
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.