mason icon indicating copy to clipboard operation
mason copied to clipboard

Support Alpine Linux

Open springmeyer opened this issue 7 years ago • 2 comments
trafficstars

Mason currently supports most linux systems (like ubuntu, debian, amazon linux, rhel, centos, fedora) and the binaries mason produces run across all those systems. This is possible because:

  • the C and C++ standard libraries on these systems support symbol versioning
  • all these linux distros default to the same C and C++ standard libraries
  • We statically link all other deps into the binaries

Alpine Linux is a different story since alpine uses musl for the C standard library rather than glibc. So to support Alpine linux we'll need to:

  • have a new linux variant that is linux-musl
  • we'll need to detect this platform automatically
  • we'll need to create a dockerfile using alpine to do the binary builds for publishing
  • we'll need to add this custom dockerfile to CI
  • we'll need to build binaries for lots of mason packages

This is a large lift, but one that may be worthwhile because:

  • musl is a great, small, well supported C standard library
  • alpine linux is popular among docker users since small images are made with it

springmeyer avatar Feb 24 '18 01:02 springmeyer

This work is still outstanding and would be a useful project. I don't have time to work on it but I did get the mason bash scripts running on alpine recently. https://github.com/mapbox/mason/commit/f6ab273d30f210147a3f44e185f7959e65640f8d and https://github.com/mapbox/mason/commit/c7ea6566e6503e4b6c5e19cb53af08445c931687 were enough to be able to run ./mason install <package> <version> on alpine. The resulting binary was broken still (of course) but at least the bash worked to try to install it.

springmeyer avatar Dec 21 '18 19:12 springmeyer

A potential Dockerfile could look like:

FROM alpine:3.8 AS build

ENV CXX=clang++ CC=clang
RUN apk add --no-cache bash ca-certificates curl libstdc++ clang build-base

springmeyer avatar Dec 21 '18 19:12 springmeyer