https://pantsbuild.org/ logo
#development
Title
# development
h

happy-kitchen-89482

07/09/2021, 5:14 PM
Can output_files/output_directories in a
Process
be globs?
w

witty-crayon-22786

07/09/2021, 5:22 PM
no. but … i’m not 100% sure that we enforce that.
we should.
because the remote execution API requires literals
h

happy-kitchen-89482

07/09/2021, 5:22 PM
hmmm
that presents a problem
w

witty-crayon-22786

07/09/2021, 5:23 PM
can you put something inside of an output directory?
directories are implicitly a recursive glob.
after that you can use
DirectorySubset
to filter out some subset.
h

happy-kitchen-89482

07/09/2021, 5:23 PM
Right now the thing (
setup.py develop
) writes all over the place
I'll see if I can restrict it
hmm, is it easy to cwd in a process execution before running the actual process?
w

witty-crayon-22786

07/09/2021, 5:24 PM
with a bash or python wrapper script, yes.
there is also a “working_directory” parameter on Process that i have not fully understood… but @enough-analyst-54434 fixed its semantics recently. cc @fast-nail-55400
h

happy-kitchen-89482

07/09/2021, 5:25 PM
that might be the solution
f

fast-nail-55400

07/09/2021, 5:26 PM
at least in REAPI, the “working directory” is a directory in the input root that will be the current directory for the process during execution
w

witty-crayon-22786

07/09/2021, 5:26 PM
it should now be consistent
f

fast-nail-55400

07/09/2021, 5:26 PM
@enough-analyst-54434’s fix was for a REAPI compliance bug I introduced in the remote cache code. The output directories are captured relative to the working directory as opposed to the root of the sandbox.
but I had not included the relative to working directory behavior
frankly I think the REAPI should be changed but that idea did not carry the day at the REAPI Working Group given other impls followed the standard
h

happy-kitchen-89482

07/09/2021, 5:50 PM
Locally, at least, the working directory is the root of the sandbox, AFAICT
w

witty-crayon-22786

07/09/2021, 5:50 PM
yes: that is the default value of that Process argument.
f

fast-nail-55400

07/09/2021, 5:59 PM
but just a default, REAPI allows it to be changed
h

happy-kitchen-89482

07/09/2021, 6:22 PM
ok, and if I plumb that through then outputs should be specified relative to the working directory?
I didn't quite understand from the above what is the correct behavior vs the current behavior
w

witty-crayon-22786

07/09/2021, 6:23 PM
the current behavior matches the spec as far as we know.
yes, you can use the setting, and using it should be consistent across local and remote
here was John’s change to fix the known issue: http://github.com/pantsbuild/pants/pull/12197
h

happy-kitchen-89482

07/09/2021, 6:30 PM
Great, just what I need then