Could somebody point me the guide for migration pa...
# general
r
Could somebody point me the guide for migration pants plugins from 2.12.0 to 2.13.0rc0? I'm now trying to upgrade pants, and seeing errors related to rule graphs.
1
Copy code
13:38:22.35 [ERROR] Encountered 16 rule graph errors:
  No installed rules return the type InjectPexBinaryEntryPointDependency, and it was not provided by potential callers of @rule(pants.backend.python.target_types_rules:207:inject_pex_binary_entry_point_dependency(InjectPexBinaryEntryPointDependency, PythonInferSubsystem, PythonSetup) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]).
    If that type should be computed by a rule, ensure that that rule is installed.
    If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
  No installed rules return the type InjectPythonDistributionDependencies, and it was not provided by potential callers of @rule(pants.backend.python.target_types_rules:420:inject_python_distribution_dependencies(InjectPythonDistributionDependencies, PythonInferSubsystem) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPythonDistributionEntryPoints, ResolvePythonDistributionEntryPointsRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]).
    If that type should be computed by a rule, ensure that that rule is installed.
    If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
  No installed rules return the type WrappedTargetRequest, and it was not provided by potential callers of @rule(pants.engine.internals.graph:330:resolve_target(WrappedTargetRequest, TargetTypesToGenerateTargetsRequests) -> WrappedTarget, gets=[Get(_TargetParametrizations, _TargetParametrizationsRequest)]).
    If that type should be computed by a rule, ensure that that rule is installed.
    If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
  No source of dependency Get(ExplicitlyProvidedDependencies, DependenciesRequest) for @rule(pants.backend.python.target_types_rules:207:inject_pex_binary_entry_point_dependency(InjectPexBinaryEntryPointDependency, PythonInferSubsystem, PythonSetup) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency Get(ExplicitlyProvidedDependencies, DependenciesRequest) for @rule(pants.backend.python.target_types_rules:420:inject_python_distribution_dependencies(InjectPythonDistributionDependencies, PythonInferSubsystem) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPythonDistributionEntryPoints, ResolvePythonDistributionEntryPointsRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency Get(PythonModuleOwners, PythonModuleOwnersRequest) for @rule(pants.backend.python.target_types_rules:207:inject_pex_binary_entry_point_dependency(InjectPexBinaryEntryPointDependency, PythonInferSubsystem, PythonSetup) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency Get(PythonModuleOwners, PythonModuleOwnersRequest) for @rule(pants.backend.python.target_types_rules:420:inject_python_distribution_dependencies(InjectPythonDistributionDependencies, PythonInferSubsystem) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPythonDistributionEntryPoints, ResolvePythonDistributionEntryPointsRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest) for @rule(pants.backend.python.target_types_rules:207:inject_pex_binary_entry_point_dependency(InjectPexBinaryEntryPointDependency, PythonInferSubsystem, PythonSetup) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency Get(ResolvedPythonDistributionEntryPoints, ResolvePythonDistributionEntryPointsRequest) for @rule(pants.backend.python.target_types_rules:420:inject_python_distribution_dependencies(InjectPythonDistributionDependencies, PythonInferSubsystem) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPythonDistributionEntryPoints, ResolvePythonDistributionEntryPointsRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency Get(WrappedTarget, WrappedTargetRequest) for @rule(pants.backend.python.target_types_rules:207:inject_pex_binary_entry_point_dependency(InjectPexBinaryEntryPointDependency, PythonInferSubsystem, PythonSetup) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency Get(WrappedTarget, WrappedTargetRequest) for @rule(pants.backend.python.target_types_rules:420:inject_python_distribution_dependencies(InjectPythonDistributionDependencies, PythonInferSubsystem) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPythonDistributionEntryPoints, ResolvePythonDistributionEntryPointsRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency Get(_TargetParametrizations, _TargetParametrizationsRequest) for @rule(pants.engine.internals.graph:330:resolve_target(WrappedTargetRequest, TargetTypesToGenerateTargetsRequests) -> WrappedTarget, gets=[Get(_TargetParametrizations, _TargetParametrizationsRequest)]). All potential sources were eliminated: []
  No source of dependency PythonInferSubsystem for @rule(pants.backend.python.target_types_rules:207:inject_pex_binary_entry_point_dependency(InjectPexBinaryEntryPointDependency, PythonInferSubsystem, PythonSetup) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency PythonInferSubsystem for @rule(pants.backend.python.target_types_rules:420:inject_python_distribution_dependencies(InjectPythonDistributionDependencies, PythonInferSubsystem) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPythonDistributionEntryPoints, ResolvePythonDistributionEntryPointsRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency PythonSetup for @rule(pants.backend.python.target_types_rules:207:inject_pex_binary_entry_point_dependency(InjectPexBinaryEntryPointDependency, PythonInferSubsystem, PythonSetup) -> InjectedDependencies, gets=[Get(WrappedTarget, WrappedTargetRequest), Get(ExplicitlyProvidedDependencies, DependenciesRequest), Get(ResolvedPexEntryPoint, ResolvePexEntryPointRequest), Get(PythonModuleOwners, PythonModuleOwnersRequest)]). All potential sources were eliminated: []
  No source of dependency TargetTypesToGenerateTargetsRequests for @rule(pants.engine.internals.graph:330:resolve_target(WrappedTargetRequest, TargetTypesToGenerateTargetsRequests) -> WrappedTarget, gets=[Get(_TargetParametrizations, _TargetParametrizationsRequest)]). All potential sources were eliminated: []
I think the source of error is https://github.com/lablup/backend.ai/blob/main/tools/pants-plugins/platform_resources/register.py which is written with the help of @curved-television-6568...
c
I think tnis may be the relevant change: https://github.com/pantsbuild/pants/pull/16107/files
👀 2
Josh has been kind enough to include the docs update in the same PR.
r
Thanks for the pointer! I'll look into.
It no longer generates the rule graph errors, but it seems that my rule function is not executed at all..
Hmm... I need some help on this plugin API migration (inject -> infer dependencies). Referring pantsbuild/pants#16107, the API change semes to be almost straight-forward, but I get lost because my rule function is not entered at all, so it is impossible to debug the changed logic.
b
Can you give code snippets of your code before and after?
r
what i'm observing is that
infer_platform_specific_dependencies()
function is not entered at all
b
Are you sure your targets have both of the
required_fields
on them?
It looks like it, if you're expecting it to work on
platform_resources
target 🤔
Oh duh, lol. This change is in Pants 2.14 😂 https://github.com/pantsbuild/pants/pull/16107
The pull request first appeared in release_2.14.0.dev3
r
Ah, then how could I keep the prior version of my plugin compatible with 2.13? It still had a rule graph error as illustrated in the first message of this thread.
b
There was a change to start using
WrappedTargetRequest
. That might've gone in 2.13 I think.
1
Now it works!
b
awesome!