https://pantsbuild.org/ logo
#development
Title
# development
e

enough-analyst-54434

03/19/2021, 3:44 PM
Has the idea come up yet to support a trace intrinsic? It would be useful to be able to add something like this to a rule to debug:
Copy code
trace = await Get(Trace, Here())
print(f"At {here}")
And have a rendering of the stack of rules that are suspended waiting on the current (
Here()
) rule.
h

hundreds-father-404

03/19/2021, 4:56 PM
I don't think it has! I like that a lot! What do you mean rules that are suspended?
e

enough-analyst-54434

03/19/2021, 5:03 PM
The call stack. Most vivdly, for
await Get
calls you are literally suspended. For chaining rule input parameters its less vivid.
There can be more than one stack of course, so there would need to be some choice. Maybe paramtrizable
Here(All)
vs
Here(Any)
.
Put another way or rendered anothe way - the subgraph of the rule graph waiting on me.
w

witty-crayon-22786

03/19/2021, 5:28 PM
we have that (for better or worse) in two forms: workunits and the Graph
so yea, could do.
also, in case you do this: i’m about 90% sure we’ll need to support non-
Get
await
usage at some point (i.e. for methods of the `Console`/`Workspace`), particularly for https://github.com/pantsbuild/pants/issues/10542
👍 1
(in case that would allow for better syntax here)