Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
f2ec794
Initial plan
Copilot Feb 22, 2026
9003d52
feat: add standalone LuaJIT patch/build automation scripts
Copilot Feb 22, 2026
f55259b
docs: document build approach analysis and usage
Copilot Feb 22, 2026
070d9fd
fix: validate MSVC developer environment before build
Copilot Feb 22, 2026
e5672f4
chore: improve patch error handling in build scripts
Copilot Feb 22, 2026
60f9c12
refactor: simplify MSVC environment setup flow
Copilot Feb 22, 2026
80a0bf9
fix: improve msvc patch failure diagnostics
Copilot Feb 22, 2026
f9399cc
docs: add per-target build command examples to README
Copilot Feb 22, 2026
1708295
ci: add Windows build and release workflows with UTF-8 tests
Copilot Feb 22, 2026
41bb8ae
docs: describe CI, release flow, and UTF-8 test coverage
Copilot Feb 22, 2026
04a457b
fix: preserve artifact grouping in release upload pattern
Copilot Feb 22, 2026
cf5e093
test: clarify UTF-8 test filename variable naming
Copilot Feb 22, 2026
1dee4aa
ci: make tag-triggered release names descriptive
Copilot Feb 22, 2026
18e8ca7
security: set explicit GitHub Actions token permissions
Copilot Feb 22, 2026
c994931
fix: repair Windows CI builds and reduce luaconf patch dependence
Copilot Feb 22, 2026
b833324
test: add trusted Unicode fixture setup and broaden path API coverage
Copilot Feb 22, 2026
a555a08
fix: harden test fixture plumbing and workflow defaults
Copilot Feb 22, 2026
c6d71d9
test: ensure fixture cleanup and safer Unicode command handling
Copilot Feb 22, 2026
1c5cb1c
chore: document platform-specific test and build assumptions
Copilot Feb 22, 2026
0ba523f
chore: clarify edge-case assumptions in scripts and tests
Copilot Feb 22, 2026
7a902e1
fix: tighten cmd escaping and setup dll path handling
Copilot Feb 22, 2026
1e7aea8
docs: clarify compatibility assumptions in scripts and tests
Copilot Feb 22, 2026
fed8e30
chore: refine explanatory comments after review
Copilot Feb 22, 2026
040f7b7
fix: resolve latest CI breakages in workflow packages and MSVC setup
Copilot Feb 22, 2026
3f1af3a
fix: correct vcvarsall fallback path in msvc wrapper
Copilot Feb 22, 2026
8913cca
refactor: remove redundant vcvarsall fallback assignment
Copilot Feb 22, 2026
6e19dd1
fix: check vcvarsall result in msvc environment fallback
Copilot Feb 22, 2026
5f7a8f0
fix: improve patch apply resilience and auto-detect VS toolchain
Copilot Feb 22, 2026
216abbc
chore: clarify vswhere failure message and normalize VSINSTALLDIR
Copilot Feb 22, 2026
d4d41c1
chore: outline final CI stabilization plan
Copilot Feb 22, 2026
232b53c
fix: validate Makefile object injection in mingw wrapper
Copilot Feb 22, 2026
231b9a3
fix: remove apply-3 from msvc patch flow and correct ci env handling
Copilot Feb 22, 2026
bf85e05
fix: add CI diagnostics and remove msvc absolute include path
Copilot Feb 22, 2026
fd44090
fix: fail fast when fallback strip tool is missing
Copilot Feb 22, 2026
64264d4
chore: refine strip diagnostics output
Copilot Feb 22, 2026
6be0828
chore: respect host compiler env in diagnostics
Copilot Feb 22, 2026
127d740
chore: clarify compiler diagnostic variable naming
Copilot Feb 22, 2026
d057451
chore: improve diagnostic labels for host and target gcc output
Copilot Feb 22, 2026
489a161
chore: clarify missing strip tool diagnostic message
Copilot Feb 22, 2026
36477cb
fix: tighten unicode fixture tests and adjust mingw/msvc build wrappers
Copilot Feb 23, 2026
0bc2c44
chore: document fixture and arch handling assumptions
Copilot Feb 23, 2026
5b8dbe5
chore: improve error context and linker rationale comments
Copilot Feb 23, 2026
6ff1720
chore: clarify env comment and validate generated fixture name
Copilot Feb 23, 2026
4d092ed
chore: polish test naming and linker comment clarity
Copilot Feb 23, 2026
86e701a
chore: preserve io output stream and clarify msvc symbol rationale
Copilot Feb 23, 2026
3532262
fix: restore stable mingw strip/toolchain behavior and simplify msvc …
Copilot Feb 23, 2026
b275023
fix: restore win32 host flag and warn on cross toolchain fallback
Copilot Feb 23, 2026
cbb51a4
chore: improve mingw fallback diagnostics clarity
Copilot Feb 23, 2026
19e6d18
chore: interpolate target arch in fallback diagnostics
Copilot Feb 23, 2026
5660090
chore: simplify mingw fallback diagnostics wording
Copilot Feb 23, 2026
5b0b9b9
chore: make mingw fallback diagnostics more actionable
Copilot Feb 23, 2026
907a9c4
chore: add package hint for missing cross-compiler warning
Copilot Feb 23, 2026
0b3689b
chore: split mingw warnings into clearer actionable lines
Copilot Feb 23, 2026
f9db5be
chore: preserve original cross tool names in fallback diagnostics
Copilot Feb 23, 2026
6fb9bfc
fix: align strip selection with resolved cross compiler fallback
Copilot Feb 23, 2026
f73c3f6
refactor: simplify strip candidate resolution after cross fallback
Copilot Feb 23, 2026
3404de7
refactor: make strip fallback branch explicit for cross and native tools
Copilot Feb 23, 2026
c50045a
fix: preserve original cross-strip candidate and de-duplicate error text
Copilot Feb 23, 2026
611ef13
fix: correct arm64 toolchain flow and restore setup fixture execution
Copilot Feb 23, 2026
c37915b
chore: document mingw compiler selection rationale
Copilot Feb 23, 2026
8541cae
chore: clarify arm64 host tool comment and setup command rationale
Copilot Feb 23, 2026
125e6dc
fix: stabilize windows test execution and unify unicode fixture paths
Copilot Feb 23, 2026
d5e2ea5
test: assert loadlib stub fixture exists before load attempt
Copilot Feb 23, 2026
ae4af42
fix: restore bat fixture setup and stabilize mingw test/runtime paths
Copilot Feb 23, 2026
d077e45
fix: restore cmd shell for msvc release build step
Copilot Feb 23, 2026
ce83e77
fix: disable mingw arm64 ci and stabilize unicode fixture generation
Copilot Feb 23, 2026
d34a80a
chore: document shared unicode fixture-name contract
Copilot Feb 23, 2026
96f7649
docs: fix grammar in arm64 ci limitation note
Copilot Feb 23, 2026
b7f7f6a
test: add fixture fallback creation and relax unicode env assertion
Copilot Feb 23, 2026
3977da7
test: refactor fixture fallback helper and strengthen getenv assertion
Copilot Feb 23, 2026
db8dc6a
test: make getenv validation intent explicit
Copilot Feb 23, 2026
b412d8a
test: harden fixture write helper and simplify type assertion message
Copilot Feb 23, 2026
a2adcc7
refactor: use explicit success check for Lua file writes
Copilot Feb 23, 2026
ad119dc
test: accept shell unicode loss with warning while keeping strict uni…
Copilot Feb 23, 2026
5b4e765
test: route unicode-env warning to stderr
Copilot Feb 23, 2026
dbeac5c
docs: add imported-symbol unicode wrapper coverage audit
Copilot Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: CI

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build-mingw:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- target_arch: win32
run_tests: true
- target_arch: x64
run_tests: true

