GoogleCloudPlatform / GoogleCloudPlatform/cloud-opensource-java
Static Linkage Checker
- 主要言語
- Java
- スター
- 163
- フォーク
- 80
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
We need a tool that can verify that a single artifact is linkage compatible. This should verify that all static references in a given classpath are valid. This is a necessary tool to verify that we're actually meeting the objective of not surfacing conflicts to users. (Verifying version agreement is not sufficient.)
The tool takes the Maven coordinates?/pom.xml file? as input. It resolves the dependency tree according to the usual Maven dependency mediation algorithm. Thus all artifacts are assigned specific versions. This is the runtime classpath. Then it checks this for linkage conflicts.
Linkage conflict: The signature of a non-private method or class in a dependency has changed in an incompatible way between the version supplied at compile time and the version invoked at runtime. For example, a public method may be removed from a class or a class may be made final. Linkage conflicts detected at runtime manifest as ReflectiveOperationException, NoClassDefFoundError, NoSuchFieldException, MethodNotFoundException, LinkageError, or other related exceptions.
Or, another perspective: In cases where binary compatibility and source compatibility are the same, a linkage conflict is when compilation would fail if the libraries in the classpath were all built together from their originating source code, or when reflection would fail.
Opposite: Linkage-compatible.
Sub-type: Static linkage conflict: A linkage conflict caused by a direct code reference (non-reflective).
Sub-type: Reflective linkage conflict: A linkage conflict caused by a reflective reference.
It runs through the classpath, finds every statically referenced class, interface, method, and field and verifies the signatures match up. E.g. no signature has changed or been removed in an incompatible way in the specific version found in the classpath.
We are not considering access via reflection.
Implementation: maven plugin? main() method? dashboard report? all of this?
Start with a one page design doc?
How does this differ from simple compilation checking?
Are these errors common in practice?
@garrettjonesgoogle Can you flesh this issue out a bit?
コントリビューションガイド
評価
この issue はまだ評価されていません。