You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "pburka (via GitHub)" <gi...@apache.org> on 2023/12/28 19:48:04 UTC
[I] [Bug]: Beam jars include many copied classes, break compilation of user code [beam]
pburka opened a new issue, #29881:
URL: https://github.com/apache/beam/issues/29881
### What happened?
Several Beam 2.52.0 jars (as downloaded from maven) include unshaded classes copied from other projects. For example, `beam-sdks-java-transform-service-launcher-2.52.0.jar` includes annotation classes that appear to have been copied from old versions of error-prone and checker-qual, e.g. `com.google.errorprone.annotations.CanIgnoreReturnValue` and `org.checkerframework.checker.builder.qual.CalledMethods`. When this jar appears on the classpath, it can shadow the actual error-prone and checker-qual jars, potentially causing compilation errors in user code.
Similarly, `beam-sdks-java-harness-2.52.0.jar` includes classes copied from outdated versions of JUnit and Hamcrest. It's unclear why this jar would need to vendor unit testing classes. The same jar appear to also include a near(?)-complete copy of classgraph.
Most confusingly, `beam-runners-direct-java-2.52.0.jar` appears to include duplicates of most or all of the classes from `beam-sdks-java-extensions-avro-2.52.0.jar`, but not exactly the same classes, as the classfile CRCs differ. It's not at all clear why one Beam jar needs classes vendored from another jar within the same project.
I suspect the copied annotation classes aren't needed in the jars at all--anyone using error-prone or checker-qual can provide their own jar explicitly and it should be relatively harmless to compile against the jar with the annotation classes missing completely. (Although some non-Java compilers such as scalac may not handle this as well as javac.) The other classes should be provided as dependencies, allowing users to upgrade them, if necessary, and avoiding confusing errors caused by shadowing.
These copied classes appear to have been introduced sometime after version 2.37.0, which did not have these copied classes. This may be related to [Issue 19846](https://github.com/apache/beam/issues/19846)
### Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
### Issue Components
- [ ] Component: Python SDK
- [X] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Beam jars include many copied classes, break compilation of user code [beam]
Posted by "honnix (via GitHub)" <gi...@apache.org>.
honnix commented on issue #29881:
URL: https://github.com/apache/beam/issues/29881#issuecomment-1877237587
`beam-sdks-java-transform-service-launcher` also include slf4j, which makes things even worse, because it doesn't play well with later version of slf4j where implementation loading is service provider based. If in classpath there is later version of slf4j-api and corresponding implementation, logging might not work at all depending on which slf4j classes get loaded first.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Beam jars include many copied classes, break compilation of user code [beam]
Posted by "honnix (via GitHub)" <gi...@apache.org>.
honnix commented on issue #29881:
URL: https://github.com/apache/beam/issues/29881#issuecomment-1876994305
I think at least those shadowed classes should be relocated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Beam jars include many copied classes, break compilation of user code [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn closed issue #29881: [Bug]: Beam jars include many copied classes, break compilation of user code
URL: https://github.com/apache/beam/issues/29881
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Beam jars include many copied classes, break compilation of user code [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on issue #29881:
URL: https://github.com/apache/beam/issues/29881#issuecomment-1922108265
beam-sdks-java-transform-service-launcher is a fat jar intended to be used as a standalone service. However, it is then also included as the dependency of runners-core-construction-java and java-harness which pretty much used by every Beam pipeline, and causing problems.
CC: @chamikaramj
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org