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

Don't create a subpath for extracted_srcjar #767

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

antonsviridov-src
Copy link
Contributor

@antonsviridov-src antonsviridov-src commented Dec 9, 2024

Closes GRAPH-988

This avoids an issue where we declare output to be a prefix of the rule's own outputs:

testing_test                           (prefix)
testing_test/extracted_srcjar/...      (longer path starting with prefix)

Doesn't seem like it was necessary to use nesting, as long as the output name contains both the source jar path, and the task name.

Here's the original error from Bazel (formatting mine, you just now Bazel doesn't output no newlines or structure...):

ERROR: 
     output path 'bazel-out/darwin_arm64-fastbuild/bin/src/main/java/srcjar_example/testing_test' 
     (belonging to //src/main/java/srcjar_example:testing_test) 
is a prefix of 
     output path 'bazel-out/darwin_arm64-fastbuild/bin/src/main/java/srcjar_example/testing_test/extracted_srcjar/src/main/java/srcjar_example/sources.srcjar' 
     (belonging to //src/main/java/srcjar_example:testing_test). 

These actions cannot be simultaneously present; please rename one of the output files or build just one of them

Test plan

Added a test case from #757

This avoids an issue where we declare output to be a prefix of the rule
@antonsviridov-src antonsviridov-src marked this pull request as ready for review December 9, 2024 15:47
@antonsviridov-src antonsviridov-src merged commit 62df280 into main Dec 9, 2024
22 checks passed
@antonsviridov-src antonsviridov-src deleted the bazel-aspects-no-common-prefix-paths branch December 9, 2024 16:09
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