Traverse CrateGroupInfo when gathering CcInfo linking_context entries for use_cc_common_link#3787
Open
ObsidianMinor wants to merge 1 commit intobazelbuild:mainfrom
Open
Conversation
UebelAndre
requested changes
Dec 19, 2025
Collaborator
UebelAndre
left a comment
There was a problem hiding this comment.
Thanks! Is there a unit test you could add somewhere in //test/unit or something? Would love to have some protection against regressions.
Author
|
Yeah I was wondering where I should put that, since there's only one test I think actually exercising this experimental flag and the configuration looks mildly complex. But I'll see if I can add something to it. |
… for use_cc_common_link Certain code written before crate groups were introduced wasn't adjusted to traverse groups, specifically code that traverses crate deps to discover cc_info. collect_deps properly does flatten crate_groups, so this moves the code for flattening a list of DepVariantInfo into a utility function, 'flatten_crate_groups'. This fixes rust_library_group and rust_prost_library for experimental_use_cc_common_link.
6983cb3 to
ac7d5c0
Compare
Author
|
Turns out with further testing there's more places that don't account for crate groups. So this patch was incomplete and would fix direct dependencies, but not indirect dependencies, which happens during establish_cc_info. I've updated it to factor out the crate group flattening into a separate function plus the added tests. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This fixes rust_library_group and rust_prost_library for experimental_use_cc_common_link
Closes #3786