Skip to content

Add index of packages in jar files when pinning#716

Merged
shs96c merged 3 commits intobazel-contrib:masterfrom
illicitonion:jar-index
Jul 5, 2022
Merged

Add index of packages in jar files when pinning#716
shs96c merged 3 commits intobazel-contrib:masterfrom
illicitonion:jar-index

Conversation

@illicitonion
Copy link
Copy Markdown
Contributor

This allows other tooling, e.g. gazelle, to make use of this
information. This can be useful for dependency inference, dependency
analysis, and suggesting missing dependencies.

This makes sense to do at pin time because the lifecycle of this
information is closely tied to the artifacts being fetched/pinned.
Generating the information is cheap enough that this shouldn't
significantly slow down pins, but is expensive enough that other tooling
may want to avoid doing so on the fly at runtime, so is useful to cache.

Comment thread coursier.bzl
Comment thread private/tools/java/rules/jvm/external/jar/BUILD Outdated
Comment thread private/tools/java/rules/jvm/external/jar/ListPackages.java
Comment thread private/tools/java/rules/jvm/external/jar/ListPackages.java Outdated
Comment thread private/tools/java/rules/jvm/external/jar/ListPackages.java Outdated
Comment thread private/tools/java/rules/jvm/external/jar/ListPackages.java
This allows other tooling, e.g. gazelle, to make use of this
information. This can be useful for dependency inference, dependency
analysis, and suggesting missing dependencies.

This makes sense to do at pin time because the lifecycle of this
information is closely tied to the artifacts being fetched/pinned.
Generating the information is cheap enough that this shouldn't
significantly slow down pins, but is expensive enough that other tooling
may want to avoid doing so on the fly at runtime, so is useful to cache.
It contains the vast majority of the implementation of the ruleset
Copy link
Copy Markdown
Collaborator

@shs96c shs96c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit, then it's good to go

Comment thread private/tools/java/rules/jvm/external/jar/ListPackages.java
Copy link
Copy Markdown
Collaborator

@shs96c shs96c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI builds are passing, and the changes to the lock files seem fine. LGTM

@shs96c shs96c merged commit dfb0e69 into bazel-contrib:master Jul 5, 2022
@illicitonion illicitonion deleted the jar-index branch July 5, 2022 13:53
illicitonion added a commit to illicitonion/rules_jvm that referenced this pull request Jul 5, 2022
bazel-contrib/rules_jvm_external#716 started
indexing jar files and adding the package index to the
maven_install.json.

This re-uses that data, rather than re-implementing parsing ourselves.
This has the advantage of no longer needing to check in and manage the
lifecycle of an additional cache file, and deletes a bunch of code.
illicitonion added a commit to illicitonion/rules_jvm that referenced this pull request Jul 5, 2022
bazel-contrib/rules_jvm_external#716 started
indexing jar files and adding the package index to the
maven_install.json.

This re-uses that data, rather than re-implementing parsing ourselves.
This has the advantage of no longer needing to check in and manage the
lifecycle of an additional cache file, and deletes a bunch of code.
illicitonion added a commit to illicitonion/rules_jvm that referenced this pull request Jul 6, 2022
bazel-contrib/rules_jvm_external#716 started
indexing jar files and adding the package index to the
maven_install.json.

This re-uses that data, rather than re-implementing parsing ourselves.
This has the advantage of no longer needing to check in and manage the
lifecycle of an additional cache file, and deletes a bunch of code.
illicitonion added a commit to bazel-contrib/rules_jvm that referenced this pull request Jul 6, 2022
bazel-contrib/rules_jvm_external#716 started
indexing jar files and adding the package index to the
maven_install.json.

This re-uses that data, rather than re-implementing parsing ourselves.
This has the advantage of no longer needing to check in and manage the
lifecycle of an additional cache file, and deletes a bunch of code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants