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

Add proto toolchains as dependencies and collect runtime jar in the aspect #5222

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Aug 9, 2023

Add proto toolchains as dependencies and collect runtime jar in the aspect

Introduces ImplicitDepsProvider, which stores a mapping of rule types to implicit dependencies that need to be added to targets of the rule type (for the kotlin proto rule, this is determined dynamically according to the "variant" attribute), and augments the query proto during summarization. These labels can be found in the query output itself via "rule-input" fields of each target.

Adds attributes to the build_deps aspect so these dependencies can be reached for protos. This required adjusting the logic to allow traversal to go through targets without JavaInfo (the proto toolchain targets do not have a JavaInfo provider, but their "runtime" attribute is the java_library the IDE needs for resolving base classes.

Adds proto libraries as JAVA_RULE_TYPES in BlazeQueryParser so their deps are adequately reflected in the IDE.

For current query sync projects, this does not change what deps are built (as the runtime jars are picked up in the transitive deps for in-project proto libraries, which are "always build"), but it ensures that the runtime jars are marked as dependencies and built even if the ide doesn't need to build in-project protos.

@copybara-service copybara-service bot added the copybara-exported Added to PRs opened by copybara-service label Aug 9, 2023
@copybara-service copybara-service bot force-pushed the test_555229414 branch 8 times, most recently from dd37abe to 598a5f7 Compare August 14, 2023 22:49
…spect

Introduces ImplicitDepsProvider, which stores a mapping of rule types to implicit dependencies that need to be added to targets of the rule type (for the kotlin proto rule, this is determined dynamically according to the "variant" attribute), and augments the query proto during summarization. These labels can be found in the query output itself via "rule-input" fields of each target.

Adds attributes to the build_deps aspect so these dependencies can be reached for protos. This required adjusting the logic to allow traversal to go through targets without JavaInfo (the proto toolchain targets do not have a JavaInfo provider, but their "runtime" attribute is the java_library the IDE needs for resolving base classes.

Adds proto libraries as JAVA_RULE_TYPES in BlazeQueryParser so their deps are adequately reflected in the IDE.

For current query sync projects, this does not change what deps are built (as the runtime jars are picked up in the transitive deps for in-project proto libraries, which are "always build"), but it ensures that the runtime jars are marked as dependencies and built even if the ide doesn't need to build in-project protos.

PiperOrigin-RevId: 555229414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
copybara-exported Added to PRs opened by copybara-service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants