Skip to content

Commit

Permalink
Build wheels for windows with LuaJit (GH-273)
Browse files Browse the repository at this point in the history
Closes #235
Closes #251
  • Loading branch information
emcek authored Jan 10, 2025
1 parent 9a72f99 commit a5e182b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ jobs:
if: contains(matrix.os, 'ubuntu') && matrix.lua-version != 'bundle'
run: sudo apt-get install lib${{ matrix.lua-version }}-dev

- name: Setup Visual Studio
if: contains(matrix.os, 'windows')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64

- name: Build wheel
run: python setup.py sdist build_ext -i -j6 bdist_wheel
env:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ jobs:
brew install automake libtool
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
- name: Setup Visual Studio for x64
if: contains(matrix.os, 'windows') && contains(matrix.only, 'win_amd64')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64

- name: Setup Visual Studio for x86
if: contains(matrix.os, 'windows') && contains(matrix.only, 'win32')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x86

- name: Build wheels
uses: pypa/[email protected]
with:
Expand Down
21 changes: 16 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,40 @@ environment:
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# - python: 27-x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- python: 312
arch: x86
- python: 312-x64
arch: x64
- python: 311
arch: x86
- python: 311-x64
arch: x64
- python: 310
arch: x86
- python: 310-x64
arch: x64
- python: 39
arch: x86
- python: 39-x64
arch: x64
- python: 38
arch: x86
- python: 38-x64
arch: x64
- python: 37
arch: x86
- python: 37-x64
- python: 36
- python: 36-x64
- python: 35
- python: 35-x64
arch: x64

install:
- SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%
- python -m pip.__main__ install -U pip wheel setuptools
- python -m pip.__main__ install -U pip wheel "setuptools!=72.0.0"
- pip install -r requirements.txt
- git submodule update --init --recursive

build: off
build_script:
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %ARCH%
- python -u setup.py clean
- python -u setup.py build install --use-bundle
- python -u setup.py bdist_wheel --use-bundle
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ environment = {CFLAGS = "-O3 -g1 -pipe -fPIC -flto -march=armv8-a -mtune=cortex-

[tool.cibuildwheel.windows]
archs = ["AMD64", "x86"]
test-command = "python -c \"import lupa\" && python -c \"import lupa.lua54\" && python -c \"import lupa.luajit21\" "

[tool.cibuildwheel.macos]
# https://cibuildwheel.readthedocs.io/en/stable/faq/#what-to-provide suggests to provide
Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,6 @@ def has_option(name):
# http://t-p-j.blogspot.com/2010/11/lupa-on-os-x-with-macports-python-26.html
# LuaJIT 2.1-alpha3 fails at runtime.
or (platform == 'darwin' and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
# Couldn't get the Windows build to work. See
# https://luajit.org/install.html#windows
or (platform.startswith('win') and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
# Let's restrict LuaJIT to x86_64 for now.
or (get_machine() not in ("x86_64", "AMD64") and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
)
Expand Down

0 comments on commit a5e182b

Please sign in to comment.