Commit 5de9888
cquery: make it easier to source Starlark transitions
**Before:**
```
$ bazel cquery --transitions=lite <query with a target with a self (rule) transition>
FunctionPatchTransition -> //the:target (abcd1)
```
**After:**
```
$ bazel cquery --transitions=lite <query with a target with a self (rule) transition>`
Starlark transition:foo/bar/transition_def.bzl:21:32 -> //the:target (abcd1)
```
**Implementation notes:**
- This is a no-op for native transitions: https://github.com/bazelbuild/bazel/blob/a9206ebe275ce3de22f5c68b03ad58f6ae0b0cb2/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransition.java#L96
- StarlarkTransition.getName() already has the most helpful form: https://github.com/bazelbuild/bazel/blob/a9206ebe275ce3de22f5c68b03ad58f6ae0b0cb2/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java#L72
- This only updates rule transitions (rules that self-transition). Attribute transitions (transitions applied to rule attributes) already have this behavior: https://github.com/bazelbuild/bazel/blob/1661a9c3128dca895f4853c8c8d022902bf90d7e/src/main/java/com/google/devtools/build/lib/query2/cquery/TransitionsOutputFormatterCallback.java#L172
PiperOrigin-RevId: 4223738351 parent 6104e8f commit 5de9888
File tree
1 file changed
+1
-2
lines changed- src/main/java/com/google/devtools/build/lib/query2/cquery
1 file changed
+1
-2
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
| 205 | + | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
| |||
0 commit comments