ancient-vegetable-10556
02/01/2022, 6:49 PMRunRequest and related infrastructure at the moment — is there a particular blocker around refactoring it to use a Process object rather than specifying raw args? Currently constructing a valid JVM process is complicated, so I’d love to make use of the JvmProcess infrastructure I used previously. (pinging @witty-crayon-22786 in particular since he’s seen the JvmProcess work thus far)witty-crayon-22786
02/01/2022, 6:56 PMwitty-crayon-22786
02/01/2022, 6:57 PMProcess, it will likely need to be an InteractiveProcesswitty-crayon-22786
02/01/2022, 6:57 PMancient-vegetable-10556
02/01/2022, 6:57 PMInteractiveProcess from a Process, most of the timeancient-vegetable-10556
02/01/2022, 6:57 PMjunit.pywitty-crayon-22786
02/01/2022, 6:58 PM@rule authors constructing the InteractiveProcess, to push considering those constraints to themancient-vegetable-10556
02/01/2022, 6:59 PMancient-vegetable-10556
02/01/2022, 9:52 PMrun executing things in a chroot workspace? Currently our JVM bootstrapper needs to ln a JAVA_HOME directory, which is done inline with running the relevant executable, but the chroot approach would probably involve some sort of two-step that we don’t currently have a good model forwitty-crayon-22786
02/01/2022, 9:58 PMancient-vegetable-10556
02/01/2022, 9:59 PMRunRequest, but Process doesn’t have a good model for this eitherwitty-crayon-22786
02/01/2022, 9:59 PMln was mostly supposed to support providing a stable location for the JDK to be referenced from within a command. if there is another way to accomplish that, then a chroot might not be necessary.witty-crayon-22786
02/01/2022, 10:00 PMancient-vegetable-10556
02/01/2022, 10:01 PMRunRequest so that we can run the preparation codeancient-vegetable-10556
02/01/2022, 10:01 PMwitty-crayon-22786
02/01/2022, 10:01 PMrun is mostly that the CWD may not be equal to your temporary directorywitty-crayon-22786
02/01/2022, 10:02 PMancient-vegetable-10556
02/01/2022, 10:02 PMjava_home come from then?ancient-vegetable-10556
02/01/2022, 10:02 PMwitty-crayon-22786
02/01/2022, 10:03 PMancient-vegetable-10556
02/01/2022, 10:04 PMwitty-crayon-22786
02/01/2022, 10:04 PMwitty-crayon-22786
02/01/2022, 10:04 PMancient-vegetable-10556
02/01/2022, 10:05 PMwitty-crayon-22786
02/01/2022, 10:09 PMwitty-crayon-22786
02/01/2022, 10:09 PMwitty-crayon-22786
02/01/2022, 10:09 PMrun?witty-crayon-22786
02/01/2022, 10:10 PMwitty-crayon-22786
02/01/2022, 10:11 PMProcess has been written using relative paths, absolutizing them is challenging without its supportancient-vegetable-10556
02/01/2022, 11:37 PMancient-vegetable-10556
02/01/2022, 11:37 PMwitty-crayon-22786
02/01/2022, 11:38 PMwitty-crayon-22786
02/01/2022, 11:39 PMancient-vegetable-10556
02/01/2022, 11:40 PMwitty-crayon-22786
02/01/2022, 11:40 PMwitty-crayon-22786
02/01/2022, 11:42 PMjava_home/bin becomes {chroot}/java_home/bin, etc.ancient-vegetable-10556
02/01/2022, 11:44 PMwitty-crayon-22786
02/01/2022, 11:44 PM{chroot} template variablewitty-crayon-22786
02/01/2022, 11:44 PMwitty-crayon-22786
02/01/2022, 11:45 PMsrc/python/pants/backend/python/goals/run_pex_binary.py for comparison… it basically prepends {chroot} to everything relevantancient-vegetable-10556
02/01/2022, 11:45 PMwitty-crayon-22786
02/01/2022, 11:46 PMwitty-crayon-22786
02/01/2022, 11:46 PMcoursier java-home can run anywhere, and will emit an absolute path to a JDKancient-vegetable-10556
02/01/2022, 11:46 PMwitty-crayon-22786
02/01/2022, 11:47 PMancient-vegetable-10556
02/01/2022, 11:47 PMwitty-crayon-22786
02/01/2022, 11:48 PMancient-vegetable-10556
02/01/2022, 11:48 PMancient-vegetable-10556
02/02/2022, 12:25 AMRunRequest will make a thing that can run, but it downloads a JDK every time, so when I come back to this, I’ll need to figure out why that’s the case.witty-crayon-22786
02/02/2022, 1:03 AMancient-vegetable-10556
02/02/2022, 4:00 PMRunRequest before I go back and make it efficientancient-vegetable-10556
02/02/2022, 5:40 PMWould it make sense to pre-populate a JDK into the right place and dump that into the workspace? Or should we be trying to make the cache mechanism work more generally?Copy codeValueError: InteractiveProcess requested setup of append-only caches and also requested to run in the workspace. These options are incompatible since setting up append-only caches would modify the workspace.
witty-crayon-22786
02/02/2022, 5:43 PMwitty-crayon-22786
02/02/2022, 5:43 PMwitty-crayon-22786
02/02/2022, 5:43 PMancient-vegetable-10556
02/02/2022, 5:44 PMcd over to the temporary directory and do things therewitty-crayon-22786
02/02/2022, 5:44 PMwitty-crayon-22786
02/02/2022, 5:45 PMancient-vegetable-10556
02/02/2022, 5:45 PMwitty-crayon-22786
02/02/2022, 5:45 PMwitty-crayon-22786
02/02/2022, 5:46 PMwitty-crayon-22786
02/02/2022, 5:47 PM{chroot} templating and temporary directory creation could move inside of InteractiveProcess running?witty-crayon-22786
02/02/2022, 5:48 PMwitty-crayon-22786
02/02/2022, 5:48 PMancient-vegetable-10556
02/02/2022, 5:49 PM{chroot} templating at all, by running
cd `dirname $0`
in the root InteractiveProcesswitty-crayon-22786
02/02/2022, 5:49 PMwitty-crayon-22786
02/02/2022, 5:50 PM./pants run $target -- a/relative/arg for/my/process
…should workwitty-crayon-22786
02/02/2022, 5:50 PMancient-vegetable-10556
02/02/2022, 5:50 PMancient-vegetable-10556
02/02/2022, 5:51 PMrun machinery is delicate and I don’t yet understand it 🙂witty-crayon-22786
02/02/2022, 5:52 PMwitty-crayon-22786
02/02/2022, 5:54 PM{chroot} templating is necessary if relative paths will be used, afaict
2. the {chroot} templating and temporary directory creation moving into InteractiveProcess (maybe as prework?) would likely clarify all of this a lotancient-vegetable-10556
02/02/2022, 5:54 PMwitty-crayon-22786
02/02/2022, 5:55 PMwitty-crayon-22786
02/02/2022, 5:55 PMrun_in_workspace=True.ancient-vegetable-10556
02/02/2022, 5:55 PMwitty-crayon-22786
02/02/2022, 5:56 PMancient-vegetable-10556
02/02/2022, 5:56 PMwitty-crayon-22786
02/02/2022, 5:56 PMwitty-crayon-22786
02/02/2022, 10:36 PMwitty-crayon-22786
02/02/2022, 10:37 PMimmutable_inputs, append_only_caches , etc on InteractiveProcess, then adjusting the interactive process runner code to use prepare_workdir would go a long wayancient-vegetable-10556
02/03/2022, 5:00 PMrun to work more generally (Java first, then Scala)witty-crayon-22786
02/03/2022, 6:38 PM