Skip to content

Commit

Permalink
Enable Lua usage of "dlopen()" in CI and wheel builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Oct 12, 2023
1 parent 9e91522 commit df96f76
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
CFLAGS_LTO: ${{ contains(matrix.lua-version, 'bundle') && (contains(matrix.os, 'windows') && '/LTCG' || '-flto') || '' }}
CFLAGS: ${{ contains(matrix.os, 'windows') && '/O2' || '-O2 -fPIC' }} -g
MACOSX_DEPLOYMENT_TARGET: "11.0"
LUPA_WITH_LUA_DLOPEN: true

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ jobs:
pyversion: 2.7

runs-on: ${{ matrix.os }}
env: { MACOSX_DEPLOYMENT_TARGET: 11.0 }
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
LUPA_WITH_LUA_DLOPEN: true

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PYTHON?=python
USE_BUNDLE?=true
VERSION?=$(shell sed -ne "s|^VERSION\s*=\s*'\([^']*\)'.*|\1|p" setup.py)
WITH_CYTHON?=$(shell $(PYTHON) -c 'import Cython.Build.Dependencies' >/dev/null 2>/dev/null && echo " --with-cython" || true)
WITH_LUA_DLOPEN?=true
PYTHON_BUILD_VERSION?=*

MANYLINUX_IMAGES= \
Expand All @@ -22,7 +23,7 @@ MANYLINUX_IMAGES= \
all: local

local:
${PYTHON} setup.py build_ext --inplace $(WITH_CYTHON)
LUPA_WITH_LUA_DLOPEN=$(WITH_LUA_DLOPEN) ${PYTHON} setup.py build_ext --inplace $(WITH_CYTHON)

sdist dist/lupa-$(VERSION).tar.gz:
${PYTHON} setup.py sdist
Expand All @@ -38,7 +39,7 @@ realclean: clean
rm -fr lupa/_lupa.c

wheel:
$(PYTHON) setup.py bdist_wheel $(WITH_CYTHON)
LUPA_WITH_LUA_DLOPEN=$(WITH_LUA_DLOPEN) $(PYTHON) setup.py bdist_wheel $(WITH_CYTHON)

qemu-user-static:
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Expand All @@ -58,6 +59,7 @@ wheel_%: dist/lupa-$(VERSION).tar.gz
-e NM=gcc-nm \
-e RANLIB=gcc-ranlib \
-e LUPA_USE_BUNDLE=$(USE_BUNDLE) \
-e LUPA_WITH_LUA_DLOPEN=$(WITH_LUA_DLOPEN) \
-e WHEELHOUSE=wheelhouse_$(subst wheel_,,$@) \
quay.io/pypa/$(subst wheel_,,$@) \
bash -c 'echo "Python versions: $$(ls /opt/python/ | xargs -n 100 echo)" ; \
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ def has_option(name):
c_defines.append(('CYTHON_WITHOUT_ASSERTIONS', None))
if has_option('--with-lua-checks'):
c_defines.append(('LUA_USE_APICHECK', None))
if has_option('--with-lua-dlopen'):
c_defines.append(('LUA_USE_DLOPEN', None))


# find Lua
Expand Down

0 comments on commit df96f76

Please sign in to comment.