interesting call-by-name edge case for `RuleRunner...
# development
f
interesting call-by-name edge case for `RuleRunner.run_rule_with_mocks`: If the call-by-name invocation occurs as part of a heterogenous
concurrently
, then
run_rule_with_mocks
is unable to currently figure out what arguments to pass when
implicitly
is in use since the args are recorded as an empty tuple and the args are actually under the
__implicitly
key. https://github.com/pantsbuild/pants/pull/22353/files#diff-9c9b1ffd74ad9043f69419b3c4916014ac29789e496ad9f77d1e770f67e11d5cR752
Currently trying to figure out what to do with implicitly dict syntax with multiple entries. Any advice on an easier way to solve this issue is welcome.
h
Does the code at the link above work?
f
The code solves one of the issues, but it does not currently solve the
implicitly({foo: Type1, bar: Type2})
variant.
so the code is mainly only useful as a base to explore the issue
I am stuck currently on trying to figure out how to match the dict's entries with the mocks parameters.
Or whether there is a better way to handle this issue, for example maybe converting these
Coroutine
instances into
Call
instances or recording some additional information in the locals of the call frame inspected by
run_rule_with_mocks
(those are just top-of-mind ideas and not anything I've explored yet)
(and of course I left in an
ipdb
breakpoint ...)