typedb/dependencies

The "Unused Deps" tool does not work for dependencies declared in native_java_libraries

lolski opened this issue · 0 comments

Description

Unused deps fail to detect unused dependencies in our native_java_libraries macro. This is true for dependencies declared in the deps as well as native_libraries_deps field.

How to reproduce

  1. Add a dependency that is sure to be unused. For example, add "@maven//:info_picocli_picocli" to //rocks:rocks:

https://github.com/graknlabs/grakn/blob/7ef3ac2843774173c72d1e69d658c0c2f21006f0/rocks/BUILD#L29-L70

native_java_libraries(
    name = "rocks",
    srcs = glob(["*.java"]),
    deps = [
        # Internal dependencies
        "//common:common",
        "//concurrent:concurrent",
        "//graph:graph",
        "@maven//:info_picocli_picocli", 
    ...
)
  1. bazel run @graknlabs_dependencies//tool/unuseddeps:unused-deps -- remove

Expected output

The "@maven//:info_picocli_picocli" dep should be removed

Actual output

The "@maven//:info_picocli_picocli" dep is not removed