steps:
- uses: actions/checkout@v4

- name: Setup MSYS2 toolchains
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
make
mingw-w64-x86_64-gcc
mingw-w64-i686-gcc
mingw-w64-x86_64-clang
mingw-w64-clang-aarch64-gcc

- name: Build patched LuaJIT (MinGW)
shell: msys2 {0}
run: HOST_CC=gcc TARGET_ARCH=${{ matrix.target_arch }} ./scripts/build-mingw.sh

- name: Run UTF-8 wrapper tests (MinGW)
if: matrix.run_tests
shell: msys2 {0}
run: |
if [ "${{ matrix.target_arch }}" = "win32" ]; then
export PATH="/mingw32/bin:$PATH"
else
export PATH="/mingw64/bin:$PATH"
fi
IAT_TEST_VAR=Ελλ_中文_한국_عربي_кирил_деवनागरी \
LUAJIT_DLL=.work/LuaJIT/src/lua51.dll \
./.work/LuaJIT/src/luajit.exe tests/test_utf8_wrappers.lua

- name: Upload MinGW artifacts
uses: actions/upload-artifact@v4
with:
name: luajit-mingw-${{ matrix.target_arch }}
path: |
.work/LuaJIT/src/luajit.exe
.work/LuaJIT/src/lua51.dll
.work/LuaJIT/src/lua51.lib

build-msvc:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- target_arch: win32
run_tests: true
- target_arch: x64
run_tests: true
- target_arch: arm64
run_tests: false

steps:
- uses: actions/checkout@v4

- name: Resolve Visual Studio installation
shell: pwsh
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $vsPath) { throw "Visual Studio installation path not found" }
"VSINSTALLDIR=$vsPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Build patched LuaJIT (MSVC)
shell: cmd
run: |
set TARGET_ARCH=${{ matrix.target_arch }}
scripts\build-msvc.bat

