Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 libtool coreutils
if: runner.os == 'macOS'
- name: Set MSVC developer prompt
uses: ilammy/msvc-dev-cmd@v1
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 libtool coreutils
if: runner.os == 'macOS'
- name: Set MSVC developer prompt
uses: ilammy/msvc-dev-cmd@v1
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import functools
import os
import platform
import shutil
import subprocess
import sys
Expand All @@ -26,6 +25,7 @@
sys.platform.startswith("darwin") or
sys.platform.startswith("gnu") or
SYSTEM_IS_BSD)
SYSTEM_IS_MACOS = sys.platform.startswith("darwin")
SYSTEM_IS_WINDOWS = sys.platform.startswith("win")

# Since pip builds in a temp directory by default, setting a fixed file in
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -107,23 +107,23 @@ def build_isa_l():
build_env = os.environ.copy()
if SYSTEM_IS_UNIX:
build_env["CFLAGS"] = build_env.get("CFLAGS", "") + " -fPIC"
if SYSTEM_IS_MACOS:
# See: https://github.com/python/cpython/issues/97524
build_env["LDFLAGS"] = (
build_env.get("LDFLAGS", "") +
" -undefined dynamic_lookup -Wl,-no_fixup_chains")
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:
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:
Expand Down
6 changes: 3 additions & 3 deletions src/isal/isal_zlibmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ Comp_dealloc(compobject *self)
}

static compobject *
newcompobject()
newcompobject(void)
{
compobject *self;
self = PyObject_New(compobject, &IsalZlibCompType);
Expand Down Expand Up @@ -656,7 +656,7 @@ set_inflate_zdict(decompobject *self)
}

static decompobject *
newdecompobject()
newdecompobject(void)
{
decompobject *self;
self = PyObject_New(decompobject, &IsalZlibDecompType);
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 11 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading