Scie builds, --output, and resulting artifacts #2516
-
I'm trying to build scie executables for multiple platforms for my cli project as follows: rm -r build/pex
pex --no-build --requirement requirements-pex.txt --entry-point ardia.cli.ardia:main --package ardia@src --output-file build/pex/macosx_10_12_x86_64/ardia --scie eager --platform macosx_10_12_x86_64-cp-3.11.9-cp311
pex --no-build --requirement requirements-pex.txt --entry-point ardia.cli.ardia:main --package ardia@src --output-file build/pex/macosx_11_0_x86_64/ardia --scie eager --platform macosx_11_0_x86_64-cp-3.11.9-cp311
pex --no-build --requirement requirements-pex.txt --entry-point ardia.cli.ardia:main --package ardia@src --output-file build/pex/linux_x86_64/ardia --scie eager --platform linux_x86_64-cp-3.11.9-cp311
pex --no-build --requirement requirements-pex.txt --entry-point ardia.cli.ardia:main --package ardia@src --output-file build/pex/linux_aarch64/ardia --scie eager --platform linux_aarch64-cp-3.11.9-cp311 For the macOS builds, I get the expected executables, and they are named
>ls -l build/pex/*
build/pex/linux_aarch64:
total 76096
-rwxr-xr-x 1 moefelei staff 5727439 Sep 4 17:02 ardia*
-rwxr-xr-x 1 moefelei staff 33230479 Sep 4 17:02 ardia-linux-aarch64*
build/pex/linux_x86_64:
total 85016
-rwxr-xr-x 1 moefelei staff 5999988 Sep 4 17:02 ardia*
-rwxr-xr-x 1 moefelei staff 37527155 Sep 4 17:02 ardia-linux-x86_64*
build/pex/macosx_10_12_x86_64:
total 50024
-rwxr-xr-x 1 moefelei staff 25611232 Sep 4 17:02 ardia*
build/pex/macosx_11_0_x86_64:
total 50024
-rwxr-xr-x 1 moefelei staff 25611232 Sep 4 17:02 ardia* Is this the expected behavior? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Forgot to mention I'm using pex version 2.16.2 |
Beta Was this translation helpful? Give feedback.
-
This is currently the expected behavior - although I agree its confusing. As an aside, one thing I will point out is that in your example above, you create two scies for the same platform (Mac x86-64), just with different Python versions. Since a scie contains its own Python, generally the end user doesn't care what Python version is embedded nor that the executable has anything to do with Python at all more generally. Perhaps you have a use case though where the user does care in some way? Below I detail the current behavior and provide examples. Perhaps you can suggest a less confusing; more useful behavior or maybe I should just a a good documentation page to docs.pex-tool.org and / or improve The current intended output types behavior:
The current intended scie output naming behavior:
Some examples:Using this project setup to mirror yours in structure: :; cat requirements-pex.txt
ansicolors
cowsay
:; cat src/ardia/cli/ardia.py
import sys
import colors
import cowsay
def main() -> None:
message = " ".join(sys.argv[1:])
cowsay.tux(colors.cyan(message))
Note I'm running under Linux x86-64 in these examples; so that's the current platform for me and mac is a "foreign" platform for me. Current platform build with :; pex \
--python python3.11 \
--no-build \
--requirement requirements-pex.txt \
--entry-point ardia.cli.ardia:main \
--package ardia@src \
--scie eager \
-o build/pex/ardia.pex
:; ls -1sh build/pex/
total 32M
31M ardia
736K ardia.pex
:; file build/pex/*
build/pex/ardia: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=f1f01ca2ad165fed27f8304d4b2fad02dcacdffe, stripped
build/pex/ardia.pex: Zip archive data, made by v2.0 UNIX, extract using at least v2.0, last modified, last modified Sun, Jan 01 1980 00:00:00, uncompressed size 0, method=deflate Current platform build with no extension (Here current platform is a :; pex \
--platform linux_x86_64-cp-3.11.9-cp311 \
--no-build \
--requirement requirements-pex.txt \
--entry-point ardia.cli.ardia:main \
--package ardia@src \
--scie eager \
-o build/pex/ardia
:; ls -1sh build/pex/
total 31M
31M ardia
:; file build/pex/*
build/pex/ardia: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=f1f01ca2ad165fed27f8304d4b2fad02dcacdffe, stripped Foreign platform build with :; pex \
--platform macosx_11_0_x86_64-cp-3.11.9-cp311 \
--no-build \
--requirement requirements-pex.txt \
--entry-point ardia.cli.ardia:main \
--package ardia@src \
--scie eager \
-o build/pex/ardia.pex
:; ls -1sh build/pex/
total 21M
20M ardia-macos-x86_64
736K ardia.pex
:; file build/pex/*
build/pex/ardia-macos-x86_64: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS>
build/pex/ardia.pex: Zip archive data, made by v2.0 UNIX, extract using at least v2.0, last modified, last modified Sun, Jan 01 1980 00:00:00, uncompressed size 0, method=deflate Foreign platform build with no extension: :; pex \
--platform macosx_11_0_x86_64-cp-3.11.9-cp311 \
--no-build \
--requirement requirements-pex.txt \
--entry-point ardia.cli.ardia:main \
--package ardia@src \
--scie eager \
-o build/pex/ardia
:; ls -1sh build/pex/
total 21M
736K ardia
20M ardia-macos-x86_64
:; file build/pex/*
build/pex/ardia: Zip archive data, made by v2.0 UNIX, extract using at least v2.0, last modified, last modified Sun, Jan 01 1980 00:00:00, uncompressed size 0, method=deflate
build/pex/ardia-macos-x86_64: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS> Multi-platform build with no extension (with a :; pex \
--platform linux_x86_64-cp-3.11.9-cp311 \
--platform linux_aarch64-cp-3.11.9-cp311 \
--platform macosx_11_0_x86_64-cp-3.11.9-cp311 \
--no-build \
--requirement requirements-pex.txt \
--entry-point ardia.cli.ardia:main \
--package ardia@src \
--scie eager \
-o build/pex/ardia
:; ls -1sh build/pex/
total 79M
736K ardia
27M ardia-linux-aarch64
31M ardia-linux-x86_64
20M ardia-macos-x86_64
:; file build/pex/*
build/pex/ardia: Zip archive data, made by v2.0 UNIX, extract using at least v2.0, last modified, last modified Sun, Jan 01 1980 00:00:00, uncompressed size 0, method=deflate
build/pex/ardia-linux-aarch64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=d55dd5a87a894376f51d578f879495586c907b8c, stripped
build/pex/ardia-linux-x86_64: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=f1f01ca2ad165fed27f8304d4b2fad02dcacdffe, stripped
build/pex/ardia-macos-x86_64: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS> |
Beta Was this translation helpful? Give feedback.
This is currently the expected behavior - although I agree its confusing.
As an aside, one thing I will point out is that in your example above, you create two scies for the same platform (Mac x86-64), just with different Python versions. Since a scie contains its own Python, generally the end user doesn't care what Python version is embedded nor that the executable has anything to do with Python at all more generally. Perhaps you have a use case though where the user does care in some way?
Below I detail the current behavior and provide examples. Perhaps you can suggest a less confusing; more useful behavior or maybe I should just a a good documentation page to docs.pex-tool.org and / or…