hey we just bumped our pants version to 2.1.1rc1 t...
# general
h
hey we just bumped our pants version to 2.1.1rc1 to test out the fix for https://github.com/pantsbuild/pants/issues/11201 but now running a pants test on the target that was hitting the maxrecursion limit now results in pants hanging/spinning. The last few trace logs are like the following:
Copy code
12:59:32.16 [TRACE] Completed: Inferring Python dependencies.
12:59:32.16 [TRACE] Completed: Inferring dependencies on `__init__.py` files
12:59:32.16 [TRACE] Completed: Inferring dependencies on `__init__.py` files
12:59:32.16 [TRACE] Completed: Resolve direct dependencies
12:59:32.16 [TRACE] Completed: Resolve direct dependencies
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_unexpanded_targets
12:59:32.16 [TRACE] Completed: Inferring Python dependencies.
12:59:32.16 [TRACE] Completed: Inferring dependencies on `__init__.py` files
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_unexpanded_targets
12:59:32.16 [TRACE] Completed: Inferring Python dependencies.
12:59:32.16 [TRACE] Completed: Inferring dependencies on `__init__.py` files
12:59:32.16 [TRACE] Completed: Resolve direct dependencies
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_targets
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_targets
12:59:32.16 [TRACE] Completed: Resolve direct dependencies
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_unexpanded_targets
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_unexpanded_targets
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_targets
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_targets
I’m running
pants -ltrace --no-pantsd test …
if there’s additional debug flags i can set to get more insight into what it’s doing let me know
h
cc @witty-crayon-22786
w
argh. sorry folks.
h
How long did you wait before ctrl-cing? I’m curious if it does eventually evaluate. Of course, that’s not desirable to take that long to evaluate and this needs to be revisited again, but may help to understand what’s going on.
h
i have left it for probably over 10 minutes before hitting ctrl-c
👍 1
1
w
that’s definitely my fault. should have reproduced the bug before attempting to fix it.
h
and yah the cpu gets pegged when it hits this so smells of some infinite loop
👍 1
w
so. regarding reproducing the original issue: i’ll need a bit more information
h
What’s surprising to me is that it does evaluate in Python - doesn’t hang if you tweak the recursion limit. Iiuc, we didn’t tweak the algorithm and only ported it to Rust
h
yah i saw the commit, seemed straightforward enough
since we’re upgrading from an earlier version of pants and our dependencies are already explicit, would it be worthwhile to test this with dependency inference off?
w
the thing that is glaringly missing here is an easier way to dump your entire graph of dependencies without running
./pants dependencies
once per file.
as i’m pretty sure reproducing means understanding the graph shape
h
i could dump the deps with --transitive for the test target no?
w
yes, but that wouldn’t get us the intermediate graph shape… the direct dependencies involved, basically.
h
@witty-crayon-22786 the closet we have to that is
./pants dependees --transitive --output-format=json ::
, which shows per-file. Would that help? You’d need to run on 2.1.0, as the
--transitive
flag is the part triggering the cycle
w
oh! awesome. yes, that’s exactly what we need.
h
ok, will do
w
@helpful-lunch-92084: if you feel comfortable sharing a (sanitized) version of that output, and identifying the problematic target, that would be very helpful.
h
yah let me double check on that
fwiw with pants 2.1.1rc1 i was able to run
./pants dependencies --transitive
on the test target in question, it didn’t hang
👀 1
w
h
Interesting, huh. Was the failing command
./pants test $bad_target
? I would expect that to behave the same as
./pants dependencies --transitive $bad_target
. It should be using the exact same problematic code path
w
if it’s sensitive, you can DM it and i can sanitize it.
h
ok, just curious why i would need to do it on 2.1.0?
yah that’s what i’m confused about, if it were related to dependency calculation it should fail on 2.1.1rc1
h
That command might work on 2.1.1rc1, and that’s fine if it does! I only anticipated you would get the same hang on rc1 because I suspect the code path to resolve transitive deps is what’s broken
h
oh i see it was dependees not dependencies
h
Yeah, but
dependees --transitive
uses the same code path as well for transitive deps as used by
test
and` dependencies --transitive`. So it’s fishy if it does not hang on rc1, but that’s useful data what happens.
h
yah dependees works on 2.1.1rc1 as well
i’ll dm you @witty-crayon-22786
w
thanks a ton, and sorry for the trouble.
❤️ 1
i spent the morning using the mapping you got me to try and get a repro, but i just realized that the tack i’m on will need a rethink (i shouldn’t need your source roots or 3rdparty mappings to repro this, but the harness i had set up assumed that i could get them)… tomorrow i’ll give that a fresh go, but am going to switch to other work for a bit
thanks again for the assistance, and sorry for the delay!
if it looks like we’re going to another RC soon, i can revert the previous “fix” so that your workaround will be fixed.
h
it’s ok, we can revert to 2.1.0 in the meantime