Hello there. I'm getting an unexpected shebang for...
# general
l
Hello there. I'm getting an unexpected shebang for generated Pex binaries. My global interpreter constraints specify 3.11.x, and for debugging purposes I added it to the target as well. But actual pex when run (as well as shebang at top) suggests Python 3.9
Copy code
❯ dist/dir/tests_runner.pex
env: python3.9: No such file or directory
Can try to come up with a repro if needed. Docs and intuition suggest this should respect interpreter constraints so I'm fairly surprised.
Global interpreter constraints:
Copy code
[python]
enable_resolves = true
default_resolve = "default_resolve"
interpreter_constraints = ["==3.11.*"]
and also the target-specific constraints I set for debugging this issue:
Copy code
pex_binary(
    name="tests_runner",
    entry_point="tests_runner.py",
    dependencies=[
        "dir/tests:tests",
    ],
    interpreter_constraints = ["==3.11.*"],
    platforms=[
        "linux_x86_64-cp-311-cp311",
        "macosx_10.10-x86_64-cp-311-cp311",
    ],
)
Invocation to create Pex
Copy code
pants package dir:tests_runner
b
This sounds like https://github.com/pantsbuild/pants/issues/19514, with a workaround of changing the shebang listed there
👀 1