https://pantsbuild.org/ logo
#general
Title
# general
r

ripe-cpu-85141

08/02/2022, 1:55 AM
I tried with
protobuf_sources
and in that case, the result is added to the lambda. So I suspect my custom codegen module but I don't know where to look at. If I run
./pants export-codegen ::
, the files are generated at the right place, so I'm not sure why nothing is added to the lambda
h

happy-kitchen-89482

08/02/2022, 2:14 AM
We'd have to look at the relevant bits of the plugin code to figure it out, @fast-nail-55400 and @hundreds-father-404 are the top experts on this.
Presumably your rule is returning a
GeneratedSources
?
r

ripe-cpu-85141

08/02/2022, 2:38 AM
Correct
That said, I followed the doc about writing a codegen but I'm not sure to have understood everything. Especially the Request type of classes
I don't get why the generated code would correctly go under dist/codegen/my/path/generated/file.yaml but won't be included in the lambda.Is there something more to do than returning
GeneratedSources
with the Snapshot?
h

happy-kitchen-89482

08/02/2022, 4:55 AM
What path are you generating to? And is it correctly relative to a source root? (see
./pants roots
for the source roots in your repo)
r

ripe-cpu-85141

08/02/2022, 1:35 PM
I tried that, I don't think it works. + if I replace my target with a
resources
or
protobuf_sources
one, the files are included. That said, on this idea, if I have a path like
py/projects/myproject/src/myproject/conf/
with my yaml files, with the generated result on
py/projects/myproject/src/myproject/conf/generated
and a source root on
py/projects/myproject/src
, should the path on the Snapshot on
GeneratedSources
be
myproject/conf/generated/myyaml.yaml
?