Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collection of Maven runtime deps #1308

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

fmeum
Copy link
Member

@fmeum fmeum commented Jan 14, 2025

A transitive dependency of a maven_project_jar is a runtime dependency if and only if each path to it from the root goes through at least one runtime_deps edge. Before this commit, every transitive dependency that was reachable from the root via at least one path with a runtime_deps edge was considered to be a runtime dependency, even if other paths require it as a compile dependency. This fixes a regression introduced by 7b0abdc.

Also show a helpful error when users attempt to move a dep from runtime_deps to deps on a java_export target with no srcs.

Work towards CodeIntelligenceTesting/jazzer#919

@fmeum fmeum requested review from jin, shs96c and cheister as code owners January 14, 2025 16:03
@fmeum
Copy link
Member Author

fmeum commented Jan 14, 2025

CI failures look unrelated

A transitive dependency of a `maven_project_jar` is a runtime dependency if and only if each path to it from the root goes through at least one `runtime_deps` edge. Before this commit, every transitive dependency that was reachable from the root via at least one path with a `runtime_deps` edge was considered to be a runtime dependency, even if other paths require it as a compile dependency.

Also show a helpful error when users attempt to move a dep from `runtime_deps` to `deps` on a `java_export` target with no `srcs`.
@fmeum
Copy link
Member Author

fmeum commented Jan 17, 2025

I didn't notice that some CI failures were related to this PR. They are now fixed. I also temporarily patched the latest test run which fails with Bazel 8.

Copy link
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.

LGTM. Checked that the changes have exploded the size of generated POM files, and it looks good. Thank you, @fmeum!

@shs96c shs96c merged commit a1d4e4f into bazel-contrib:master Jan 17, 2025
7 checks passed
@fmeum fmeum deleted the runtime-deps-fix branch January 17, 2025 19:30
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