Tweak BUILD setup to make the layering check change less disruptive (cherry-pick) #15838
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.
We recently updated the codebase to comply with the Bazel layering check, which essentially requires any C++ header inclusion to be matched with a build dependency on a target providing that header.
As part of that, I removed a handful of dependencies from the
//:protobuf
target, since these dependencies were not set up in a way that respected the layering check. However, I realized that this may cause a number of breakages, especially since we did not provide the correct public targets until very recently.This change effectively adds back in the missing dependencies, so that projects which do not yet adhere to the layering check can continue to depend on them indirectly. This way, we still adhere to the layering check and make it possible for projects that depend on us to do so, but in most cases we won't immediately break anyone.
PiperOrigin-RevId: 607021111