-
Notifications
You must be signed in to change notification settings - Fork 231
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
Idea: "target set" language for specifying target patterns #749
Comments
The uquery context does have operators. They're not as good as Jujutsu's, but they go alright. I forget the symbols a lot but + is union and I think ^ is intersection (?). Most of the functions like attrfilter() are designed to take the thing they're filtering as an argument rather than the JJ-revset style "just give me some sets and let me intersect or subtract them". I can see why it might have been designed this way -- Buck target sets have to be quite lazy because you don't want to have to materialize large swaths of a megarepo from VFS just to evaluate Simpler question: should you be able to |
Here are a few of our use cases where this would come in handy:
In both cases, it is possible to write cqueries to get what they want, but the ergonomics are rather poor for day to day use. |
While talking on Discord about a general idea of "How do I skip some tests that are slow", I came up with an idea I wanted to post here on the bug tracker:
For example, one thing I like to do is test clean build times for Rust compiles, cargo vs buck. But cargo keeps downloads cached even after a clean, while buck doesn't. So the first thing I do is some monstrosity like
buck2 build $(buck2 uquery "kind('http_archive', deps('//...'))" | grep third-party//)
which is basically saying "Download allhttp_archive
files" first and foremost, then you can run the normal build. But it's kind of awkward to write out and probably doesn't work on Windows.But instead, I could do:
buck2 build 'rule(exact:"http_archive") & cell("third-party") & depOf("//...")'
and it works everywhere.I actually use this all the time and it would make many forms of automation obsolete if I could more programmatically select target names from a simple language with expressions and operators.
Before getting into the weeds here, would something like this be sensible? I guess it's kind of tricky because there's a question of whether things like
select()
or configurations should be considered. But it feels like a lot of basic examples like the above should be "sort of" easy to translate to aquery
expression, and they would provide a lot of open ended value. Slow tests and particular rules are just one example.The text was updated successfully, but these errors were encountered: