https://pantsbuild.org/ logo
w

wide-midnight-78598

08/30/2022, 5:11 AM
I've asked a variant of this before, but as there doesn't appear to be an existing mechanism to create a Subsystem which can either download from a url OR be setup from a system path, is there an approach I should take on this. Two mutually exclusive subsystems? New Subsystem type?
h

hundreds-father-404

08/30/2022, 6:23 AM
In general, there is no prebuilt mechanism for subsystems to be loaded via system path. You have to use stuff from
system_binaries.py
. You also can still subclass
ExternalTool
but choose to not use the apprporiate
Get
in your rule What this means is that you can use the same subsystem and then figure out based on the options whether to load the binary via
system_binaries.py
vs
Get(ExternalTool)
w

wide-midnight-78598

08/30/2022, 12:04 PM
šŸ‘ My plan was some sort of default to system, with a URL escape hatch Actually, it's even more nuanced, because one could theoretically use an ARM compiler and x86 compiler in the same project, but I feel like multiple compilers is a "later" thing at the moment
Can a
BinaryPath
be used to represent something inside a
Digest
? Or should that only be for system-level stuff?
Not sure if binary paths have to be absolute, or if they can refer to that which is within a snapshot, relatively
h

hundreds-father-404

09/02/2022, 8:26 PM
BinaryPath
is only intended for system-level stuff, absolute paths
w

wide-midnight-78598

09/02/2022, 8:28 PM
Okay, I was hoping to use that with the optional ExternalTool/System Binary - to keep my toolchain model the same. I use the fingerprint in an environment to check if the toolchain changes from run to run
h

hundreds-father-404

09/02/2022, 8:38 PM
but reminder
BinaryPath
is solely an abstraction for DRY. What really matters are the underlying engine mechanisms. All that the engine (and REAPI) cares about is your argv0 is either: ā€¢ absolute path , or ā€¢ relative path to a file from
input_digest
w

wide-midnight-78598

09/02/2022, 8:39 PM
Yep, I've replaced it with a string - but feels very... stringy...... šŸ¤·
šŸ™ˆ 1