-
Notifications
You must be signed in to change notification settings - Fork 208
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
Set the compile jar to be the same as the output jar #479
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to make the compile jar the same as the output jar which will break the whole header / ABI jars for compile avoidance optimization.
Are you expecting any auxiliary files to be included in the compile jars? Note that the final binary (e.g: {java,android}_binary) will link in the output jar for each target, not the compile jar. That is intended only for compilation and why we do this optimization.
A test case showing what is broken would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm expecting auxiliary files in the output_jar to be available for use by follow-on targets.
A specific example is doing a wire_proto compile which generates the jar containing the generated .class files as well as the .proto files.
A follow-on target uses takes as input this jar and requires both the .proto and .class files as input.
Without this PR, the .proto files get removed when the ijar / hjar file is generated prior to compiling the follow-on target.
An alternate solution would be to include the srcjar as an input to the follow-on target, but the output jar is really the proper generated target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to force the output.jar to be used as a dep in a follow-on target build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
wire_proto
a Skylark rule?I'm guessing that
wire_proto
invokes some tool to compile its local proto source into either Kotlin/Java source code or direct to JVM bytecode?If the compiler needs access to transitive proto source, i.e: local proto source references protos in other libraries then you can make these protos available via a provider e.g: WireProtoInfo that your rule can then collect transitive instances of.