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

hundreds-father-404

02/07/2020, 11:47 PM
Almost completely removed
BuildFileAddresses
from the engine! https://github.com/pantsbuild/pants/pull/9091 The sole remaining issue is that
test.py
requesting an
AddressOriginMap
results in the
test
goal rule being unreachable. I can’t figure out how to fix it if anyone has a moment to take a look..Pull down the PR and in
test.py
uncomment out line 179
❤️ 1
👍 1
w

witty-crayon-22786

02/08/2020, 12:58 AM
what does the rule graph look like below
AddressOriginMap
?
h

hundreds-father-404

02/08/2020, 12:59 AM
Hm let me check. I’ll upload the PDF. Is this
graph.000.dot
or
rule_graph.dot.pdf
?
w

witty-crayon-22786

02/08/2020, 1:00 AM
the latter
👍 1
the former is a trace of the whole run.
👍 1
ie, the contents of the
Graph
the latter is a dump of the
RuleGraph
h

hundreds-father-404

02/08/2020, 1:01 AM
rule_graph.dot.pdf
(@aloof-angle-91616 if you have a moment to merge the rule graph visualization PR, it’d be very helpful. I’m happy to re-review if that’d help)
w

witty-crayon-22786

02/08/2020, 1:03 AM
you have a root for:
Select(AddressOriginMap) for (FilesystemSpecs, OptionsBootstrapper)
h

hundreds-father-404

02/08/2020, 1:03 AM
What does that mean?
w

witty-crayon-22786

02/08/2020, 1:03 AM
and another for
Select(AddressOriginMap) for AddressSpecs
👍 1
it means to get a Y, you need an (X, Z)
👍 1
these are the API docs.
we should generate something nicer. but.
was this the failing run?
h

hundreds-father-404

02/08/2020, 1:05 AM
Yes. I will upload the same graph from master in a moment
rule_graph.dot.pdf
a

aloof-angle-91616

02/08/2020, 1:06 AM
i’ll try to get the rule graph viz PR in
❤️ 1
w

witty-crayon-22786

02/08/2020, 1:07 AM
@hundreds-father-404: and what was the actual error?
h

hundreds-father-404

02/08/2020, 1:07 AM
Copy code
Exception message: Rules with errors: 1
  @goal_rule(pants.rules.core.test:136:run_tests(Console, TestOptions, InteractiveRunner, Addresses) -> Test, gets=[Get[Address](Addresses), Get[AddressAndDebugRequest](Address), Get[AddressAndTestResult](Address)]):
    Was not reachable, either because no rules could produce the params or because it was shadowed by another @rule.
w

witty-crayon-22786

02/08/2020, 1:08 AM
that's... unlikely.
h

hundreds-father-404

02/08/2020, 1:08 AM
Commenting out that
coordinator_of_tests
requires
AddressOriginMap
fixes it all
I doubt it’s being shadowed. I figured that there is no path to give the
AddressOriginMap
. This is the
await
that causes the coordinator to be called:
Copy code
results = await MultiGet(Get[AddressAndTestResult](Address, addr) for addr in addresses)
w

witty-crayon-22786

02/08/2020, 1:09 AM
well, no way to get an AddressOriginMap would look like something else i think.
test not being reachable means that it can't be computed using the registered RootRules.
h

hundreds-father-404

02/08/2020, 1:10 AM
*No way to get an
AddressOriginMap
given the above
await Get
, which only passes
Address
as a param (which then gets converted into
HydratedTarget
)
w

witty-crayon-22786

02/08/2020, 1:11 AM
if you don't see an error for the rule that computes the AddressOriginMap, then that shouldn't be your issue, i don't think.
but i'll try to look later. need to focus on improving these errors at some point.
👖 1
h

hundreds-father-404

02/08/2020, 1:13 AM
Okay, thank you! Very excited for this change to land
w

witty-crayon-22786

02/08/2020, 4:36 AM
going to unwind instead! hopefully tomorrow
sorry
a

aloof-angle-91616

02/08/2020, 4:36 AM
don't be sorry!
unwinding is a sacred practice protected by the pants constitution
❤️ 1
w

witty-crayon-22786

02/08/2020, 4:37 AM
😄
❤️ 1
the issue was probably the rule that we had installed to go from
Addresses -> Address
... i was worried that that one might be ambiguous.
one of the runs rendered:
Copy code
Ambiguous rules to compute Get[Address](Addresses) with parameter types (Address, AddressSpecs, Console, InteractiveRunner, OptionsBootstrapper):
  @rule(pants.init.engine_initializer:435:single_address(Addresses) -> Address) for Addresses
  Param(Address)
the inconsistent errors would be due to https://github.com/pantsbuild/pants/issues/8862 ... sorry about that.
👍 1
h

hundreds-father-404

02/09/2020, 1:16 AM
Hm, any idea why that rule would be an issue?
w

witty-crayon-22786

02/09/2020, 1:17 AM
see the error
(...on a wide enough screen to see the indentation)
Copy code
Param(Address)
vs
Copy code
@rule(pants.init.engine_initializer:435:single_address(Addresses) -> Address) for Addresses
will push a patch shortly.
❤️ 1
h

hundreds-father-404

02/09/2020, 1:24 AM
I don’t understand what that error means tbh. Thanks for investigating it and for the patch!
w

witty-crayon-22786

02/09/2020, 1:24 AM
@hundreds-father-404: if you have both an Address and Addresses in some context, which should you use to get an Address?
that's the ambiguity.
mmm... solving this the right way probably involves moving
ResolveError
... i need to run, but @hundreds-father-404: i pushed to https://github.com/pantsbuild/pants/pull/9091
👍 1
h

hundreds-father-404

02/09/2020, 1:30 AM
So should we introduce a wrapper type like UniqueAddress for that rule to disambiguate that you solely want one single address?
w

witty-crayon-22786

02/09/2020, 1:30 AM
see the commit i made... it doesn't need to be a rule.
h

hundreds-father-404

02/09/2020, 1:31 AM
Ah, good point!
w

witty-crayon-22786

02/09/2020, 1:31 AM
but there is an import cycle due to where
ResolveError
lives right now... i think we should probably move it to
base.exceptions
👍 1
Copy code
File "/Users/stuhood/src/pants/src/python/pants/engine/addressable.py", line 12, in <module>
    from pants.engine.mapper import ResolveError
  File "/Users/stuhood/src/pants/src/python/pants/engine/mapper.py", line 10, in <module>
    from pants.engine.parser import Parser
  File "/Users/stuhood/src/pants/src/python/pants/engine/parser.py", line 8, in <module>
    from pants.engine.struct import Struct
  File "/Users/stuhood/src/pants/src/python/pants/engine/struct.py", line 8, in <module>
    from pants.engine.addressable import addressable, addressable_list

Exception message: cannot import name 'addressable' from 'pants.engine.addressable' (/Users/stuhood/src/pants/src/python/pants/engine/addressable.py)
h

hundreds-father-404

02/09/2020, 1:31 AM
Good idea. Thank you!
w

witty-crayon-22786

02/09/2020, 1:31 AM
it doesn't need to be in "mapper.py"