Ok fully stumped on Union Rules now. <https://gith...
# plugins
a
Ok fully stumped on Union Rules now. https://github.com/xlevus/pants2-plugins/pull/2/files#diff-173d7b1e4de36693f6c6b3b1aaf75f4252b8ddf52115ccea743d30af8d97b89bR130 When this runs w/ the commented MultiGet uncommented, I get errors:
Copy code
No installed rules return the type DockerPublishRequest, and it was not provided by potential callers of @rule(xlvs.pants.publish.docker.docker_push:8:publish_docker_image(DockerPublishRequest) -> PublishedPackageSet).
    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 PypiPublishRequest, and it was not provided by potential callers of @rule(xlvs.pants.publish.aws_s3.s3_upload:7:upload_s3(PypiPublishRequest) -> PublishedPackageSet).
    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.
Yet, with the
MultiGet
call uncommented, my prints are:
Copy code
>> DockerPublishRequest(built_package=BuiltPackage(digest=Digest('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 0), artifacts=()), fieldset=DockerPublishFieldSet(address=Address(examples/container_registry:image)))
Publishing 'examples/pypi_repository:example_package' to 'examples/pypi_repository:privatepypi'.
>> PypiPublishRequest(built_package=BuiltPackage(digest=Digest('66de45797a5ab5514223ade6a42dfd721b0099cf27860cc8a66c15eba606b3b3', 105), artifacts=(BuiltPackageArtifact(relpath='xlvs-pants2-pypi-example-0.0.1', extra_log_lines=()),)), fieldset=PublishTargetFieldSet(address=Address(examples/pypi_repository:example_package)))
Publishing 'examples/pypi_repository:example_package' to 'examples/pypi_repository:s3_bucket'.
>> S3PublishRequest(built_package=BuiltPackage(digest=Digest('66de45797a5ab5514223ade6a42dfd721b0099cf27860cc8a66c15eba606b3b3', 105), artifacts=(BuiltPackageArtifact(relpath='xlvs-pants2-pypi-example-0.0.1', extra_log_lines=()),)), fieldset=PublishTargetFieldSet(address=Address(examples/pypi_repository:example_package)))
FrozenOrderedSet([<class 'xlvs.pants.publish.python.targets.PypiPublishRequest'>, <class 'xlvs.pants.publish.docker.targets.DockerPublishRequest'>, <class 'xlvs.pants.publish.aws_s3.targets.S3PublishRequest'>])
Which looks like: • My
publish_request
type are the right subclasses. • my
PublishRequest
subclasses are a part of the
UnionMembership
👀 1
c
What command do you run to test that?
OK, found a command that triggers it..
a
pants publish ::
c
yeah, I had to narrow it down to exclude docker, as my daemon is in
/usr/local/bin
(didn’t bother to tweak the search path..)
but I agree, that you’re issue is fishy… still looking at it…
a
👍 Cheers. 100% I've been a dingus somewhere, but I can't see where.
c
that’s the thing, I can’t either, and got the feeling that the union wasn’t picked up properly, but it seems ok, thus far, so… digging deeper..
No, I can’t see what’s going wrong either.. for other pants maintainers, here’s what I got, so far:
Copy code
Register TASK: (name=<not defined>, Publish, (<class 'pants.util.meta.Console'>, <class 'pants.engine.target.Targets'>, <class 'pants.engine.unions.UnionMembership'>), publish, gets=(
         GetConstraints(output_type=<class 'pants.engine.target.Targets'>, input_type=<class 'pants.engine.addresses.UnparsedAddressInputs'>),
         GetConstraints(output_type=<class 'pants.core.goals.package.BuiltPackage'>, input_type=<class 'abc.PackageFieldSet'>),
         GetConstraints(output_type=<class 'xlvs.pants.publish.publish_subsystem.PublishedPackageSet'>, input_type=<class 'pants.util.meta.PublishRequest'>))) 

Register selector: <class 'pants.util.meta.Console'>
Register selector: <class 'pants.engine.target.Targets'>
Register selector: <class 'pants.engine.unions.UnionMembership'>
Register edge for: <class 'pants.engine.target.Targets'>  for  <class 'pants.engine.addresses.UnparsedAddressInputs'>
Register UNION edge for: <class 'pants.core.goals.package.BuiltPackage'>  on  <class 'abc.PackageFieldSet'>  as  <class 'pants.core.target_types.ArchiveFieldSet'>
Register UNION edge for: <class 'pants.core.goals.package.BuiltPackage'>  on  <class 'abc.PackageFieldSet'>  as  <class 'pants.backend.python.goals.package_pex_binary.PexBinaryFieldSet'>
Register UNION edge for: <class 'pants.core.goals.package.BuiltPackage'>  on  <class 'abc.PackageFieldSet'>  as  <class 'pants.backend.python.goals.setup_py.PythonDistributionFieldSet'>
Register UNION edge for: <class 'pants.core.goals.package.BuiltPackage'>  on  <class 'abc.PackageFieldSet'>  as  <class 'xlvs.pants.docker.build_image.DockerImageFieldSet'>
Register UNION edge for: <class 'xlvs.pants.publish.publish_subsystem.PublishedPackageSet'>  on  <class 'pants.util.meta.PublishRequest'>  as  <class 'xlvs.pants.publish.python.targets.PypiPublishRequest'>
Register UNION edge for: <class 'xlvs.pants.publish.publish_subsystem.PublishedPackageSet'>  on  <class 'pants.util.meta.PublishRequest'>  as  <class 'xlvs.pants.publish.docker.targets.DockerPublishRequest'>
Register UNION edge for: <class 'xlvs.pants.publish.publish_subsystem.PublishedPackageSet'>  on  <class 'pants.util.meta.PublishRequest'>  as  <class 'xlvs.pants.publish.aws_s3.targets.S3PublishRequest'>

---


Register TASK: (name=<not defined>, PublishedPackageSet, (<class 'xlvs.pants.publish.python.targets.PypiPublishRequest'>,), publish_pypi, gets=()) 

Register selector: <class 'xlvs.pants.publish.python.targets.PypiPublishRequest'>

---


Register TASK: (name=<not defined>, PublishedPackageSet, (<class 'xlvs.pants.publish.docker.targets.DockerPublishRequest'>,), publish_docker_image, gets=()) 

Register selector: <class 'xlvs.pants.publish.docker.targets.DockerPublishRequest'>

---


Register TASK: (name=<not defined>, PublishedPackageSet, (<class 'xlvs.pants.publish.python.targets.PypiPublishRequest'>,), upload_s3, gets=()) 

Register selector: <class 'xlvs.pants.publish.python.targets.PypiPublishRequest'>

---
And that looks just as for other goals using unions, such as the
lint
rule, which I’ve compared with, and at this level, can’t see any real differences.
And this is from the union membership:
Copy code
<class 'pants.util.meta.PublishRequest'>: {<class 'xlvs.pants.publish.docker.targets.DockerPublishRequest'>,
                                            <class 'xlvs.pants.publish.aws_s3.targets.S3PublishRequest'>,
                                            <class 'xlvs.pants.publish.python.targets.PypiPublishRequest'>},
So, all looks good on the tin, next for me would be to follow the trail into the rust engine.. haven’t done that. [More eyes wanted.. 😉 ]
a
thanks for having a look. Much appreciated.
👌 1
w
would you mind filing an issue for this one? can take a look.
a
👍 can do