Skip to content

Add opt-in openresty feature for s390x support - #6

Open
Chandrababunagilli-ibm wants to merge 4 commits into
mlua-rs:mainfrom
Chandrababunagilli-ibm:feature/openresty-option
Open

Chandrababunagilli-ibm wants to merge 4 commits into
mlua-rs:mainfrom
Chandrababunagilli-ibm:feature/openresty-option

Conversation

@Chandrababunagilli-ibm

Copy link
Copy Markdown
  • Add OpenResty LuaJIT submodule (commit f75bf45e, version 1789605824)
  • Implement conditional compilation based on openresty feature flag
  • Extend CI to test openresty feature
  • Update documentation for s390x support
  • Add helper functions source_dir() and relver_file()
  • Update update.sh to handle OpenResty submodule

Tested on x86_64 (JIT enabled) and s390x (interpreter-only). All 215 mlua integration tests pass on both architectures.

- Add OpenResty LuaJIT submodule (commit f75bf45e, version 1789605824)
- Implement conditional compilation based on openresty feature flag
- Extend CI to test openresty feature
- Update documentation for s390x support
- Add helper functions source_dir() and relver_file()
- Update update.sh to handle OpenResty submodule

Tested on x86_64 (JIT enabled) and s390x (interpreter-only).
All 215 mlua integration tests pass on both architectures.
Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
- Add relver_src variable to capture source path
- Update error context to show which file failed to copy
- Applied to both Unix and MSVC build paths

Addresses review feedback from ramgdev
@Chandrababunagilli-ibm
Chandrababunagilli-ibm marked this pull request as ready for review October 13, 2026 15:50
@Chandrababunagilli-ibm

Copy link
Copy Markdown
Author

@khvzak @ErikMcClure could you take a look at this when you have time? I've marked it ready for review.

What it does
Adds an opt-in openresty Cargo feature. With it on, luajit-src builds
openresty/luajit2 (branch v2.1-agentzh,
pinned to f75bf45e) instead of mainline LuaJIT. The default build is unchanged.

Why
Mainline LuaJIT has no s390x backend, so this crate can't build there:

lj_arch.h:69:2: error: #error "Architecture not supported (in this version)"
Makefile:270: *** Unsupported target architecture.  Stop.

OpenResty's fork supports s390x (interpreter-only: LJ_ARCH_NOJIT, so
jit.status() is false). The feature lets s390x users consume this crate directly.

Design

  • OpenResty source is a second submodule (luajit2-openresty), updated by update.sh
  • source_dir() / relver_file() pick the source tree and its own version file
  • With the feature on and debug off, CCDEBUG is cleared (OpenResty's Makefile sets -g)
  • CI runs --features openresty and openresty,lua52compat

Testing: testcrate

default openresty openresty,lua52compat debug + openresty
x86_64 pass pass (JIT on) pass pass
s390x fails as above pass pass pass

Testing: mlua 0.10.5 test suite (mlua-sys 0.6.8, with luajit-src pointed at this branch)

  • x86_64 (native): all tests pass
  • s390x (cross-built, run under QEMU): all tests pass

A follow-up in mlua-sys would be needed to forward the feature. I'm happy to send
that once the design here is settled. Since this is my first PR here, the workflows
probably need approval to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants