pants icon indicating copy to clipboard operation
pants copied to clipboard

Support exporting downloaded external tools

Open huonw opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

Pants supports various "tools", some of which are just a binary downloaded from the internet. For instance, pex, helm, terraform, makeself, shellcheck, potentially ruff (#21237), ...

It'd be convenient if there was some way to export such binaries from pants so that one can invoke them outside of pants, e.g. for local dev without pants overhead or even just for experimenting with the tool to understand how one needs to configure pants.

Describe the solution you'd like

pants export ... can somehow export downloaded tools. Ideas:

  1. treat them as a resolve with their options name, e.g. pants export --resolve=pex or pants export --resolve=helm (may cause issues if someone has an existing resolve of the same name)
  2. treat them as a resolve with some sort of namespacing, e.g. pants export --resolve=__subsystem__/pex (less chance of an existing resolve with this name)
  3. give them a new arg, e.g. pants export --tool=pex
  4. something else??

Describe alternatives you've considered

N/A

Additional context

See discussion on #21237

huonw avatar Aug 01 '24 23:08 huonw

I think it makes sense to use a different arg:

  • they would be implemented differently (not actually resolves)
  • they would be used differently (invoked, instead of source dist/.../activate)
  • we could put them all together into a folder like "dist/bin" so people could add it to their path

my bikeshed vote is for --bin, or maybe --tool

lilatomic avatar Aug 03 '24 19:08 lilatomic