From 192bbc114ff5a52eb982c737f7f4893358665857 Mon Sep 17 00:00:00 2001 From: ptweezy Date: Sun, 18 Oct 2026 12:21:00 -0400 Subject: [PATCH] Keep isal_zlib importable with ISA-L 2.30 isal_zlib_header_init was added in ISA-L 2.31. Read the Docs builds on Ubuntu 22.04, which ships libisal 2.30, so isal_zlib failed to import there and the API documentation for isal_zlib, igzip and igzip_threaded was empty. The function only zeroes the four fields of the struct, and all four are set right after the call, so it is not needed. Run the docs check on the same Ubuntu release as Read the Docs so CI catches this kind of breakage. --- .github/workflows/ci.yml | 4 +++- src/isal/isal_zlibmodule.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e82cebfd..6749c165 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,9 @@ jobs: tox_env: - docs - twine_check - runs-on: ubuntu-latest + # Use the same Ubuntu release as build.os in .readthedocs.yml, so the + # documentation is checked against the libisal that Read the Docs uses. + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: diff --git a/src/isal/isal_zlibmodule.c b/src/isal/isal_zlibmodule.c index 50e6f740..c62f7280 100644 --- a/src/isal/isal_zlibmodule.c +++ b/src/isal/isal_zlibmodule.c @@ -763,7 +763,8 @@ isal_zlib_compressobj_impl(PyObject *module, int level, int method, int wbits, zdict->buf, (uint32_t)zdict->len); if (err == COMP_OK) { if (flag == IGZIP_ZLIB && zdict->len != 0) { - isal_zlib_header_init(&self->zlib_header); + // Set every field instead of calling isal_zlib_header_init, + // which ISA-L 2.30 does not have. self->zlib_header.info = hist_bits - 8; self->zlib_header.level = level == 0 ? 0 : 1; self->zlib_header.dict_flag = 1;