wheels: force static libffi in build

- only build static libffi
- improve resilience of cibw environment variables
This commit is contained in:
Mohamed Gaber 2026-07-27 14:23:34 +03:00
parent 5d2fbf8187
commit a216efad1c
No known key found for this signature in database
2 changed files with 5 additions and 7 deletions

View File

@ -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

View File

@ -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
)