@@ -326,15 +326,65 @@ jobs:
326326 uses : addnab/docker-run-action@v3
327327 with :
328328 image : ${{ steps.docker.outputs.IMAGE }}
329- options : -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}
329+ options : -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }} -e CI=true -e GITHUB_ACTIONS=true
330330 run : |
331331 # Install Python 3.9+ (any version will work with abi3-py39)
332332 apt-get update -y
333- apt-get install -y python3 python3-dev
333+ apt-get install -y python3 python3-dev patchelf
334+
335+ echo "=== Starting test setup ==="
336+ echo "Current directory: $(pwd)"
337+ echo "Python version: $(python3 --version)"
338+ echo "Patchelf version: $(patchelf --version)"
339+ echo "CI environment: CI=$CI, GITHUB_ACTIONS=$GITHUB_ACTIONS"
340+
341+ # Check what .node files exist
342+ echo "=== Available .node files ==="
343+ ls -la *.node || echo "No .node files found"
344+
345+ # Find Linux .node files and patch their Python SONAME
346+ echo "=== Patching Python SONAME in Linux binaries ==="
347+ for file in *.node; do
348+ if [ -f "$file" ]; then
349+ case "$file" in
350+ *linux*)
351+ echo "Processing $file..."
352+
353+ # Check current dependencies
354+ echo "Current dependencies:"
355+ ldd "$file" 2>/dev/null | grep python || echo "No Python dependencies found"
356+
357+ # Try to patch libpython3.10.so.1.0 -> libpython3.x.so.1.0
358+ PYTHON_VERSION=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
359+ echo "Target Python version: $PYTHON_VERSION"
360+
361+ # Use patchelf to replace SONAME
362+ patchelf --replace-needed "libpython3.10.so.1.0" "libpython${PYTHON_VERSION}.so.1.0" "$file" 2>/dev/null || echo "No libpython3.10.so.1.0 to replace"
363+ patchelf --replace-needed "libpython3.11.so.1.0" "libpython${PYTHON_VERSION}.so.1.0" "$file" 2>/dev/null || echo "No libpython3.11.so.1.0 to replace"
364+ patchelf --replace-needed "libpython3.12.so.1.0" "libpython${PYTHON_VERSION}.so.1.0" "$file" 2>/dev/null || echo "No libpython3.12.so.1.0 to replace"
365+
366+ # Check new dependencies
367+ echo "New dependencies:"
368+ ldd "$file" 2>/dev/null | grep python || echo "No Python dependencies found"
369+ echo "---"
370+ ;;
371+ *)
372+ echo "Skipping non-Linux file: $file"
373+ ;;
374+ esac
375+ fi
376+ done
334377
335378 # Install pnpm and run tests
379+ echo "=== Installing pnpm ==="
336380 corepack disable
337381 npm i -gf pnpm
382+
383+ echo "=== Running pnpm install ==="
384+ # Should be non-interactive in CI environment
385+ pnpm install --prefer-offline
386+
387+ echo "=== Running tests ==="
338388 pnpm test
339389
340390 publish :
0 commit comments