Ok, another stab at rule graph issues… I’m struggl...
# general
c
Ok, another stab at rule graph issues… I’m struggling a bit with addressing the issue reported here: https://github.com/pantsbuild/pants/pull/11872/checks?check_run_id=3027274218
So, after adding a missing rule to the test in question:
Copy code
@@ -343,6 +346,7 @@ def test_inject_python_distribution_dependencies() -> None:
     rule_runner = RuleRunner(
         rules=[
             inject_python_distribution_dependencies,
+            resolve_python_distribution_entry_points,
             *import_rules(),
             QueryRule(InjectedDependencies, [InjectPythonDistributionDependencies]),
         ],
I now get a whole bunch more graph issues…
Copy code
E       ValueError: Encountered 26 rule graph errors:
E         No installed rules return the type AddressSpecs, and it was not provided by potential callers of @rule(pants.engine.internals.build_files:159:addresses_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> Addresses, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Paths, PathGlobs), Get(AddressFamily, AddressFamilyDir)]).
E           If that type should be computed by a rule, ensure that that rule is installed.
E           If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E         No installed rules return the type DependenciesRequest, and it was not provided by potential callers of @rule(pants.engine.internals.graph:729:resolve_dependencies(DependenciesRequest, UnionMembership, GlobalOptions) -> Addresses, gets=[Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(WrappedTarget, Address), Get(InferredDependencies, InferPythonImportDependencies), Get(Subtargets, Address), Get(Address, AddressInput)]).
E           If that type should be computed by a rule, ensure that that rule is installed.
E           If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E         No installed rules return the type FilesystemSpecs, and it was not provided by potential callers of @rule(pants.engine.internals.graph:432:addresses_from_filesystem_specs(FilesystemSpecs, GlobalOptions) -> Addresses, gets=[Get(Paths, PathGlobs), Get(Owners, OwnersRequest)]).
E           If that type should be computed by a rule, ensure that that rule is installed.
E           If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E         No installed rules return the type ResolvePythonDistributionEntryPointsRequest, and it was not provided by potential callers of @rule(pants.backend.python.target_types_rules:145:resolve_python_distribution_entry_points(ResolvePythonDistributionEntryPointsRequest) -> ResolvedPythonDistributionEntryPoints, gets=[Get(Targets, UnparsedAddressInputs), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest)]).
E           If that type should be computed by a rule, ensure that that rule is installed.
E           If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E         No installed rules return the type ResolvedPexEntryPoint to satisfy Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest) for @rule(pants.backend.python.target_types_rules:145:resolve_python_distribution_entry_points(ResolvePythonDistributionEntryPointsRequest) -> ResolvedPythonDistributionEntryPoints, gets=[Get(Targets, UnparsedAddressInputs), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest)]).
E           Ensure that the rule you are expecting to use is installed.
E         No installed rules return the type Specs, and it was not provided by potential callers of @rule(pants.engine.internals.graph:471:resolve_addresses_from_specs(Specs) -> Addresses, gets=[Get(Addresses, AddressSpecs), Get(Addresses, FilesystemSpecs)]).
E           If that type should be computed by a rule, ensure that that rule is installed.
E           If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E         No source of dependency AddressSpecsFilter for @rule(pants.engine.internals.build_files:159:addresses_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> Addresses, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Paths, PathGlobs), Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
E         No source of dependency Get(Address, AddressInput) for @rule(pants.engine.internals.build_files:159:addresses_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> Addresses, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Paths, PathGlobs), Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
E         No source of dependency Get(Address, AddressInput) for @rule(pants.engine.internals.graph:729:resolve_dependencies(DependenciesRequest, UnionMembership, GlobalOptions) -> Addresses, gets=[Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(WrappedTarget, Address), Get(InferredDependencies, InferPythonImportDependencies), Get(Subtargets, Address), Get(Address, AddressInput)]). All potential sources were eliminated: []
E         No source of dependency Get(AddressFamily, AddressFamilyDir) for @rule(pants.engine.internals.build_files:159:addresses_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> Addresses, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Paths, PathGlobs), Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
E         No source of dependency Get(Addresses, AddressSpecs) for @rule(pants.engine.internals.graph:471:resolve_addresses_from_specs(Specs) -> Addresses, gets=[Get(Addresses, AddressSpecs), Get(Addresses, FilesystemSpecs)]). All potential sources were eliminated: []
E         No source of dependency Get(Addresses, FilesystemSpecs) for @rule(pants.engine.internals.graph:471:resolve_addresses_from_specs(Specs) -> Addresses, gets=[Get(Addresses, AddressSpecs), Get(Addresses, FilesystemSpecs)]). All potential sources were eliminated: []
E         No source of dependency Get(ExplicitlyProvidedDependencies, DependenciesRequest) for @rule(pants.engine.internals.graph:729:resolve_dependencies(DependenciesRequest, UnionMembership, GlobalOptions) -> Addresses, gets=[Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(WrappedTarget, Address), Get(InferredDependencies, InferPythonImportDependencies), Get(Subtargets, Address), Get(Address, AddressInput)]). All potential sources were eliminated: []
E         No source of dependency Get(InferredDependencies, InferPythonImportDependencies) for @rule(pants.engine.internals.graph:729:resolve_dependencies(DependenciesRequest, UnionMembership, GlobalOptions) -> Addresses, gets=[Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(WrappedTarget, Address), Get(InferredDependencies, InferPythonImportDependencies), Get(Subtargets, Address), Get(Address, AddressInput)]). All potential sources were eliminated: []
E         No source of dependency Get(Owners, OwnersRequest) for @rule(pants.engine.internals.graph:432:addresses_from_filesystem_specs(FilesystemSpecs, GlobalOptions) -> Addresses, gets=[Get(Paths, PathGlobs), Get(Owners, OwnersRequest)]). All potential sources were eliminated: []
E         No source of dependency Get(Paths, PathGlobs) for @rule(pants.engine.internals.build_files:159:addresses_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> Addresses, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Paths, PathGlobs), Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
E         No source of dependency Get(Paths, PathGlobs) for @rule(pants.engine.internals.graph:432:addresses_from_filesystem_specs(FilesystemSpecs, GlobalOptions) -> Addresses, gets=[Get(Paths, PathGlobs), Get(Owners, OwnersRequest)]). All potential sources were eliminated: []
E         No source of dependency Get(Subtargets, Address) for @rule(pants.engine.internals.graph:729:resolve_dependencies(DependenciesRequest, UnionMembership, GlobalOptions) -> Addresses, gets=[Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(WrappedTarget, Address), Get(InferredDependencies, InferPythonImportDependencies), Get(Subtargets, Address), Get(Address, AddressInput)]). All potential sources were eliminated: []
E         No source of dependency Get(TargetAdaptor, Address) for @rule(pants.engine.internals.build_files:159:addresses_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> Addresses, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Paths, PathGlobs), Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
E         No source of dependency Get(Targets, UnparsedAddressInputs) for @rule(pants.backend.python.target_types_rules:145:resolve_python_distribution_entry_points(ResolvePythonDistributionEntryPointsRequest) -> ResolvedPythonDistributionEntryPoints, gets=[Get(Targets, UnparsedAddressInputs), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest)]). All potential sources were eliminated: []
E         No source of dependency Get(UnexpandedTargets, Addresses) for @rule(pants.engine.internals.build_files:159:addresses_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> Addresses, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Paths, PathGlobs), Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
E         No source of dependency Get(WrappedTarget, Address) for @rule(pants.engine.internals.graph:729:resolve_dependencies(DependenciesRequest, UnionMembership, GlobalOptions) -> Addresses, gets=[Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(WrappedTarget, Address), Get(InferredDependencies, InferPythonImportDependencies), Get(Subtargets, Address), Get(Address, AddressInput)]). All potential sources were eliminated: []
E         No source of dependency GlobalOptions for @rule(pants.engine.internals.build_files:159:addresses_from_address_specs(AddressSpecs, GlobalOptions, AddressSpecsFilter) -> Addresses, gets=[Get(Address, AddressInput), Get(TargetAdaptor, Address), Get(UnexpandedTargets, Addresses), Get(Paths, PathGlobs), Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
E         No source of dependency GlobalOptions for @rule(pants.engine.internals.graph:432:addresses_from_filesystem_specs(FilesystemSpecs, GlobalOptions) -> Addresses, gets=[Get(Paths, PathGlobs), Get(Owners, OwnersRequest)]). All potential sources were eliminated: []
E         No source of dependency GlobalOptions for @rule(pants.engine.internals.graph:729:resolve_dependencies(DependenciesRequest, UnionMembership, GlobalOptions) -> Addresses, gets=[Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(WrappedTarget, Address), Get(InferredDependencies, InferPythonImportDependencies), Get(Subtargets, Address), Get(Address, AddressInput)]). All potential sources were eliminated: []
E         No source of dependency UnionMembership for @rule(pants.engine.internals.graph:729:resolve_dependencies(DependenciesRequest, UnionMembership, GlobalOptions) -> Addresses, gets=[Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(WrappedTarget, Address), Get(InferredDependencies, InferPythonImportDependencies), Get(Subtargets, Address), Get(Address, AddressInput)]). All potential sources were eliminated: []
Any help figuring out which rules (and/or QueryRules) needed appreciated. Looking at other tests, I can’t glean any hints as to what I could use.. will poke around some more on this in the mean time (only time you learn, is when trying to solve problems 😉 )
Bah, OK, I found it. The offending root issue, was this one:
No installed rules return the type ResolvedPexEntryPoint
after spotting that one, I added the resolve_pex_entry_point, and et voila, it works. phew.
room for improvement; would it be possible to detect this such, that there is an initial rule missing, and all others just follow from that (as was the case here..) that would make it much easier to grok what’s missing. 🙂
(oh, this thread prob belonged in #development.. my mistake)
w
very sorry about these errors: see https://github.com/pantsbuild/pants/issues/11254.
👍 1
i’m currently working on https://github.com/pantsbuild/pants/issues/11269 to resolve them (among other things)
🚀 1
@curved-television-6568: the #plugins room is also good for these questions… unlike the rest of pants, the plugin API is still beta/unstable
c
Ok, cool. Looking forward to it 🙂