From 768926a21fb19b9065f805c97c83943a0846f53c Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 09:35:05 +0200 Subject: [PATCH 01/11] Revert back to autotools for better compile configuration --- setup.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 1ed64c2d..cfa993da 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,7 @@ def build_extension(self, ext): isa_l_build_dir = build_isa_l() if SYSTEM_IS_UNIX: ext.extra_objects = [ - os.path.join(isa_l_build_dir, "bin", "isa-l.a")] + os.path.join(isa_l_build_dir, ".libs", "libisal.a")] elif SYSTEM_IS_WINDOWS: ext.extra_objects = [ os.path.join(isa_l_build_dir, "isa-l_static.lib")] @@ -113,17 +113,12 @@ def build_isa_l(): cpu_count = os.cpu_count() or 1 # os.cpu_count() can return None run_args = dict(cwd=build_dir, env=build_env) if SYSTEM_IS_UNIX: - if platform.machine() == "aarch64": - cflags_param = "CFLAGS_aarch64" - else: - cflags_param = "CFLAGS_" make_cmd = "make" if SYSTEM_IS_BSD: make_cmd = "gmake" - subprocess.run([make_cmd, "-j", str(cpu_count), "-f", "Makefile.unx", - "isa-l.h", "bin/isa-l.a", - f"{cflags_param}={build_env.get('CFLAGS', '')}"], - **run_args) + subprocess.run(os.path.join(build_dir, "autogen.sh"), **run_args) + subprocess.run([os.path.join(build_dir, "configure")], **run_args) + subprocess.run([make_cmd, "-j", str(cpu_count)], **run_args) elif SYSTEM_IS_WINDOWS: subprocess.run(["nmake", "/f", "Makefile.nmake"], **run_args) else: From b175fc6107ee85df7bcd18b5f55a727a70812b79 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 09:36:15 +0200 Subject: [PATCH 02/11] Revert "Remove autotools dependencies on macos" This reverts commit a94b2dc2c9d75c1d39cf87dbd93649ae898b7407. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4320c656..a3a765ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: - name: Install build dependencies (Macos) # Install yasm because nasm does not work when building wheels. # Probably because of nasm-filter.sh not filtering all flags that can not be used. - run: brew install nasm + run: brew install nasm automake autoconf if: runner.os == 'macOS' - name: Set MSVC developer prompt uses: ilammy/msvc-dev-cmd@v1 @@ -200,7 +200,7 @@ jobs: - name: Install cibuildwheel twine wheel run: python -m pip install cibuildwheel twine wheel - name: Install build dependencies (Macos) - run: brew install nasm + run: brew install nasm automake autoconf if: runner.os == 'macOS' - name: Set MSVC developer prompt uses: ilammy/msvc-dev-cmd@v1 From 6babbd6551d2c71cab9f1fb288c09c9e77909a21 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 09:45:57 +0200 Subject: [PATCH 03/11] Add build changes to the changelog --- CHANGELOG.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b8471793..7e97310e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,9 @@ Changelog version 1.8.1-dev ----------------- ++ Switch back to building ISA-L using autotools as it leads to better compile + time configurations that don't skip functions specialized for the + architecture. This was hurting the MacOS arm64 build. + Restore PyPy wheel builds. version 1.8.0 From f16ad8670e91a0387c6b6525cbb0d74a3dd0efd8 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 09:46:36 +0200 Subject: [PATCH 04/11] Remove platform --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index cfa993da..f83c310b 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,6 @@ import functools import os -import platform import shutil import subprocess import sys From a557a8a7817e11faa2155dcdac3093b93e80a542 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 09:47:41 +0200 Subject: [PATCH 05/11] Test wheel building --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3a765ed..3158fe55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,14 +160,14 @@ jobs: PYTHON_ISAL_LINK_DYNAMIC: True deploy: - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') +# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') runs-on: ${{ matrix.os }} - needs: - - lint - - package-checks - - test-static - - test-dynamic - - test-arch +# needs: +# - lint +# - package-checks +# - test-static +# - test-dynamic +# - test-arch strategy: matrix: os: From 56d1e93e27a50c98170fab3365fc9caef6e813d0 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 09:53:46 +0200 Subject: [PATCH 06/11] Check for pedantic compile errors --- src/isal/isal_zlibmodule.c | 4 ++-- tox.ini | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/isal/isal_zlibmodule.c b/src/isal/isal_zlibmodule.c index 3a280ec8..a72e7835 100644 --- a/src/isal/isal_zlibmodule.c +++ b/src/isal/isal_zlibmodule.c @@ -587,7 +587,7 @@ Comp_dealloc(compobject *self) } static compobject * -newcompobject() +newcompobject(void) { compobject *self; self = PyObject_New(compobject, &IsalZlibCompType); @@ -656,7 +656,7 @@ set_inflate_zdict(decompobject *self) } static decompobject * -newdecompobject() +newdecompobject(void) { decompobject *self; self = PyObject_New(decompobject, &IsalZlibDecompType); diff --git a/tox.ini b/tox.ini index c01b469a..d8274851 100644 --- a/tox.ini +++ b/tox.ini @@ -61,6 +61,17 @@ commands = python -m build twine check dist/* +[testenv:pedantic_compile] +deps=setuptools +skip_install=True +setenv= + CFLAGS=-Wall -Werror -Wpedantic + PYTHON_ISAL_LINK_DYNAMIC=1 +allowlist_externals = bash +commands = + bash -c 'CC=gcc python setup.py build_ext -f' + bash -c 'CC=clang python setup.py build_ext -f' + # Documentation should build on python version 3 [testenv:docs] deps=-r requirements-docs.txt From 40943eb8601c56204264c5052d18dc5df595d7e3 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 09:58:08 +0200 Subject: [PATCH 07/11] Fix error on macos --- src/isal/isal_zlibmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/isal/isal_zlibmodule.c b/src/isal/isal_zlibmodule.c index a72e7835..73db9775 100644 --- a/src/isal/isal_zlibmodule.c +++ b/src/isal/isal_zlibmodule.c @@ -1664,8 +1664,8 @@ GzipReader_read_into_buffer(GzipReader *self, uint8_t *out_buffer, size_t out_bu PyThreadState *_save; Py_UNBLOCK_THREADS while(1) { + size_t remaining; // Must be before labels. switch(self->stream_phase) { - size_t remaining; // Must be before labels. case GzipReader_HEADER: remaining = buffer_end - current_pos; if (remaining == 0 && self->all_bytes_read) { From 6b82079f0c8052bb74c739cde8bf08c10b2c9504 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 10:23:06 +0200 Subject: [PATCH 08/11] Ensure libtool is present --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3158fe55..d57ed4e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: - name: Install build dependencies (Macos) # Install yasm because nasm does not work when building wheels. # Probably because of nasm-filter.sh not filtering all flags that can not be used. - run: brew install nasm automake autoconf + run: brew install nasm automake autoconf libtool if: runner.os == 'macOS' - name: Set MSVC developer prompt uses: ilammy/msvc-dev-cmd@v1 @@ -200,7 +200,7 @@ jobs: - name: Install cibuildwheel twine wheel run: python -m pip install cibuildwheel twine wheel - name: Install build dependencies (Macos) - run: brew install nasm automake autoconf + run: brew install nasm automake autoconf libtool if: runner.os == 'macOS' - name: Set MSVC developer prompt uses: ilammy/msvc-dev-cmd@v1 From 761dbe06ea9140bc38077ba7e07dd54664d88708 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 10:28:50 +0200 Subject: [PATCH 09/11] Also add coreutils to MacOS build dependencies" --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d57ed4e3..f157320e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: - name: Install build dependencies (Macos) # Install yasm because nasm does not work when building wheels. # Probably because of nasm-filter.sh not filtering all flags that can not be used. - run: brew install nasm automake autoconf libtool + run: brew install nasm automake autoconf libtool coreutils if: runner.os == 'macOS' - name: Set MSVC developer prompt uses: ilammy/msvc-dev-cmd@v1 @@ -200,7 +200,7 @@ jobs: - name: Install cibuildwheel twine wheel run: python -m pip install cibuildwheel twine wheel - name: Install build dependencies (Macos) - run: brew install nasm automake autoconf libtool + run: brew install nasm automake autoconf libtool coreutils if: runner.os == 'macOS' - name: Set MSVC developer prompt uses: ilammy/msvc-dev-cmd@v1 From b5b0980a49cc3d115e2b761fe69013a0632a2737 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 10:41:45 +0200 Subject: [PATCH 10/11] Enable PIC rather than relying on environment to do so --- setup.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index f83c310b..90c835e2 100644 --- a/setup.py +++ b/setup.py @@ -101,25 +101,21 @@ def build_isa_l(): build_dir = tempfile.mktemp() shutil.copytree(ISA_L_SOURCE, build_dir) - # Build environment is a copy of OS environment to allow user to influence - # it. - build_env = os.environ.copy() - if SYSTEM_IS_UNIX: - build_env["CFLAGS"] = build_env.get("CFLAGS", "") + " -fPIC" if hasattr(os, "sched_getaffinity"): cpu_count = len(os.sched_getaffinity(0)) else: # sched_getaffinity not available on all platforms cpu_count = os.cpu_count() or 1 # os.cpu_count() can return None - run_args = dict(cwd=build_dir, env=build_env) if SYSTEM_IS_UNIX: make_cmd = "make" if SYSTEM_IS_BSD: make_cmd = "gmake" - subprocess.run(os.path.join(build_dir, "autogen.sh"), **run_args) - subprocess.run([os.path.join(build_dir, "configure")], **run_args) - subprocess.run([make_cmd, "-j", str(cpu_count)], **run_args) + subprocess.run(os.path.join(build_dir, "autogen.sh"), cwd=build_dir) + subprocess.run( + [os.path.join(build_dir, "configure"), "--enable-pic"], + cwd=build_dir) + subprocess.run([make_cmd, "-j", str(cpu_count)], cwd=build_dir) elif SYSTEM_IS_WINDOWS: - subprocess.run(["nmake", "/f", "Makefile.nmake"], **run_args) + subprocess.run(["nmake", "/f", "Makefile.nmake"], cwd=build_dir) else: raise NotImplementedError(f"Unsupported platform: {sys.platform}") shutil.copytree(os.path.join(build_dir, "include"), From 205cc7abd596a8e8e89288a83042ab4de13e699f Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 20 Jul 2026 10:54:23 +0200 Subject: [PATCH 11/11] Revert "Enable PIC rather than relying on environment to do so" This reverts commit b5b0980a49cc3d115e2b761fe69013a0632a2737. --- setup.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 90c835e2..f83c310b 100644 --- a/setup.py +++ b/setup.py @@ -101,21 +101,25 @@ def build_isa_l(): build_dir = tempfile.mktemp() shutil.copytree(ISA_L_SOURCE, build_dir) + # Build environment is a copy of OS environment to allow user to influence + # it. + build_env = os.environ.copy() + if SYSTEM_IS_UNIX: + build_env["CFLAGS"] = build_env.get("CFLAGS", "") + " -fPIC" if hasattr(os, "sched_getaffinity"): cpu_count = len(os.sched_getaffinity(0)) else: # sched_getaffinity not available on all platforms cpu_count = os.cpu_count() or 1 # os.cpu_count() can return None + run_args = dict(cwd=build_dir, env=build_env) if SYSTEM_IS_UNIX: make_cmd = "make" if SYSTEM_IS_BSD: make_cmd = "gmake" - subprocess.run(os.path.join(build_dir, "autogen.sh"), cwd=build_dir) - subprocess.run( - [os.path.join(build_dir, "configure"), "--enable-pic"], - cwd=build_dir) - subprocess.run([make_cmd, "-j", str(cpu_count)], cwd=build_dir) + subprocess.run(os.path.join(build_dir, "autogen.sh"), **run_args) + subprocess.run([os.path.join(build_dir, "configure")], **run_args) + subprocess.run([make_cmd, "-j", str(cpu_count)], **run_args) elif SYSTEM_IS_WINDOWS: - subprocess.run(["nmake", "/f", "Makefile.nmake"], cwd=build_dir) + subprocess.run(["nmake", "/f", "Makefile.nmake"], **run_args) else: raise NotImplementedError(f"Unsupported platform: {sys.platform}") shutil.copytree(os.path.join(build_dir, "include"),