Skip to content

Commit 6158c6f

Browse files
committed
Use a separate switch for system zstd with cffi
Given that the CFFI code is much more fragile to library changes than the C extension code, use a separate `--system-zstd-cffi` switch to enable it. This should resolve the test failure on macOS. Signed-off-by: Michał Górny <mgorny@gentoo.org>
1 parent 5fd00c3 commit 6158c6f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/external-zstd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Build
3131
run: |
32-
python -m pip install --config-settings=--global-option=--system-zstd .
32+
python -m pip install --config-settings=--global-option=--system-zstd --config-settings=--global-option=--system-zstd-cffi .
3333
3434
macOS:
3535
runs-on: 'macos-13'

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373

7474
SUPPORT_LEGACY = False
7575
SYSTEM_ZSTD = False
76+
SYSTEM_ZSTD_CFFI = False
7677
WARNINGS_AS_ERRORS = False
7778
C_BACKEND = True
7879
CFFI_BACKEND = True
@@ -103,6 +104,10 @@
103104
SYSTEM_ZSTD = True
104105
sys.argv.remove("--system-zstd")
105106

107+
if "--system-zstd-cffi" in sys.argv:
108+
SYSTEM_ZSTD_CFFI = True
109+
sys.argv.remove("--system-zstd-cffi")
110+
106111
if "--warnings-as-errors" in sys.argv:
107112
WARNINGS_AS_ERRORS = True
108113
sys.argv.remove("--warning-as-errors")
@@ -138,7 +143,7 @@
138143
if CFFI_BACKEND and cffi:
139144
import make_cffi
140145

141-
extensions.append(make_cffi.get_ffi(system_zstd=SYSTEM_ZSTD).distutils_extension())
146+
extensions.append(make_cffi.get_ffi(system_zstd=SYSTEM_ZSTD_CFFI).distutils_extension())
142147

143148
version = None
144149

0 commit comments

Comments
 (0)