Skip to content

fix(ci): pin Lua version on 5.4#3524

Open
airween wants to merge 2 commits intoowasp-modsecurity:v3/masterfrom
airween:v3/freezeluainci
Open

fix(ci): pin Lua version on 5.4#3524
airween wants to merge 2 commits intoowasp-modsecurity:v3/masterfrom
airween:v3/freezeluainci

Conversation

@airween
Copy link
Copy Markdown
Member

@airween airween commented Mar 27, 2026

what

This PR pins Lua version in OSX workflows on 5.4.

why

It seems like the default Lua version is 5.5 if someone installs it on OSX, and the library is not ready to work with it.

This is a workaround, we should align the Lua related code.

references

#3523

Copy link
Copy Markdown
Collaborator

@fzipi fzipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two suggestions:

1. Use a workflow-level env variable

The string 5.4 is hardcoded in 6 places across the two files. If we ever bump the version, all of them need updating. Each workflow should define it once at the top:

env:
  LUA_VERSION: "5.4"

Then reference it consistently everywhere — macOS and Linux alike:

# macOS
brew install ... lua@${{ env.LUA_VERSION }} ...
echo "/usr/local/opt/lua@${{ env.LUA_VERSION }}/bin" >> $GITHUB_PATH

# Linux
sudo apt-get install -y liblua${{ env.LUA_VERSION }}-dev

2. Lua version mismatch across platforms

After this PR, macOS jobs will use Lua 5.4 while all Linux jobs still use liblua5.2-dev (Lua 5.2):

File Job Lua version
ci.yml build-linux 5.2 (liblua5.2-dev)
ci.yml build-macos 5.4 (after this PR)
ci_new.yml build-linux 5.2 (liblua5.2-dev)
ci_new.yml build-macos 5.4 (after this PR)
ci_new.yml cppcheck (macOS) 5.4 (after this PR)
ci_new.yml cppcheck-linux 5.2 (liblua5.2-dev)

This makes CI more inconsistent than before — we'd be testing against different Lua versions per platform. The Linux jobs should also use liblua${{ env.LUA_VERSION }}-dev so there's a single source of truth for the Lua version across all platforms and jobs.

…oss all jobs

Pin Lua to 5.4 via a single workflow-level env variable instead of
hardcoding the version in each job. This also aligns Linux jobs
(previously on 5.2) with macOS jobs (5.4).
Copy link
Copy Markdown
Collaborator

@fzipi fzipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! 🎉

@sonarqubecloud
Copy link
Copy Markdown

@fzipi fzipi added the ci/cd label Mar 28, 2026
@fzipi fzipi changed the title fix: pin Lua version on 5.4 fix(ci): pin Lua version on 5.4 Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants