Skip to content

Plan: Lua 5.1/5.2 compatibility + adopt PR workflow#1

Merged
andrewstarks merged 2 commits into
mainfrom
docs/lua51-compat-plan
May 26, 2026
Merged

Plan: Lua 5.1/5.2 compatibility + adopt PR workflow#1
andrewstarks merged 2 commits into
mainfrom
docs/lua51-compat-plan

Conversation

@andrewstarks
Copy link
Copy Markdown
Owner

Summary

  • Adds Lua 5.1 / 5.2 compatibility plan to PLAN.md. The only thing binding the current lua >= 5.3 floor is parse_sdp/grammar/addresses.lua:124-198 (& / >> / << in int_to_ipv4 and ipv6_add). Plan isolates the bitwise code behind a three-file shim (bitops.lua dispatcher → bitops_53.lua native / bitops_compat.lua wrapping bit32), so 5.3+ keeps native operators and 5.1/5.2 never parses the native-syntax file. Rockspec pulls bit32 in only when _VERSION == "Lua 5.1" (5.2 has it in stdlib). Sliced into four ordered PRs (verification, shim refactor, compat slice with matrix CI + 1.3.0 release docs, publish).
  • Adds topic-branch + PR workflow rule to CLAUDE.md. All non-trivial changes — including docs and planning — go via a topic branch and PR from here on out. Lightweight: solo dev, no required reviewers, merge when CI is green. Trivial typo / whitespace fixes can still go direct to main.

This PR is itself the first application of the new workflow.

Test plan

Docs-only PR. Verification of plan claims happens in the verification-slice PR per PLAN.md's task checklist:

  • Confirm rockspec _VERSION-conditional dependency eval works under luarocks-5.1 and luarocks-5.5 (bit32 shows up in the 5.1 install set, not in the 5.5 install set)
  • Confirm bit32 rock is currently installable on Lua 5.1 (and on LuaJIT 5.1 if we care)
  • CI run on this PR stays green (no library code changed)

🤖 Generated with Claude Code

andrewstarks and others added 2 commits May 26, 2026 13:04
Lightweight solo process: branch with an intent-shaped name, open a PR,
merge when CI is green. Trivial typo / whitespace fixes can still go
directly to main. Adds a "Branching & Pull Requests" section to
CLAUDE.md and the corresponding step + checklist entry to Development
Workflow / Commit Gates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Today the floor is Lua 5.3 because addresses.lua uses native `&` / `>>`
/ `<<` in int_to_ipv4 and ipv6_add (lines 124-198). Everything else in
the library is portable.

Plan: isolate the bitwise code behind a three-file shim
(bitops.lua dispatcher + bitops_53.lua native backend +
bitops_compat.lua wrapping bit32), so 5.3+ keeps native operators and
5.1/5.2 never parses the native-syntax file. Rockspec pulls in the
bit32 rock only when _VERSION == "Lua 5.1" (5.2 has it in stdlib).
CI grows a leafo/gh-actions-lua matrix across 5.1-5.5.

Sliced into four ordered PRs: verification, shim refactor (still 5.3+
floor), compat slice (relax to 5.1, matrix CI, 1.3.0 release docs),
then publish. Risks and verify-before-commit steps called out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@andrewstarks andrewstarks merged commit 590849e into main May 26, 2026
2 checks passed
@andrewstarks andrewstarks deleted the docs/lua51-compat-plan branch May 26, 2026 18:42
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.

1 participant