-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[7.2.0] Fix bazel fetch
#21841
Merged
Merged
[7.2.0] Fix bazel fetch
#21841
Conversation
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
PiperOrigin-RevId: 579840409 Change-Id: I67eeea72f2bb935581f6f7afe71f0b72fb6f4c1a
This annotation is orthogonal to AutoCodec and creates a circular dependency in a later change. PiperOrigin-RevId: 579867965 Change-Id: Iff7ab004d7635c32edb9de38231b2d4c93469c6f
Work towards platform-based flags: #19409. PiperOrigin-RevId: 580452068 Change-Id: If94e0fbd9a815bfe3decca21ef1fd58003b4c366
This CL adds aspect nodes as explicit targets in cquery deps by making ConfiguredTargetQueryEnvironment generic over a new interface, CqueryNode, rather than ConfiguredTarget. CqueryNode is implemented by AspectKey as well as ConfiguredTarget so that both can be traversed in a deps query. PiperOrigin-RevId: 595509373 Change-Id: I8a637cd3ed640907d2b1501bcd2b4a4507d183e7
Context: - Traditional query relies on the initial loading phase of the build, this lacks the context of build configurations (flags, select() logic), leading to potentially inaccurate or over-inclusive dependency listings. - cquery executes after the analysis phase, where Bazel has resolved configurations and determined how options influence target definitions. This allows cquery to provide the dependencies truly needed for a build under the current settings. Considering these differences, I'm updating fetch target logic to rely on cquery instead. This ensures that all necessary repositories are fetched for an offline build while avoiding potential over-fetching PiperOrigin-RevId: 611455579 Change-Id: I2a954476c06182fd9eb78ad86def7bd72f04074a
Using cquery for fetching targets caused some problems #21728 as cquery is not prepared to deal with targets including `...` Updated the logic to use build command with no-build option, which should operate the same and actually do less work than cquery PiperOrigin-RevId: 619540572 Change-Id: Id26a61229c13bd12373478fe17e67200f2760be2
github-actions
bot
added
awaiting-review
PR is awaiting review from an assigned reviewer
team-Configurability
platforms, toolchains, cquery, select(), config transitions
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
team-Performance
Issues for Performance teams
team-Rules-CPP
Issues for C++ rules
team-Rules-Java
Issues for Java rules
team-Rules-Python
Native rules for Python
labels
Mar 28, 2024
meteorcloudy
approved these changes
Mar 28, 2024
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.
Thanks!
github-actions
bot
removed
the
awaiting-review
PR is awaiting review from an assigned reviewer
label
Mar 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
team-Configurability
platforms, toolchains, cquery, select(), config transitions
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
team-Performance
Issues for Performance teams
team-Rules-CPP
Issues for C++ rules
team-Rules-Java
Issues for Java rules
team-Rules-Python
Native rules for Python
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.
Context:
Fetch uses traditional query which relies on the initial loading phase of the build,
this lacks the context of build configurations (flags, select() logic),
leading to potentially inaccurate or over-inclusive dependency listings.
To address this issue, the logic has been revised to rely on the build command but with
--nobuild
flag. Then Bazel stops its operations after the analysis phase, during which it resolves configurations and determines how options impact target definitions. This adjustment guarantees that all essential repositories are fetched for offline builds, while avoiding potential over-fetchingBackported commits: