https://pantsbuild.org/ logo
f

freezing-lamp-12123

12/06/2022, 8:24 PM
on installing tools — there seems to be a couple of options where pex seems to use some internals;
There is a predefined rule to go from PexProcess -> Process, so Get(ProcessResult, Process) will cause the engine to run PexProcess -> Process -> ProcessResult.
is it possible to create your own external tool installer which runs a specific command to get the environment correctly setup, similar to the pex machinery and
PexRequest
/
PexProcess
?
h

hundreds-father-404

12/06/2022, 8:47 PM
Yep for sure! See
GoSdkProcess
for example. You basically define a (data)class that has all the values you want your rules to give, and then write a helper rule going from
MyCustomProcess -> Process
. That's it
f

freezing-lamp-12123

12/06/2022, 8:48 PM
oh — that sounds — easy enough, thank you for the pointer!
h

hundreds-father-404

12/06/2022, 8:48 PM
Out of curiosity, what tool do you want to support?
Also the "install via this tool" part is usually modeled as a different set of helper types and rules. That would be the
Get(Pex, PexRequest)
stuff for example. Often that is used to form part of the
input_digest
for the
MyCustomProcess
part. In other words, one step is a) how do I install this tool?, and then b) how do I invoke this tool in a Process?
f

freezing-lamp-12123

12/06/2022, 8:51 PM
yup! got it — this is for my
nix
spelunking :)
🙌 1