Skip to content

CI: musllinux_x86_64 #22864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/linux_musl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test musllinux_x86_64

on:
push:
branches:
- main
- maintenance/**
pull_request:
branches:
- main
- maintenance/**


concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true


permissions:
contents: read # to fetch code (actions/checkout)


jobs:
musllinux_x86_64:
runs-on: ubuntu-latest
container:
# Use container used for building musllinux wheels
# it has git installed, all the pythons, etc
image: quay.io/pypa/musllinux_1_1_x86_64

steps:
- name: setup
run: |
apk update --quiet

# using git commands to clone because versioneer doesn't work when
# actions/checkout is used for the clone step in a container

git config --global --add safe.directory $PWD

if [ $GITHUB_EVENT_NAME != pull_request ]; then
git clone --recursive --branch=$GITHUB_REF https://github.com/${GITHUB_REPOSITORY}.git $GITHUB_WORKSPACE
git reset --hard $GITHUB_SHA
else
git clone --recursive https://github.com/${GITHUB_REPOSITORY}.git $GITHUB_WORKSPACE
git fetch origin $GITHUB_REF:my_ref_name
git checkout $GITHUB_BASE_REF
git -c user.email="[email protected]" merge --no-commit my_ref_name
fi

ln -s /usr/local/bin/python3.10 /usr/local/bin/python

- name: test musllinux_x86_64
run: |
python -m venv test_env
source test_env/bin/activate

# install openblas by co-opting the CIBW setup script
RUNNER_OS=Linux sh tools/wheels/cibw_before_build.sh .

pip install -r build_requirements.txt
pip install pytest hypothesis typing_extensions

# use meson to build and test
./dev.py build
./dev.py test
26 changes: 21 additions & 5 deletions tools/openblas_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import tarfile
import textwrap
import zipfile
from packaging.tags import sys_tags

from tempfile import mkstemp, gettempdir
from urllib.request import urlopen, Request
Expand All @@ -20,6 +21,7 @@
SUPPORTED_PLATFORMS = [
'linux-aarch64',
'linux-x86_64',
'musllinux-x86_64'
'linux-i686',
'linux-ppc64le',
'linux-s390x',
Expand Down Expand Up @@ -55,10 +57,25 @@ def get_ilp64():

def get_manylinux(arch):
default = '2014'
ret = os.environ.get("MB_ML_VER", default)
ml_ver = os.environ.get("MB_ML_VER", default)
# XXX For PEP 600 this can be a glibc version
assert ret in ('2010', '2014', '_2_24'), f'invalid MB_ML_VER {ret}'
return ret
assert ml_ver in ('2010', '2014', '_2_24'), f'invalid MB_ML_VER {ml_ver}'
suffix = f'manylinux{ml_ver}_{arch}.tar.gz'
return suffix


def get_musllinux(arch):
musl_ver = "1_1"
suffix = f'musllinux_{musl_ver}_{arch}.tar.gz'
return suffix


def get_linux(arch):
tags = list(sys_tags())
if 'manylinux' in tags[0].platform:
return get_manylinux(arch)
elif 'musllinux' in tags[0].platform:
return get_musllinux(arch)


def download_openblas(target, plat, ilp64):
Expand All @@ -70,8 +87,7 @@ def download_openblas(target, plat, ilp64):
'(KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.3')}
suffix = None
if osname == "linux":
ml_ver = get_manylinux(arch)
suffix = f'manylinux{ml_ver}_{arch}.tar.gz'
suffix = get_linux(arch)
typ = 'tar.gz'
elif plat == 'macosx-x86_64':
suffix = 'macosx_10_9_x86_64-gf_c469a42.tar.gz'
Expand Down