little-easter-51691
04/01/2022, 3:21 PMhappy-kitchen-89482
04/01/2022, 4:04 PMlittle-easter-51691
04/01/2022, 4:51 PMarchive
target (zip), files of the other project are also picked up via files
(here I'd add the generated dir/folders in a subdir)witty-crayon-22786
04/01/2022, 5:01 PMexperimental_shell_command
should be able to depend on a pex_binary
to pull it in… if not, that would be worth filing an issue forhappy-kitchen-89482
04/01/2022, 6:07 PMarchive
target depending on the experimental_shell_command
cause it to run when you package
the archive target
?witty-crayon-22786
04/01/2022, 6:08 PMhappy-kitchen-89482
04/01/2022, 6:08 PMlittle-easter-51691
04/01/2022, 7:34 PMpython_sources()
pex_binary(
name="binary",
entry_point="script.py:main",
)
experimental_shell_command(
name='generate-output',
command='sh -c ./src.python.myoutputproject/binary.pex',
dependencies=[':binary'],
outputs=['foo/'],
tools=["sh"]
)
archive(
name="archived-output",
format="zip",
files=[":generate-output"]
)
I debugged a bit:
myoutputproject cd /tmp/process-execution5SOGuS
➜ process-execution5SOGuS ls
__run.sh src src.python.myoutputproject
process-execution5SOGuS cat __run.sh
#!/bin/bash
# This command line should execute the same process as pants did internally.
export TOOLS=$'mkdir ln sh' ln=/usr/bin/ln mkdir=/usr/bin/mkdir sh=/usr/bin/sh
cd /tmp/process-execution5SOGuS/src/python/myoutputproject
/usr/bin/bash -c $'$mkdir -p .bin;for tool in $TOOLS; do $ln -sf ${!tool} .bin; done;export PATH="$PWD/.bin";sh -c ./src.python.myoutputproject/outputbin.pex'
Here the __run.sh
script cds into the project folder, the trick is to cd out again _command_='../../../src.python.myoutputproject/binary.pex',
(not sure if there is variable one could use to point to the created tmp dir)witty-crayon-22786
04/01/2022, 9:44 PMexperimental_shell_command
is still marked experimental.
would you mind filing an issue? it does seem odd to me that the cwd
of the process is nested below its working directory… even if the inputs are nested, it doesn’t seem like the script itself should be. or perhaps, all of the inputs should be nested in the same way.${process_sandbox}/shell
with all of the process’s inputs nested below the CWDlittle-easter-51691
04/02/2022, 1:25 AM