GoogleCloudPlatform / GoogleCloudPlatform/cloud-opensource-java

Static Linkage Checker

Đang mở
#110 4 bình luận 0 reaction 1 người được giao Được @suztomo nhận Xem trên GitHub
enhancement
Ngôn ngữ chính
Java
Star
163
Fork
80
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.