What should be done if a file has a "rule cycle" b...
# development
f
What should be done if a file has a "rule cycle" between two rules given the engine currently requires a referenced call-by-name rule to already be defined if called in the same file? https://github.com/pantsbuild/pants/pull/22269#pullrequestreview-2838435551
w
I had to split this out to a separate file when I had to do it, like I'm living in the stone age
f
Will a rule cycle between two files work? At the very least, it'll be an import cycle and I'll likely have to hide the imports inside each function.
w
As in, I had a 3rd utility file that other ones pulled in. It was for docker and I hated it.
f
I'm encountering a rule cycle in core/system_binaries.py for the BashBinary rule
I wonder how hard it would be to allow forward references for rules with call-by-name.
w
Im guessing it will follow some of the hurdles of the rule_helper? As in, same limitations probably
Maybe there is prior art?
h
I remember going deep into this about a year ago: https://github.com/pantsbuild/pants/pull/21174
Long story short, this is hard
At least for now. Once we’re fully on call-by-name we can get rid of the thing that makes this hard…
But of course we can’t do that until we port this to call-by-name, so chicken meet egg
🐔 2
🍳 2