Hello! I'm trying to get a digest from a relocated...
# plugins
a
Hello! I'm trying to get a digest from a relocated files target and for some reason all of the SourceFileRequests I'm sending aren't able to be evaluated:
Copy code
Exception: Could not find a rule to satisfy Get(SourceFiles, SourceFilesRequest, SourceFilesRequest(sources_fields=(<class 'pants.core.target_types.RelocatedFilesSources'>(alias='_sources', address=test_docker:moved_static, value={repr(self.value)}, default={repr(self.default)}),), for_sources_types=(<class 'pants.engine.target.Sources'>,), enable_codegen=False)).
Copy code
Exception: Could not find a rule to satisfy Get(SourceFiles, SourceFilesRequest, SourceFilesRequest(sources_fields=(<class 'pants.core.target_types.RelocatedFilesSources'>(alias='_sources', address=test_docker:moved_static, value={repr(self.value)}, default={repr(self.default)}),), for_sources_types=(<class 'pants.core.target_types.FilesSources'>,), enable_codegen=True)).
Looking at the code it looks like i should be able to use the codegen toggle with the HydrateSourcesRequest to create a
RelocateFilesViaCodegenRequest
(by specifying
FilesSources
as the requested generation type) however it doesn't seem like it ever gets that far?
h
Hello! Yes, that is how it should work. Are you able to share the code? These error messages are horrible and unfortunately the best way to debug them is by looking at the code and knowing what to look for
a
@hundreds-father-404 Hi! So sorry for the radio silence! I was at disneyworld for a week after posting and then got busy at work I am now getting a 415 graph errors still to do with relocated files: https://github.com/compyman/pants-docker/pull/2 Adding this rule to handle relocated files causes the graph error:
Copy code
UnionRule(DockerComponentRequest, DockerRelocatedFilesRequest),
If you remove that it does not raise graph errors but it does not know what to do with the relocated file targets The code is the exact same as handles the other types of non-python sources (One for FilesSources & one for ResourcesSources) any idea what's going on here(?)
here is the rule graph errors
w
hey @average-australia-85137: sorry for the delayed response (in turn!).
as mentioned to @curved-television-6568 in another thread: these errors are a priority for us, and one of the blockers for stabilizing the plugin API
1
in the meantime, what i would suggest would be to temporarily disable/remove registration of your
@rule
“in prod”, and iterate on getting it working in a test. once it is satisfiable in a test, it might be easier to tease apart what is missing in prod