Skip to content

Handle ambiguous headers in BCR#183

Draft
mateusz-olczyk wants to merge 9 commits intoEngFlow:mainfrom
mateusz-olczyk:ambiguous-deps-in-bcr
Draft

Handle ambiguous headers in BCR#183
mateusz-olczyk wants to merge 9 commits intoEngFlow:mainfrom
mateusz-olczyk:ambiguous-deps-in-bcr

Conversation

@mateusz-olczyk
Copy link
Collaborator

Fixes #173

New index.DependencyIndex type is now applied everywhere. Type ccDependencyIndex has been dropped.

This review is not so huge; most of the lines come from the new bzldep-index.json.

Warning

I needed to turn off WithAmbiguousTargetsResolved() call in BCR indexer. For some reason, the algorithm resolves "grpcpp/grpcpp.h" only to "@grpc//:grpc++_codegen_proto", which is incorrect.

bazel query 'somepath(":grpc++_codegen_proto", ":grpc++")' returns empty result, which is bad, because :grpc++ contains the crucial compiled code.

I guess the function GroupTargetsByHeaders() is not the right strategy for solving conflicts, because it groups targets if they intersect with at least one header in their "hdrs" lists - whatever it is.

Instead of grouping targets like this, we should consider the mapping from each recognized header to its parent targets. And then resolve conflicts in such defined groups of targets. This way, each header is treated separately.

Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
Signed-off-by: Mateusz Olczyk <molczyk@virtuslab.com>
@mateusz-olczyk mateusz-olczyk marked this pull request as draft January 19, 2026 19:50
Copy link
Collaborator

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

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

This is showing as +178,752 −32,736, too much to review. Can you split the update of bzldep-index.json into a separate PR? Then I can review that part by re-running the tool and verifying it produces the same output.

@mateusz-olczyk
Copy link
Collaborator Author

This is showing as +178,752 −32,736, too much to review. Can you split the update of bzldep-index.json into a separate PR? Then I can review that part by re-running the tool and verifying it produces the same output.

Sure, I'll do that later. For now, I've converted it to a draft, because a new problem appeared: #184

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.

Provide a better way to handle ambiguous headers in BCR indexer

2 participants