Skip to content

Commit 55c1fd1

Browse files
authored
Merge pull request #73 from mattip/musllinux
Musllinux
2 parents feeeef2 + d72a959 commit 55c1fd1

File tree

5 files changed

+61
-4
lines changed

5 files changed

+61
-4
lines changed

.github/workflows/multibuild.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ jobs:
2929
PLAT: arm64
3030
INTERFACE64: ''
3131
platform: [x64]
32+
- os: ubuntu-latest
33+
PLAT: x86_64
34+
INTERFACE64: '1'
35+
MB_ML_LIBC: musllinux
36+
MB_ML_VER: _1_1
37+
platform: [x64]
38+
- os: ubuntu-latest
39+
PLAT: x86_64
40+
INTERFACE64: ''
41+
MB_ML_LIBC: musllinux
42+
MB_ML_VER: _1_1
43+
platform: [x64]
3244
exclude:
3345
- os: macos-latest
3446
PLAT: i686
@@ -44,6 +56,7 @@ jobs:
4456
MACOSX_DEPLOYMENT_TARGET: 10.9
4557
MB_PYTHON_VERSION: ${{ matrix.python-version }}
4658
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
59+
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }}
4760
MB_ML_VER: ${{ matrix.MB_ML_VER }}
4861
INTERFACE64: ${{ matrix.INTERFACE64 }}
4962
BUILD_DIR: ${{ github.workspace }}

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = https://github.com/xianyi/OpenBLAS.git
44
[submodule "multibuild"]
55
path = multibuild
6-
url = https://github.com/matthew-brett/multibuild.git
6+
url = https://github.com/multi-build/multibuild.git
77
[submodule "gfortran-install"]
88
path = gfortran-install
99
url = https://github.com/MacPython/gfortran-install.git

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@ services: docker
2323

2424
matrix:
2525
include:
26+
- os: linux
27+
arch: arm64
28+
env:
29+
- PLAT=aarch64
30+
- MB_ML_VER=_1_1
31+
- MB_ML_LIBC=musllinux
32+
- DOCKER_TEST_IMAGE=multibuild/xenial_{PLAT}
33+
- os: linux
34+
arch: arm64
35+
env:
36+
- PLAT=aarch64
37+
- INTERFACE64=1
38+
- MB_ML_VER=_1_1
39+
- MB_ML_LIBC=musllinux
40+
- DOCKER_TEST_IMAGE=multibuild/xenial_{PLAT}
2641
- os: linux
2742
arch: arm64
2843
env:

travis-ci/build_steps.sh

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,33 @@ function before_build {
2626
fi
2727
}
2828

29+
function get_plat_tag {
30+
# Copied from gfortran-install/gfortran_utils.sh, modified for MB_ML_LIBC
31+
32+
# Modify fat architecture tags on macOS to reflect compiled architecture
33+
# For non-darwin, report manylinux version
34+
local plat=$1
35+
local mb_ml_ver=${MB_ML_VER:-1}
36+
local mb_ml_libc=${MB_ML_LIBC:-manylinux}
37+
case $plat in
38+
i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le) ;;
39+
*) echo Did not recognize plat $plat; return 1 ;;
40+
esac
41+
local uname=${2:-$(uname)}
42+
if [ "$uname" != "Darwin" ]; then
43+
if [ "$plat" == "intel" ]; then
44+
echo plat=intel not allowed for Manylinux
45+
return 1
46+
fi
47+
echo "${mb_ml_libc}${mb_ml_ver}_${plat}"
48+
return
49+
fi
50+
# macOS 32-bit arch is i386
51+
[ "$plat" == "i686" ] && plat="i386"
52+
local target=$(echo $MACOSX_DEPLOYMENT_TARGET | tr .- _)
53+
echo "macosx_${target}_${plat}"
54+
}
55+
2956
function build_lib {
3057
# OSX or manylinux build
3158
#
@@ -48,7 +75,8 @@ function build_lib {
4875
return
4976
fi
5077
# Manylinux wrapper
51-
local docker_image=quay.io/pypa/manylinux${manylinux}_${plat}
78+
local libc=${MB_ML_LIBC:-manylinux}
79+
local docker_image=quay.io/pypa/${libc}${manylinux}_${plat}
5280
docker pull $docker_image
5381
# Docker sources this script, and runs `do_build_lib`
5482
docker run --rm \
@@ -57,6 +85,7 @@ function build_lib {
5785
-e INTERFACE64="${interface64}" \
5886
-e PYTHON_VERSION="$MB_PYTHON_VERSION" \
5987
-e MB_ML_VER=${manylinux} \
88+
-e MB_ML_LIBC=${libc} \
6089
-v $PWD:/io \
6190
$docker_image /io/travis-ci/docker_build_wrap.sh
6291
}
@@ -137,7 +166,7 @@ function do_build_lib {
137166
&& make PREFIX=$BUILD_PREFIX $interface64_flags install )
138167
stop_spinner
139168
local version=$(cd OpenBLAS && git describe --tags --abbrev=8)
140-
local plat_tag=$(get_distutils_platform_ex $plat)
169+
local plat_tag=$(get_plat_tag $plat)
141170
local suff=""
142171
[ -n "$suffix" ] && suff="-$suffix"
143172
if [ "$interface64" = "1" ]; then

0 commit comments

Comments
 (0)