From a216efad1cf69eb9e873d610af81489fd1a29428 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Mon, 27 Jul 2026 14:23:34 +0300 Subject: [PATCH] wheels: force static libffi in build - only build static libffi - improve resilience of cibw environment variables --- .github/workflows/wheels.yml | 8 ++++---- .github/workflows/wheels/cibw_before_all.sh | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 500431888..30214d6d8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -93,14 +93,14 @@ jobs: CIBW_BEFORE_ALL: bash ./.github/workflows/wheels/cibw_before_all.sh CIBW_ENVIRONMENT: > OPTFLAGS=-O3 - PKG_CONFIG_PATH=./ffi/pfx/lib/pkgconfig - PATH="$PWD/bison/src:$PATH" + PKG_CONFIG_PATH={project}/ffi/pfx/lib/pkgconfig + PATH="{project}/bison/src:$PATH" CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release" CIBW_ENVIRONMENT_MACOS: > OPTFLAGS=-O3 - PKG_CONFIG_PATH=./ffi/pfx/lib/pkgconfig + PKG_CONFIG_PATH={project}/ffi/pfx/lib/pkgconfig MACOSX_DEPLOYMENT_TARGET=11 - PATH="$PWD/bison/src:$PATH" + PATH="{project}/bison/src:$PATH" CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release" CIBW_BEFORE_BUILD: bash ./.github/workflows/wheels/cibw_before_build.sh CIBW_TEST_COMMAND: python3 {project}/tests/pyosys/run_tests.py diff --git a/.github/workflows/wheels/cibw_before_all.sh b/.github/workflows/wheels/cibw_before_all.sh index 6450ce273..61bfb2181 100644 --- a/.github/workflows/wheels/cibw_before_all.sh +++ b/.github/workflows/wheels/cibw_before_all.sh @@ -29,9 +29,7 @@ fi set -e -x cd ffi ## Ultimate libyosys.so will be shared, so we need fPIC for the static libraries - CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --prefix=$PWD/pfx + LDFLAGS=-fPIC CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --prefix=$PWD/pfx --enable-static --disable-shared make clean make install -j$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu) - ## Forces static library to be used in all situations - sed -i.bak 's@-L${toolexeclibdir} -lffi@${toolexeclibdir}/libffi.a@' ./pfx/lib/pkgconfig/libffi.pc )