I'm trying to add support for pex's `--executable`...
# development
p
I'm trying to add support for pex's
--executable
flag in pants (an alternative to entry point or console script used when the script to run's file name has characters like
-
that make it impossible to import from that file. https://github.com/pantsbuild/pants/pull/20497 However, I'm running into a confusing bit of logic where a target field (or the field's value object) needs to be able to strip the source root. But running rules from targets is wonky. I'm hoping someone else can take a look and offer an alternative. ๐Ÿงต
โœ… 1
https://github.com/pantsbuild/pants/pull/20497/files#diff-ec50dab75eb23cdaee86ba8014950269b46859d2a21fcc826a2765297e4086b4R308-R312 This is where I've stubbed the rule code in the
Executable
object which is the value for the
PexExecutableField
.
For the other
MainSpecification
(
EntryPoint
and
ConsoleScript
), simply passing the user-provided value as-is to pex is all that is needed. In this case, we need a path to a source file that we expect to be provided by one of the
pex_binary
dependencies.
Oh. It's not pretty but I have an idea...
๐Ÿ‘€ 1