-
Notifications
You must be signed in to change notification settings - Fork 123
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
Proposal: use bazel's cquery in place of query for queryForSourceFiles checks #305
Comments
@josephperrott, I think this would be a really really great feature to add. I've been doing some repo cleanup with the goal of engaging you on this issue. How could I help get you engaged? All the code for controlling the query operation lives inside a small block inside the bazel lib. Lines 216 to 244 in 7741ff3
It doesn't look to me like it would be that hard to add a new method I'm about to do a release that will add colors (YAY!) and fix a lot of the output formatting issues (YAY!) but would love to do a |
Stale issue message |
Don't close this please.
…On Sat, Feb 15, 2020, 4:14 PM github-actions[bot] ***@***.***> wrote:
Stale issue message
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#305?email_source=notifications&email_token=AABUZ2EOYWP2BSJZZHN7EG3RDCAPFA5CNFSM4JU54OM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL32FGY#issuecomment-586654363>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUZ2BQWL732LAMV4WOHU3RDCAPFANCNFSM4JU54OMQ>
.
|
Stale issue message |
not stale |
@achew22 Thanks for working on this. I think unfortunately it's not improving things as there is still a The goal would be that the analysis cache is not discarded. We could achieve this by using
|
@devversion this sounds like a great issue to open upstream on the Bazel main repo. Unfortunately I don't have enough time to spin up on that particular issue, but I would be interested in seeing what they say. It could be something as simple as changing a Boolean value somewhere. That's something I would be happy to do. |
Hey y'all, bazel engineer here. @devversion is right, Out of curiosity, you're running two As for bazel changes, adding Here's the implementation in Bazel team probably doesn't have the cycles to own this but If you wanted to investigate/make this change in the bazel repo I'd be happy to shepherd your PRs through. |
This is a Windows-specific package being pulled in by github.com/spf13/cobra. We don't need it, and we don't ever build it (it's behind a select() gate depending on the Windows platform), but its lack causes us to not be able to perform Bazel queries against anything that stumbles upon this select statement. Notably, things like ibazel don't work without the ability to query dependencies of a target. In theory, cquery could be used of query (and cquery would know that it's not running on a windows platform and not attempt to resolve the missing package). This might happen some day, but: 1) cquery currently does not support the buildfiles() function, which is needed by tools like ibazel to find not only source/data/target dependencies for a taret, but also every BUILD/.bzl file that influenced that target. See: bazelbuild/bazel-watcher#305 (comment) 2) It's generally good practice to not have missing objects in our dependency graph, I think. We will sooner or later start using this data in CI and other automation, and it might be useful to make an assumption, at some point, that we don't ever have a broken target dependency graph. Testing plan: the following now works: bazel query 'deps(set(//...))' --output=xml Change-Id: Ic45e293b868b0aaa707f31384b4b24626ba23e29 Reviewed-on: https://review.monogon.dev/c/monogon/+/200 Reviewed-by: Leopold Schabel <[email protected]>
Currently ibazel uses
bazel query
to determine if the build graph has changed. Howeverbazel query
does not allow for configurations to be considered.If you set a
--define
flag for yourbuild
s, every time ibazel runsbazel query
, the analysis cache is invalidated in determining thequery
results only to have the results invalidated again by the nextbuild
.If
bazel cquery
is used instead, the--define
flag is now considered/valid and the correct graph is created.cquery
inherits all of its flags frombuild
(as doesrun
andtest
) which leads to all supported flags in ibazel being able to be forwarded to the "query" checksUnder the hood the commands that are called by ibazel in this instance look something like this:
with
cquery
it would instead be:The text was updated successfully, but these errors were encountered: