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

flat-queen-95161

06/28/2022, 6:48 PM
Has anyone gotten pants to work on Alpine Linux yet? If not, is it possible?
h

happy-kitchen-89482

06/28/2022, 7:10 PM
That's a good question. You'd have to build Pants on Alpine, including its native code (which requires the rust toolchain), as we don't publish wheels for it (Alpine is not manylinux-compatible). And pip would have to be able to build all Pants's transitive deps at install time.
It can probably be made to work
but from what I've read, it's generally not recommended to run Python on Alpine, as there are all sorts of corner cases where the interpreter itself behaves weirdly.
👍 1
Is this for CI?
q

quaint-forest-8735

06/28/2022, 7:44 PM
+1 to not running Python on Alpine, usually build times will be very long as all requirements w/ native dependencies will need to be built from scratch.
f

flat-queen-95161

06/28/2022, 7:53 PM
yes. for ci. docker package.
error: cannot produce cdylib for
engine v0.0.1 (/pants/src/rust/engine)
as the target
x86_64-unknown-linux-musl
does not support these crate types
this is where is bombs out on the alpine build.
Thanks. I will abandon alpine for build/ci and get the ci running on a debian based dind somehow.
r

rhythmic-morning-87313

06/29/2022, 2:57 AM
The latest pip, setuptools, auditwheel toolchain now supports detection of musl-compatible wheels. https://peps.python.org/pep-0656/ https://github.com/pypa/auditwheel/issues/305 An example of the release-process update in gevent: https://github.com/gevent/gevent/pull/1846/files The pitfall in Alpine Linux is that it is not practical to build & use "statically built" Python because the static version of musl libc does not support dynamic loading at all, blocking import of all C extension modules in Python. Otherwise, if we use dynamic versions, it should be fine with wheels distributed with musllinux platform tags or source builds of them.
Still, there are not many packages that support musllinux distribution, so it takes much longer time to bootstrap a virtualenv.
I've not tried pants in Alpine yet, but I believe that technically it should be possible though we should go through a long trial-and-error process with external dependencies...
f

flat-queen-95161

06/29/2022, 4:54 AM
thanks. I will check it out.
8 Views