diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c9ea13..bb6033e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: outputs: archive_base: ${{ steps.prep.outputs.archive_base }} archive: ${{ steps.prep.outputs.archive }} - systems: ${{ steps.systems.outputs.systems }} + matrix: ${{ steps.matrix.outputs.matrix }} version: ${{ steps.prep.outputs.version }} steps: - name: Check out repo @@ -130,27 +130,41 @@ jobs: echo "https://pypi.org/help/#file-size-limit" exit 1 fi - - name: Compute bdist systems - id: systems + - name: Compute bdist matrix + id: matrix shell: python run: | import json, os - sys_map = { - '${{ inputs.linux_builder_repo_and_digest }}': 'linux', - '${{ inputs.macos_enable && 'true' || '' }}': 'macos', - '${{ inputs.windows_builder_repo_and_digest }}': 'windows', - } - systems = json.dumps(sorted(v for k, v in sys_map.items() if k)) + matrix = [] + if '${{ inputs.linux_builder_repo_and_digest }}': + matrix.append({ + 'os': 'linux', + 'arch': 'x86_64', + }) + matrix.append({ + 'os': 'linux', + 'arch': 'aarch64', + }) + if ${{ inputs.macos_enable && 1 || 0 }}: + matrix.append({ + 'os': 'macos', + 'arch': 'arm64-x86_64', + }) + if '${{ inputs.windows_builder_repo_and_digest }}': + matrix.append({ + 'os': 'windows', + 'arch': 'x64', + }) with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: - fh.write(f'systems={systems}\n') + fh.write(f'matrix={json.dumps(matrix)}\n') bdist: name: Binaries needs: sdist strategy: matrix: - os: ${{ fromJson(needs.sdist.outputs.systems) }} - runs-on: ${{ matrix.os == 'macos' && 'macos-latest' || 'ubuntu-latest' }} + include: ${{ fromJson(needs.sdist.outputs.matrix) }} + runs-on: ${{ matrix.os == 'macos' && 'macos-latest' || (matrix.os == 'linux' && matrix.arch == 'aarch64') && 'ubuntu-24.04-aarch64' || 'ubuntu-latest' }} container: ${{ matrix.os == 'linux' && inputs.linux_builder_repo_and_digest || (matrix.os == 'windows' && inputs.windows_builder_repo_and_digest || null) }} steps: - name: Install dependencies (macOS) diff --git a/README.md b/README.md index 46d3bbd..156daec 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ SDK libraries on macOS, and glibc on Linux. ## Building For Windows and Linux, the build runs in a container image that includes the -necessary tools. To build for Windows, pull the container image on Linux or -in Windows PowerShell with WSL 2 and use it to run a build: +necessary tools. To build for Windows on x64, pull the container image on +Linux or in Windows PowerShell with WSL 2 and use it to run a build: docker run -ti --rm -v ${PWD}:/work -w /work \ ghcr.io/openslide/winbuild-builder ./bintool bdist -Similarly, to build for Linux: +Similarly, to build for Linux on aarch64 or x86_64: docker run -ti --rm -v ${PWD}:/work -w /work \ ghcr.io/openslide/linux-builder ./bintool bdist diff --git a/machines/native-linux-aarch64.ini b/machines/native-linux-aarch64.ini new file mode 100644 index 0000000..ddace0b --- /dev/null +++ b/machines/native-linux-aarch64.ini @@ -0,0 +1,12 @@ +[built-in options] +prefix = '/' +c_args = ['-O2', '-g', '-fpic', '-fstack-clash-protection', '-fexceptions', '-ftree-vectorize', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2'] +c_link_args = ['-Wl,-z,relro', '-Wl,-z,now', '-Wl,--exclude-libs,ALL'] +cpp_args = ['-O2', '-g', '-fpic', '-fstack-clash-protection', '-fexceptions', '-ftree-vectorize', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2'] +cpp_link_args = ['-Wl,-z,relro', '-Wl,-z,now', '-Wl,--exclude-libs,ALL'] +pkg_config_path = '' + +[properties] +pkg_config_libdir = '/native/lib/pkgconfig' +openslide_bin_platform = 'linux-aarch64' +python_platform_tag = 'manylinux_2_28_aarch64'