- name: Run UTF-8 wrapper tests (MSVC)
if: matrix.run_tests
shell: cmd
run: |
chcp 65001 >nul
set IAT_TEST_VAR=Ελλ_中文_한국_عربي_кирил_देवनागरी
set LUAJIT_DLL=.work\LuaJIT\src\lua51.dll
.work\LuaJIT\src\luajit.exe tests\test_utf8_wrappers.lua

- name: Upload MSVC artifacts
uses: actions/upload-artifact@v4
with:
name: luajit-msvc-${{ matrix.target_arch }}
path: |
.work/LuaJIT/src/luajit.exe
.work/LuaJIT/src/lua51.dll
.work/LuaJIT/src/lua51.lib
145 changes: 145 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Release

on:
workflow_dispatch:
inputs:
luajit_ref:
description: "LuaJIT git ref (tag/branch/commit)"
required: true
default: "v2.1"
release_tag:
description: "Release tag to publish"
required: true
release_name:
description: "Release title"
required: false
default: "LuaJIT Unicode build"
push:
tags:
- "release-*"

permissions:
contents: read

jobs:
build:
runs-on: windows-latest
env:
LUAJIT_REF: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.luajit_ref || 'v2.1' }}
strategy:
fail-fast: false
matrix:
include:
- toolchain: mingw
target_arch: win32
run_tests: true
- toolchain: mingw
target_arch: x64
run_tests: true
- toolchain: msvc
target_arch: win32
run_tests: true
- toolchain: msvc
target_arch: x64
run_tests: true
- toolchain: msvc
target_arch: arm64
run_tests: false

steps:
- uses: actions/checkout@v4

- name: Setup MSYS2 toolchains (MinGW)
if: matrix.toolchain == 'mingw'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
make
mingw-w64-x86_64-gcc
mingw-w64-i686-gcc
mingw-w64-x86_64-clang
mingw-w64-clang-aarch64-gcc

- name: Resolve Visual Studio installation (MSVC)
if: matrix.toolchain == 'msvc'
shell: pwsh
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $vsPath) { throw "Visual Studio installation path not found" }
"VSINSTALLDIR=$vsPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Build patched LuaJIT (MinGW)
if: matrix.toolchain == 'mingw'
shell: msys2 {0}
run: |
HOST_CC=gcc \
LUAJIT_REF=$LUAJIT_REF \
TARGET_ARCH=${{ matrix.target_arch }} \
./scripts/build-mingw.sh

- name: Build patched LuaJIT (MSVC)
if: matrix.toolchain == 'msvc'
shell: cmd
run: |
set LUAJIT_REF=%LUAJIT_REF%
set TARGET_ARCH=${{ matrix.target_arch }}
scripts\build-msvc.bat

- name: Run UTF-8 wrapper tests (MinGW)
if: matrix.toolchain == 'mingw' && matrix.run_tests
shell: msys2 {0}
run: |
if [ "${{ matrix.target_arch }}" = "win32" ]; then
export PATH="/mingw32/bin:$PATH"
else
export PATH="/mingw64/bin:$PATH"
fi
IAT_TEST_VAR=Ελλ_中文_한국_عربي_кирил_देवनागरी \
LUAJIT_DLL=.work/LuaJIT/src/lua51.dll \
./.work/LuaJIT/src/luajit.exe tests/test_utf8_wrappers.lua

- name: Run UTF-8 wrapper tests (MSVC)
if: matrix.toolchain == 'msvc' && matrix.run_tests
shell: cmd
run: |
chcp 65001 >nul
set IAT_TEST_VAR=Ελλ_中文_한국_عربي_кирил_देवनागरी
set LUAJIT_DLL=.work\LuaJIT\src\lua51.dll
.work\LuaJIT\src\luajit.exe tests\test_utf8_wrappers.lua

- name: Package artifacts
shell: pwsh
run: |
New-Item -ItemType Directory -Path out -Force | Out-Null
$prefix = "luajit-unicode-${{ matrix.toolchain }}-${{ matrix.target_arch }}"
Copy-Item .work\LuaJIT\src\luajit.exe "out\$prefix-luajit.exe"
if (Test-Path .work\LuaJIT\src\lua51.dll) { Copy-Item .work\LuaJIT\src\lua51.dll "out\$prefix-lua51.dll" }
if (Test-Path .work\LuaJIT\src\lua51.lib) { Copy-Item .work\LuaJIT\src\lua51.lib "out\$prefix-lua51.lib" }

- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.toolchain }}-${{ matrix.target_arch }}
path: out/*

publish-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist

- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || github.ref_name }}
name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_name || format('LuaJIT Unicode build {0}', github.ref_name) }}
files: dist/*/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.work/
tests/_unicode_fixture/
Loading