Skip to content

Conversation

@cburroughs
Copy link
Contributor

See
31ca16c#r174188058

Using PEX_TOOLs as we do elsewhere is less coupling to Pex's internals.

AI Disclosure: An LLM was instructed to generate code to cleanup the mess it made.

See
pantsbuild@31ca16c#r174188058

Using PEX_TOOLs as we do elsewhere is less coupling to Pex's internals.

AI Disclosure: An LLM was instructed to generate code to cleanup the mess it made.
@cburroughs cburroughs self-assigned this Jan 14, 2026
@cburroughs cburroughs added the release-notes:not-required [CI] PR doesn't require mention in release notes label Jan 14, 2026
@cburroughs cburroughs marked this pull request as ready for review January 15, 2026 03:52
pex_executable = os.path.join(rule_runner.build_root, "pex_exe/pex_exe.pex")
return subprocess.run(
args=[pex_executable, "interpreter", "inspect", "-mt"],
env=dict(PEX_MODULE="pex.cli", **os.environ),
Copy link
Contributor

@jsirois jsirois Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. The pex_exe/pex_exe.pex is built with -c pex as the entry point, and pex interpreter ... is a hard error (Welp, not a hard error. Both interpreter and inspect get treated as requirements and -mt sets the entry point to the module t. Good luck with that!) You get away with it only because the fixture is unused. If it were used, you'd want PEX_SCRIPT="pex3" to decouple from the pex.cli module internal detail FWIW.

Also, FWIW, I started publishing Pex PEX scies a while back. These are BusyBox scies:

:; curl -fsSLO https://github.com/pex-tool/pex/releases/download/v2.81.0/pex-linux-x86_64
:; chmod +x pex-linux-x86_64 
:; ./pex-linux-x86_64 
Error: Could not determine which command to run.

Please select from the following boot commands:

pex
pex-tools
pex3
pexec

You can select a boot command by setting the SCIE_BOOT environment variable or else by passing it as the 1st argument.

If Pants used those it could truly treat Pex as a native binary and not need to bootstrap a Python for it.

@cburroughs cburroughs marked this pull request as draft January 23, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes:not-required [CI] PR doesn't require mention in release notes

2 participants