Unverified Commit 1062d813 authored by John Jones's avatar John Jones
Browse files

initial pass at musllinux support

parent b35c219f
......@@ -35,6 +35,9 @@ else
which python || export PATH=/opt/python/cp39-cp39/bin:$PATH
fi
if [ $MB_ML_LIBC == "musllinux" ]; then
IS_ALPINE=1;
fi
# Work round bug in travis xcode image described at
# https://github.com/direnv/direnv/issues/210
......@@ -220,6 +223,8 @@ function install_rsync {
if [ -n "$IS_MACOS" ]; then
# macOS. The colon in the next line is the null command
:
elif [ -n "$IS_ALPINE" ]; then
[[ $(type -P rsync) ]] || apk add rsync
elif [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
[[ $(type -P rsync) ]] || apt-get install -y rsync
......@@ -308,6 +313,7 @@ function build_wheel_cmd {
local repo_dir=${2:-$REPO_DIR}
[ -z "$repo_dir" ] && echo "repo_dir not defined" && exit 1
local wheelhouse=$(abspath ${WHEEL_SDIR:-wheelhouse})
mkdir -p "$wheelhouse"
start_spinner
if [ -n "$(is_function "pre_build")" ]; then pre_build; fi
stop_spinner
......
......@@ -133,7 +133,9 @@ function build_zlib {
# Gives an old but safe version
if [ -n "$IS_MACOS" ]; then return; fi # OSX has zlib already
if [ -e zlib-stamp ]; then return; fi
if [[ $MB_ML_VER == "_2_24" ]]; then
if [ -n "$IS_ALPINE" ]; then
apk add zlib-dev
elif [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
apt-get install -y zlib1g-dev
else
......@@ -186,6 +188,8 @@ function get_modern_cmake {
local cmake=cmake
if [ -n "$IS_MACOS" ]; then
brew install cmake > /dev/null
elif [ -n "$IS_ALPINE" ]; then
apk add cmake
elif [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
apt-get install -y cmake
......@@ -411,6 +415,8 @@ function build_suitesparse {
if [ -e suitesparse-stamp ]; then return; fi
if [ -n "$IS_MACOS" ]; then
brew install suite-sparse > /dev/null
elif [ -n "$IS_ALPINE" ]; then
apk add suitesparse-dev
elif [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
apt-get install -y libsuitesparse-dev > /dev/null
......
......@@ -44,24 +44,29 @@ function activate_ccache {
ln -s /parent-home/.ccache $HOME/.ccache
# Now install ccache
if [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
suppress apt-get install -y ccache
if [ -n "$IS_ALPINE" ]; then
supress apk add ccache
export PATH="/usr/lib/ccache/bin:$PATH"
else
# centos based distro
suppress yum_install ccache
fi
if [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
suppress apt-get install -y ccache
else
# centos based distro
suppress yum_install ccache
fi
# Create fake compilers and prepend them to the PATH
# Note that yum is supposed to create these for us,
# but I had trouble finding them
local ccache_dir=/usr/lib/ccache/compilers
mkdir -p $ccache_dir
ln -s /usr/bin/ccache $ccache_dir/gcc
ln -s /usr/bin/ccache $ccache_dir/g++
ln -s /usr/bin/ccache $ccache_dir/cc
ln -s /usr/bin/ccache $ccache_dir/c++
export PATH=$ccache_dir:$PATH
# Create fake compilers and prepend them to the PATH
# Note that yum is supposed to create these for us,
# but I had trouble finding them
local ccache_dir=/usr/lib/ccache/compilers
mkdir -p $ccache_dir
ln -s /usr/bin/ccache $ccache_dir/gcc
ln -s /usr/bin/ccache $ccache_dir/g++
ln -s /usr/bin/ccache $ccache_dir/cc
ln -s /usr/bin/ccache $ccache_dir/c++
export PATH=$ccache_dir:$PATH
fi
# Prove to the developer that ccache is activated
echo "Using C compiler: $(which gcc)"
......
......@@ -69,6 +69,7 @@ function build_multilinux {
# Depends on
# MB_PYTHON_VERSION
# MB_ML_VER
# MB_ML_LIBC (optional)
# UNICODE_WIDTH (optional)
# BUILD_DEPENDS (optional)
# DOCKER_IMAGE (optional)
......@@ -77,7 +78,8 @@ function build_multilinux {
local plat=$1
[ -z "$plat" ] && echo "plat not defined" && exit 1
local build_cmds="$2"
local docker_image=${DOCKER_IMAGE:-quay.io/pypa/manylinux${MB_ML_VER}_\$plat}
local libc=${MB_ML_LIBC:-manylinux}
local docker_image=${DOCKER_IMAGE:-quay.io/pypa/${libc}${MB_ML_VER}_\$plat}
docker_image=$(eval echo "$docker_image")
retry docker pull $docker_image
docker run --rm \
......@@ -95,6 +97,7 @@ function build_multilinux {
-e REPO_DIR="$repo_dir" \
-e PLAT="$PLAT" \
-e MB_ML_VER="$MB_ML_VER" \
-e MB_ML_LIBC="$libc" \
-v $PWD:/io \
-v $HOME:/parent-home \
$docker_image /io/$MULTIBUILD_DIR/docker_build_wrap.sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment