Skip to content

Commit

Permalink
support building for musl
Browse files Browse the repository at this point in the history
This patch adds support for building packages for the musllinux target.
  • Loading branch information
joostvanzwieten committed May 7, 2024
1 parent 49b3496 commit b24632a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ jobs:
print(f'::error::unsupported value for `python`: {input["python"]}')
raise SystemExit(1)
if input['os'] == 'linux':
if input['os'] in ('linux', 'musllinux'):
runner_os = 'ubuntu-latest'
arch = input['arch']
python_arch = 'x64'
if input['arch'] == 'x86_64':
maturin_target = 'x64'
if input['os'] == 'musllinux':
maturin_target = f'{arch}-unknown-linux-musl'
else:
maturin_target = input['arch']
if input.get('test', True):
test_container = dict(
aarch64='quay.io/pypa/manylinux_2_28_aarch64',
).get(input['arch'], None)
if test_container is None:
print(f'input: {json.dumps(input)}')
print(f'::error::no test container defined for arch {input["arch"]}')
raise SystemExit(1)
maturin_target = arch
if (input['os'] == 'musllinux' or arch != 'x86_64') and input.get('test', True):
if arch not in ('x86_64', 'aarch64', 'i686'):
print(f'input: {json.dumps(input)}')
print(f'::error::no test container defined for arch {arch}')
raise SystemExit(1)
tag = dict(linux='manylinux_2_28', musllinux='musllinux_1_2')[input['os']]
test_container = f'quay.io/pypa/{tag}_{arch}'
elif input['os'] == 'macos':
runner_os = 'macos-latest'
python_arch = 'arm64'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/selftest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
targets: |
defaults = dict(python='cp38', test=True)
targets = []
targets.extend(defaults | dict(os='linux', arch=arch) for arch in ('x86_64', 'aarch64'))
targets.extend(defaults | dict(os='linux', arch=arch, test=False) for arch in ('armv7',))
targets.extend(defaults | dict(os='linux', arch=arch, test=arch != 'armv7') for arch in ('x86_64', 'aarch64', 'armv7'))
targets.extend(defaults | dict(os='musllinux', arch=arch) for arch in ('x86_64', 'aarch64'))
targets.append(defaults | dict(os='macos', arch='universal2'))
targets.extend(defaults | dict(os='windows', arch=arch) for arch in ('x86_64', 'i686'))
check:
Expand Down

0 comments on commit b24632a

Please sign in to comment.