pants icon indicating copy to clipboard operation
pants copied to clipboard

Error installing on alpine

Open anthony-hayes opened this issue 1 year ago • 5 comments

Describe the bug I'm getting a sha256sum error when installing on Alpine Linux 3.18

Pants version The pants installer script:curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh | bash

OS Alpine Linux 3.18

Additional info Run apk add curl bash first Perhaps this bug is related: https://github.com/gliderlabs/docker-alpine/issues/174

anthony-hayes avatar Jun 14 '24 18:06 anthony-hayes

Seems that the sha256sum bins are different. We expect it to have a --status option, but the one from alpine (upstream is busybox) uses -s for that.

lilatomic avatar Jun 15 '24 03:06 lilatomic

Although even if we patch this issue, I'm not sure that it's going to work. IIRC, alpine uses a different compiler chain, and I don't think we build wheels for it. If your goal is to get code into an alpine docker container, pants' docker support can pull in PEXes which Pants builds outside of the container. Pants environments might also allow you to run commands or steps inside of an alpine container, although I don't have experience with them. If you really need to run Pants in an alpine container, I think you might need to build Pants from sources

lilatomic avatar Jun 15 '24 04:06 lilatomic

Yeah, our wheels are glibc, not musl, so to run on Alpine you'd have to build your own. It's possible we should distribute Pants for Alpine, but there haven't been a ton of requests for that so far.

What is the use case here?

benjyw avatar Jun 15 '24 12:06 benjyw

Thanks for the quick responses!

The use case is using pants in CI, and on Alpine in general, mainly for project introspection, but I'm considering also using it for running tests in CI as well.

So I do want to run Pants in the alpine container if possible. Sounds like building from source is the only way to do that today.

I'd love if there was a distributed pants for Alpine, or some approved workaround (like https://pkgs.alpinelinux.org/package/v3.15/main/ppc64le/libc6-compat).

It might be worth updating the documentation with a note that Alpine Linux is not yet supported. Such a note existed in earlier versions of pants: https://www.pantsbuild.org/2.0/docs/introduction/getting-started/installing-pants documentation. (Same for the linux on ARM note, I'm on x86 but am very interested in ARM support)

Thanks for the info though!

anthony-hayes avatar Jun 17 '24 13:06 anthony-hayes

FYI: Users running on Chainguard/Wofli based images have the same problem as they use gcc compiled busybox. A workaround is available by installing the wolfi coreutils package but it would be great if that wasn't needed.

ericsmalling avatar Aug 21 '24 14:08 ericsmalling