-
Notifications
You must be signed in to change notification settings - Fork 28
cibuildwheel-related work #369
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
Changes from all commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
3221836
Improve build script for cibuildwheel
mara004 2d53122
build_native: rework control flow to avoid globals
mara004 62739f9
Add RedHat patches for big-endian CPUs
mara004 981baac
build_native: factor out --vendor option
mara004 30ed5d7
build_native: drop default ICU vendoring w/ cibuildwheel
mara004 31d99cc
Add comments
mara004 5d9471f
Fix copy/paste blunder in bigendian.patch
mara004 3a0ccff
base.py: update a comment
mara004 cda3478
Merge remote-tracking branch 'origin/main' into cibuildwheel
mara004 c64a883
Merge remote-tracking branch 'origin/main' into cibuildwheel
mara004 02ab319
Experimental: draft cibuildwheel workflow
mara004 c6412f7
continue on workflow
mara004 f59d102
continue
mara004 8e7e985
continue
mara004 0c34dc4
fix CIBW_TEST_COMMAND
mara004 b973d89
Use `>` rather than `|` with `\`
mara004 bc94169
don't bother with test suite for now
mara004 e39c64e
add trailing newline
mara004 6e3c99a
comment out risc and loongarch
mara004 c23b765
comments
mara004 2a03b1b
Attempt to use dynamic matrix
mara004 65b8ac1
XXX debug matrix
mara004 ff7e0dd
add missing needs: prepare_matrix
mara004 4da0fe9
shorter names
mara004 b15b3a0
IS_CI: recognize cibuildwheel
mara004 d0c12e0
q&d fix
mara004 2281415
continue
mara004 f31561c
continue on docs
mara004 e398de2
fix missing `&&`
mara004 dab2dec
take pytest from pypi after all
mara004 3e8fb55
update docs
mara004 941b53a
add {project} placeholder
mara004 f7effae
switch back to `|` after all
mara004 8c02292
Make matrix generator script nicer
mara004 797d203
take out test suite after all
mara004 99fecf6
take out spdx snippet info after all
mara004 6d4ad89
readme nit
mara004 76d7e60
cibuildwheel: use oldest possible version of python
mara004 1173980
comment out riscv64
mara004 e633929
single-line import
mara004 735e34d
experimental: move config to pyproject.toml and extend
mara004 000c397
experimental: enable musllinux
mara004 f2bfd31
update docs
mara004 ad8ed7a
experimental: expose musl in workflow
mara004 5dae578
update doc line
mara004 820cdb5
symlinks only on manylinux
mara004 0121463
continue
mara004 d5de1e0
fix artifact name
mara004 191ed60
attempt to fix symlinks
mara004 5efa9bd
add comment
mara004 ee83b60
symlinks for musllinux
mara004 e9165a3
unlock riscv64 on musl
mara004 94d70e3
Fix symlinks for loongarch64
mara004 581132a
enable symlinks for riscv64
mara004 5f17127
test commit
mara004 27427c2
see if installing gcc helps
mara004 de85d51
debug
mara004 2c87f76
fix
mara004 e81a5fc
move
mara004 9ef117c
reinstall loongarch64
mara004 6ed6146
move after all
mara004 ab913ca
continue on cibuildwheel config
mara004 e21cf25
run test suite on manylinux only
mara004 09fc9c3
continue on readme
mara004 15a8cd9
Add 'windows-11-arm' to test matrices
mara004 2f2b909
add musl armv7l to cibuildwheel workflow
mara004 f586901
Try to enable manylinux riscv64, add draft macos config (commented out)
mara004 2aedfd3
continue
mara004 cadc9e3
use curl instead of wget
mara004 a014684
Attempt to fix symlinks for armv7l musl
mara004 484b892
attempt to fix curl usage
mara004 573f709
attempt to fix risc symlinks
mara004 a7733d6
Remove outdated note
mara004 bce5a95
Experiment with macOS
mara004 b981b59
fix image name
mara004 ad6e8fc
attempt to set clang path
mara004 2cf6f8e
cast compiler from string
mara004 19bf0e5
also cast clang_path to Path
mara004 b2b1969
Get clang version in a (hopefully) more portable way
mara004 8a2949a
try different preamble for apple
mara004 eeda583
another attempt at clang version
mara004 d882f24
Set Fixme
mara004 31b8520
try setting long clang path
mara004 9de9b97
pass through mac deployment target from env
mara004 214749f
Change clang path back to /usr
mara004 9c3d6a6
Cleanup
mara004 808f5d1
continue
mara004 fc05f03
continue 2
mara004 853c652
codespell: fix typo
mara004 feb0c84
workflows: setup-just does not work on windows 11 arm
mara004 41e4763
Exclude unsupported windows arm python versions
mara004 7b6b9a2
conda: take out windows arm after all
mara004 092da23
readme
mara004 3295996
document gcc symlinks
mara004 9c61cf5
changelog nits
mara004 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# SPDX-FileCopyrightText: 2025 geisserml <[email protected]> | ||
# SPDX-FileCopyrightText: 2025 wojiushixiaobai <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause | ||
|
||
# NOTE: This workflow is currently written with a dynamic matrix. | ||
# Another option would be to extract a reusable "build one" workflow and declare an individual job for each target here. | ||
|
||
name: Build with cibuildwheel | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
cibw_py_ver: | ||
default: 'cp38' | ||
type: string | ||
linux_main: | ||
default: true | ||
type: boolean | ||
linux_ibm: | ||
default: true | ||
type: boolean | ||
linux_emulated: | ||
default: false | ||
type: boolean | ||
linux_musl: | ||
default: true | ||
type: boolean | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
|
||
prepare_matrix: | ||
name: Determine build matrix | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
|
||
steps: | ||
- name: Run python script that outputs the build matrix | ||
id: set-matrix | ||
shell: python | ||
env: | ||
LINUX_MAIN: ${{ inputs.linux_main && 1 || 0 }} | ||
LINUX_IBM: ${{ inputs.linux_ibm && 1 || 0 }} | ||
LINUX_EMULATED: ${{ inputs.linux_emulated && 1 || 0 }} | ||
LINUX_MUSL: ${{ inputs.linux_musl && 1 || 0 }} | ||
run: | | ||
import os, sys, json | ||
|
||
LINUX_MAIN = bool(int( os.environ["LINUX_MAIN"] )) | ||
LINUX_IBM = bool(int( os.environ["LINUX_IBM"] )) | ||
LINUX_EMULATED = bool(int( os.environ["LINUX_EMULATED"] )) | ||
LINUX_MUSL = bool(int( os.environ["LINUX_MUSL"] )) | ||
|
||
matrix = [] | ||
images = ["manylinux"] | ||
if LINUX_MUSL: | ||
images.append("musllinux") | ||
|
||
def job(image, os, arch, emulated=False): | ||
matrix.append(dict( | ||
image=image, os=os, arch=arch, emulated=emulated | ||
)) | ||
|
||
def linux_job(os, arch, emulated=False, images=images): | ||
for image in images: | ||
job(os, arch, image, emulated) | ||
|
||
if LINUX_MAIN: | ||
linux_job("ubuntu-24.04", "x86_64") | ||
linux_job("ubuntu-24.04-arm", "aarch64") | ||
if LINUX_IBM: | ||
# XXX will become native as soon as we get access to IBM's self-hosted runners | ||
linux_job("ubuntu-24.04", "ppc64le", True) # False | ||
linux_job("ubuntu-24.04", "s390x", True) # False | ||
if LINUX_EMULATED: | ||
linux_job("ubuntu-24.04", "loongarch64", True) | ||
linux_job("ubuntu-24.04", "riscv64", True) | ||
if LINUX_MUSL: | ||
# pdfium-binaries don't currently build armv7l for musl (but they do for glibc) | ||
linux_job("ubuntu-24.04", "armv7l", True, images=("musllinux", )) | ||
|
||
matrix_json = json.dumps(matrix) | ||
print(matrix_json, file=sys.stderr) | ||
with open(os.environ["GITHUB_OUTPUT"], 'a') as output_fh: | ||
print(f"matrix={matrix_json}", file=output_fh) | ||
|
||
build_wheels: | ||
name: Build ${{ matrix.arch }} ${{ matrix.image }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
needs: prepare_matrix | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: ${{ fromJSON(needs.prepare_matrix.outputs.matrix) }} | ||
|
||
steps: | ||
|
||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up QEMU | ||
if: ${{ matrix.emulated }} | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
# Reminder: most configuration is in pyproject.toml so we can use TOML overrides | ||
- name: Build wheels | ||
uses: pypdfium2-team/[email protected] | ||
env: | ||
# Will be tagged as not python specific by our setup.py. inputs.cibw_py_ver only controls the version used at build time. Could also use `*`, then cibuildwheel would build with the oldest supported version, and walk through the others but skip because a compatible wheel is around already. | ||
CIBW_BUILD: "${{ inputs.cibw_py_ver }}-${{ matrix.image }}_${{ matrix.arch }}" | ||
CIBW_ARCHS: ${{ matrix.arch }} | ||
with: | ||
output-dir: wheelhouse | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
name: cibw-${{ matrix.image }}-${{ matrix.arch }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xxx: native sourcebuild doesn't work on Windows yet - need to cross compile from amd64 in that case.
probably best to split this up in two separate comments