https://pantsbuild.org/ logo
#general
Title
# general
w

wooden-thailand-8386

08/31/2020, 6:55 PM
Hello there, I’ve been trying to install
pants
inside an alpine docker image and I keep getting this:
Copy code
ERROR: No matching distribution found for pantsbuild.pants==1.30.0
when I do a
pip install pantsbuild.pants==1.30.0
on my host machine is works fine but not inside alpine.
h

hundreds-father-404

08/31/2020, 7:06 PM
Hi! I’m wondering if you have python3.6 available? Pants requires python3.6 or newer
w

wooden-thailand-8386

08/31/2020, 7:07 PM
I have 3.7 available inside the docker image
h

hundreds-father-404

08/31/2020, 7:15 PM
Cool. Does it have pip installed with it? I’m wondering if you can try
pip3.7 install
w

wooden-thailand-8386

08/31/2020, 7:22 PM
same error
Copy code
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants==1.30.0 (from versions: 0.0.17, 0.0.18, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.0.26, 0.0.27, 0.0.28, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.39, 0.0.40, 0.0.41, 0.0.42, 0.0.43, 0.0.44, 0.0.45, 0.0.46, 0.0.47, 0.0.48, 0.0.49, 0.0.50, 0.0.51, 0.0.52, 0.0.53, 0.0.54, 0.0.55, 0.0.56, 0.0.57, 0.0.58, 0.0.59, 0.0.60, 0.0.61, 0.0.62, 0.0.63, 0.0.64, 0.0.65, 0.0.66, 0.0.67, 0.0.68, 0.0.69, 0.0.70, 0.0.71, 0.0.72, 0.0.73, 0.0.74, 0.0.75, 0.0.76, 0.0.77, 0.0.79, 0.0.80, 0.0.81, 0.0.82, 1.0.0rc1, 1.0.0rc2, 1.0.0rc3, 1.0.0, 1.0.1rc0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0rc3, 1.1.0rc4, 1.1.0rc5, 1.1.0rc6, 1.1.0rc7, 1.1.0rc8, 1.1.0rc9, 1.1.0, 1.2.0.dev0,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.0rc2, 1.6.0rc3, 1.6.0, 1.7.0.dev0, 1.7.0.dev1, 1.7.0.dev2, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.8.0.dev0, 1.8.0.dev1, 1.8.0.dev2)
ERROR: No matching distribution found for pantsbuild.pants==1.30.0
seems like
manylinux
is incompatible with alpine-based images 😕
h

hundreds-father-404

08/31/2020, 7:27 PM
Oh, I wonder if the issue is manylinux not working on alpine for whatever reason? We’re bad citizens in that we don’t release an sdist, so you have to use our prebuilt wheel. We mark our wheel as manylinux2010, which I would expect to work on Alpine, but maybe that’s the issue. Cc @enough-analyst-54434 if you’re around, I’m still afk
e

enough-analyst-54434

08/31/2020, 7:30 PM
@wooden-thailand-8386 correct - manylinux does not work with lib MUSL, just glibc; thus Alpine images are a no go right now: https://github.com/pypa/manylinux/issues/37
w

wooden-thailand-8386

08/31/2020, 7:31 PM
So is it possible for me to build my .pex under a debian distro and run them inside an alpine-based one?
I’ve been having issues with that.. lots of dependencies errors happens when I try to run the .pex inside alpine
f

fast-nail-55400

08/31/2020, 7:34 PM
Also more generally, at least one blogger is of the opinion to not use Alpine and Python: https://pythonspeed.com/articles/alpine-docker-python/
👍 1
w

wooden-thailand-8386

08/31/2020, 7:35 PM
yeah, I really wanted to use
slim
but I work for a bank with lots of stupid constraints 😕
e

enough-analyst-54434

08/31/2020, 7:37 PM
So is it possible for me to build my .pex under a debian distro and run them inside an alpine-based one?
No. As far as I can tell, there are at least two problems to overcome: 1. There is no standard way to indicate a platform specific wheel was built for lib MUSL vs glibc - this is a wheel naming issue, which affects runtime resolution from within a PEX file of the correct wheels to activate. 2. #1 means there is also no way to tell the Pex CLI which --platform (Alpine) to resolve pre-built wheels for.
👍 1
Here's a bug against docker on the ~misleading advertising front re Alpine images + Python: https://github.com/docker-library/docs/issues/904
Fundamentally here though, as Eric pointed out, the bad citizen behavior of Pants wrt not distributing an sdist is the core issue. We'll probably move away from distributing Pants via PyPI though at some point since we are interested in packaging Pants as a native rust executable with either an embedded Python interpreter or else that finds the appropriate local system Python interpreter to run Pants rules with. At that point, Pants could be made to work on Alpine if we build and publish a
x86_64-unknown-linux-musl
targeted binary.
👍 2
h

happy-kitchen-89482

09/01/2020, 5:08 PM
7 Views