quaint-telephone-89068
02/13/2023, 8:28 PMroot_output_directory field, which allows for the output digest from a process to be rooted somewhere other than the working directory.
Similarly, output_files and output_directories can be specified as relative to the working directory, which may end up being ../-ed locations (as long as they do not jump out of the build root.
Frustratingly, Process provides its outputs relative to the workdir that is provided to Process, which means that capturing files relative to the build root involves a cumbersome hack: the Process is modified to be a bash process that calls cd into the original workdir, the workdir is set to None and output_files and output_directories are mangled to compensate. The argv sequence is shlex.join()-ed into a shell argument string, which limits the effective maximum length of the arguments somewhat.
It would be handy if it were possible to make Process output files relative to the build root automatically.
pantsbuild/pants