numerous-apartment-3919
11/28/2023, 5:19 PMnumerous-apartment-3919
11/28/2023, 6:21 PMcollectstatic and package them with the pex file that is eventually included in our dockerfile.
I think what I want is an adhoc_tool definition that calls collectstatc as a dependency of the pex_build but that doesn't seem to produce any output in the sandboxcurved-television-6568
11/28/2023, 6:23 PM__run.sh script in there and obeserved it doesn’t produce the files? or just that those files are not picked up later on?numerous-apartment-3919
11/28/2023, 6:24 PMadhoc_tool get its own sandbox? Maybe Im just looking in the wrong place if socurved-television-6568
11/28/2023, 6:24 PMresource targets, while for docker you need them as file targets…curved-television-6568
11/28/2023, 6:25 PMadhoc_tool myself, so take what I’m guessing with a good pinch of salt, but my hunch is that that target runs your tool as a process, in which case it does so in a sandbox, dedicated for that tool yes.curved-television-6568
11/28/2023, 6:26 PMnumerous-apartment-3919
11/28/2023, 7:18 PMpex_binary or my particular config. I can make a new python_source that runs a debug script which depends on the same adhoc_tool and the sandbox contains the files I expectcurved-television-6568
11/28/2023, 7:39 PMfiles, you may try this new experimental target to convert them into `resources`: https://www.pantsbuild.org/docs/reference-experimental_wrap_as_resources (this relates to my comment above regarding files/resources for docker vs pex)numerous-apartment-3919
11/28/2023, 7:41 PMsource field in python_sources a file or a resource?curved-television-6568
11/28/2023, 7:42 PMpython_sources target generates one python_source for each source file.numerous-apartment-3919
11/28/2023, 7:42 PMpython_sourcenumerous-apartment-3919
11/28/2023, 7:42 PMcurved-television-6568
11/28/2023, 7:42 PMfile and resource are target types, as is python_sourcenumerous-apartment-3919
11/28/2023, 7:42 PMpython_source(name="debug", source="debug.py", dependencies=[":adhoc_collectstatic"])
adhoc_tool(
name="adhoc_collectstatic",
runnable=":collectstatic",
execution_dependencies=[":lib"],
output_directories=["static"],
)numerous-apartment-3919
11/28/2023, 7:43 PMstatic directorynumerous-apartment-3919
11/28/2023, 7:43 PMnumerous-apartment-3919
11/28/2023, 7:43 PMpex_binary(name="debug-bin", entry_point="debug.py", dependencies=[":lib", ":adhoc_collectstatic"])numerous-apartment-3919
11/28/2023, 7:43 PMcurved-television-6568
11/28/2023, 7:44 PMcurved-television-6568
11/28/2023, 7:44 PMfile targets…. (which is what I think the adhoc tool captures the output files as)numerous-apartment-3919
11/28/2023, 7:45 PMnumerous-apartment-3919
11/28/2023, 7:46 PMexperimental_wrap_as_resources target whose inputs were the adhoc_tool target name and the outputs are a new target name that is resource-wrapped-file?numerous-apartment-3919
11/28/2023, 7:47 PMcurved-television-6568
11/28/2023, 7:47 PMnumerous-apartment-3919
11/28/2023, 7:50 PMnumerous-apartment-3919
11/28/2023, 7:50 PMpex_binary(name="debug-bin", entry_point="debug.py", dependencies=[":lib", ":foo"])
experimental_wrap_as_resources(name="foo", inputs=[":adhoc_collectstatic"])
adhoc_tool(
name="adhoc_collectstatic",
runnable=":collectstatic",
execution_dependencies=[":lib"],
output_directories=["static"],
)numerous-apartment-3919
11/28/2023, 7:50 PMcurved-television-6568
11/28/2023, 7:51 PMnumerous-apartment-3919
11/28/2023, 7:51 PM