diff --git a/.github/workflows/test-dev.yml b/.github/workflows/test-dev.yml index 5e258b4..8a55aa3 100644 --- a/.github/workflows/test-dev.yml +++ b/.github/workflows/test-dev.yml @@ -110,7 +110,7 @@ jobs: node-version: 18.x - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - run: npm install --ignore-scripts - run: npx @mapbox/node-pre-gyp configure --builtin_python - run: npx @mapbox/node-pre-gyp build -j max @@ -120,7 +120,7 @@ jobs: run: echo PYTHONHOME=$(python -c "import sys; print(sys.prefix)") >> $GITHUB_ENV - name: Test PYTHONOME run: echo READ_PYTHONHOME=$(node -e "console.log(require('pymport').version.pythonHome)") >> $GITHUB_ENV - - uses: nick-fields/assert-action@v1.2.0 + - uses: nick-fields/assert-action@v2 with: expected: ${{ env.PYTHONHOME }} actual: ${{ env.READ_PYTHONHOME }} @@ -140,7 +140,7 @@ jobs: node-version: 18.x - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - run: npm install --ignore-scripts - run: npx @mapbox/node-pre-gyp configure --builtin_python - run: npx @mapbox/node-pre-gyp build -j max diff --git a/README.md b/README.md index 703c2e8..82d4416 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ except for the following combinations that are not supported: * **Node.js 16.x on Ubuntu 22.04**: rebuilding from source against the system-installed Python is not possible due to Node.js containing a built-in OpenSSL 1.1 with exported symbols while the system-provided Python is built vs OpenSSL 3.0, upgrading Node.js or using the precompiled interpreter solves this issue +* **Node.js 16.x and Python 3.12**: `node-gyp` from Node.js 16.x does not work if Python 3.12 is installed + * **Python 3.11.x on Windows**: An upstream bug requires a specific workaround in this case [#44](https://github.com/mmomtchev/pymport/issues/44) # `pymport` vs `PyScript/Pyodide` diff --git a/build_python.sh b/build_python.sh index f9d24e0..6e490ce 100644 --- a/build_python.sh +++ b/build_python.sh @@ -32,6 +32,7 @@ if [ ! -d "$1" ] || [ ! -r "${LIBNAME}" ]; then export LDFLAGS="-Wl,-z,origin -Wl,-rpath,'\$\$ORIGIN/../lib'" export CFLAGS="" export ZLIB_LIBS="-lz -ldl" + export LIBFFI_LIBS="-l:libffi_pic.a -Wl,--exclude-libs,libffi_pic.a" ;; 'Darwin') export LDFLAGS="-Wl,-rpath,@loader_path/../lib" @@ -43,7 +44,7 @@ if [ ! -d "$1" ] || [ ! -r "${LIBNAME}" ]; then ;; esac - ./configure --prefix $1 --enable-shared --enable-optimizations --without-system-ffi ${SSL} + ./configure --prefix $1 --enable-shared --enable-optimizations ${SSL} make -j4 build_all make install )