hi! I want to use pants to produce scie pex'es wit...
# general
b
hi! I want to use pants to produce scie pex'es with the following in my BUILD file:
Copy code
pex_binary(
    name="bin-compiled",
    entry_point="__init__.py",
    environment="docker_linux",
    extra_build_args=[
        "--scie=eager",
        "--scie-only",
        "--scie-python-version=3.11.11",
        "--scie-platform=linux-x86_64",
        "--scie-pbs-stripped",
    ],
)
But I'm not getting the pex in the output. What I'm doing wrong? If I remove "--scie-only", a pex is output, but it's not scie.
If I remove "--scie-only", a pex is output, but it's not scie.
w
Hmm... That's interesting, I don't think I've ever tested
scie
output from pex in pants. I use
science
to make them, and I have a separate
scie_binary
plugin, but I've been meaning to look at this one of these days. I wonder if scie's aren't materialized out of the sandbox
Can you check your sandbox (--keep-sandboxes=always)
I'm gonna throw a hypothesis out with zero testing, but for the history of pants, a ".pex" was assumed to be the output - and now we don't have that, so maybe we just don't know to also extract a ".scie" file? or a nameless file (or wahtever).
If that's the problem, can you raise an issue? In the meantime, I wonder if there is some funny way to fool pants and/or pex into giving you what you want. Like, naming the
scie
the same thing as what the pex would be named?
h
Probably there should be an output directory in that sandbox and we should copy everything in it to dist, rather than specific names
b
I checked and I can't see any pex or binary whatsoever
I ran
pants --keep-sandboxes=always package projects/example/functions/hello:bin-compiled
I created a feature request as this doesn't look as an intentional feature on pants: https://github.com/pantsbuild/pants/issues/22044
I also linked your issue @wide-midnight-78598 https://github.com/pantsbuild/pants/issues/21100
w
👍 Benjy's idea is probably the way to go. Having said that, I don't know what else other than a pex and scie should be in there - but, by just outputting the directory contents - we're more robust to changes in a 3rd party tool