I'm upgrading from Pants 2.16.0 to 2.18.0. We have...
# plugins
d
I'm upgrading from Pants 2.16.0 to 2.18.0. We have a number of internal plugins in the repo. There were six plugin unit tests that were failing. I fixed five of them by swapping out
pants.backend.python.goals.setup_py
with `package_dists`; looks like the file was refactored in see this commit. However, I still have one test that is failing. The output looks something like this:
Copy code
E       ValueError: Encountered 27 rule graph errors:
E         No installed rules return the type AddPrefix, and it was not provided by potential callers of @rule(<intrinsic>(AddPrefix) -> Digest).
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 CreateArchive, and it was not provided by potential callers of @rule(pants.core.util_rules.archive:47:create_archive(CreateArchive) -> Digest, gets=[Get(Digest, [CreateDigest]), ZipBinary, BashBinary, TarBinary, Get(Digest, [MergeDigests]), Get(ProcessResult, [Process])]).
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 CreateDigest, and it was not provided by potential callers of @rule(<intrinsic>(CreateDigest) -> Digest).
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.

...
Any ideas on what other changes might be causing this?
c
does your plugin involve API union types?
d
No, it's not using union types
c
ok, bummer. there’s a common gotcha involving union types otherwise. best tip I have for you then is to run with trace logging, you’ll get a dot graph you can render representing the rule graph which is usually easier to identify what is missing in..
d
Can you direct me to instructions on how I would do that?
c
I don’t think we have this in the docs, if you’d want to contribute a section once you’ve learned how it works, that would be much appreciated 🙂
Copy code
pants --no-pantsd -ltrace ...
[...]
15:57:57.34 [TRACE] // errored subgraph:
digraph {
[...]
}

Exception caught: (builtins.ValueError)
Copy the
digraph { … }
part to a file and render it using
dot
(from the graphviz library)
Copy code
dot -Tsvg <file> -o <img>.png
can use other output types supported by
dot
as desired.
d
There is a section in the docs on using
--engine-visualize-to=$dir_path$goal
to generate the graphviz files and then generates PDFs. On my machine, however, it took about an hour to generate the PDFs because of the inane number of nodes in the graph.
c
oh wow. yea, I didn’t think those worked with graph errors present.. but I may of course be mistaken on that 😬