Hey folks! Just trying out Pants for the first tim...
# general
a
Hey folks! Just trying out Pants for the first time and run into an issue that I've not had much luck with in a few hours of debugging. I've got a chain of targets: •
shell_sources
with a script •
shell_command
depending on the above and running the script outputting a file •
resources
depending on the above and using the file as a resource • ...bits of a Python app that use the resources This breaks at the
shell_command
--> thread for more details.
I believe the python app and the resources work fine because I'm packaging other files with no problem and the python app runs sufficiently for these resources to be used.
I tried changing the
shell_command
to executed
exit 1
and
pants run
on the app doesn't fail as I would expect it to.
The failure mode is that the file generated by the command isn't present in the resources, but it seems the deeper problem is that
shell_command
isn't running at all.
I can't seem to run the
shell_command
independently, and I'm not sure which goals it supports, but the docs suggest that the way I'm using it would be expected to work.
Have I misunderstood something about how the goals work? I'm coming from blaze/bazel, where I'd have expected
shell_command
to be runnable independently, and to have run to allow dependent targets to run.
I'm running now with
--no-local-cache --no-pantsd
in an attempt to remove all caching variables.
I did try the graphing tools but >1000 dot files were generated and the few I checked didn't seem to have anything relevant to debugging in them.
If it matters, I'm running this all within a macro.
Ah. This won't work will it.
resources
must essentially take a limited copy of the source tree, whereas
shell_command
runs in a sandbox. This doesn't explain the
shell_command
not running though.
Ah ha! It looks like
experimental_wrap_as_resources
might be the answer.
Certainly making progress with it.
👍 2
Thanks all!!