patch: recognize OpenResty 1.31.1.x - #21
Open
caihonghaoCYF wants to merge 1 commit into
Open
Conversation
Add OpenResty 1.31.1.1 support. Validated end-to-end (see PR description). Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: IRVINGCAI <caihonghaoCYF@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe patch script now supports OpenResty 1.31.1. It selects the existing nginx 1.29.2 patch and targets ChangesOpenResty version support
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OpenResty 1.31.1.1 support to the APISIX build toolchain
TL;DR
OpenResty 1.31.1.1 (the latest release) builds and runs for APISIX with no C
source changes — the only blocker was a version-string whitelist in two
patch.shscripts. This change adds the missing
1.31.1.*branch in each of them and bumps thebuild-tools default. Validated end-to-end:
openresty/1.31.1.1+ all APISIX nginxmodules compile/link/run, and APISIX 3.17.0 starts, loads all plugins, and proxies
traffic with 0 errors.
It spans 3 repos (build-tools is the orchestrator; the two
patch.shlive in themodule repos):
api7/apisix-build-tools01-apisix-build-tools-openresty-1.31.1.1.patchOPENRESTY_VERSION→1.31.1.1api7/ngx_multi_upstream_module02-ngx_multi_upstream_module-openresty-1.31.1.1.patchpatch.sh: recognizeopenresty-1.31.1.*api7/apisix-nginx-module03-apisix-nginx-module-openresty-1.31.1.1.patchpatch/patch.sh: recognizeopenresty-1.31.1.*+ tolerate non-fatal hunk rejectsBackground
build-apisix-runtime.shclones each nginx module and runs itspatch.sh, which patchesnginx core plus the lua modules bundled inside OpenResty. Each
patch.shhas a hard-codedlist of supported OpenResty versions:
So 1.31.1.1 was rejected at the gate, before any patching. Once the branch is added,
the existing patch files apply cleanly to 1.31.1 (nginx core 1.29.2 → 1.31.1 did not
touch the patched locations; the bundled lua components only moved one
rc:lua-resty-core 0.1.34rc2→rc3,ngx_lua 0.10.31rc2→rc5,ngx_stream_lua 0.0.19rc3→rc4).The one non-fatal reject (ngx_lua shared_shdict)
patch/1.29.2.4/ngx_lua-shared_shdict.patchremoves ngx_lua's built-in shdict (APISIX shipsits own via
lua-resty-core/shared_shdict). Onngx_lua-0.10.31rc5, one hunk of thispatch rejects (context drift in
src/ngx_http_lua_shdict.c). It is non-fatal: the buildcompletes and APISIX runs correctly (it does not use ngx_lua's built-in shdict).
Patch 03 therefore makes
apply_patch()warn-and-continue on a rejected hunk instead ofaborting the whole build (
set -e). Recommended follow-up: refreshngx_lua-shared_shdict.patchagainst rc5 so the reject disappears and the tolerance changecan be reverted. Left to maintainers who know the shdict code best.
How to apply (3 PRs)
Each patch is a standard
git format-patchoutput (git am/git applycompatible):Suggested order: merge the two module PRs first (ngx_multi_upstream_module,
apisix-nginx-module), then the build-tools default-version PR.
Validation (reproduction)
Built on Ubuntu 22.04 x86_64 (gcc 11.4), with the 3 patches applied and
OPENRESTY_VERSION=1.31.1.1:./configuremake -jnginx -vopenresty/1.31.1.1nginx -Vapisix-nginx-module,ngx_multi_upstream_module,mod_dubbo,wasm-nginx-module,lua-var-nginx-module,lua-resty-events)ldd nginxluarocks make(84 rocks)apisix start(standalone)error.log [error] = 0curl /helloproxied to upstream (upstream response forwarded)GLIBC_2.34→ output also runs on el9 (glibc 2.34)Why this matters
APISIX's OpenResty fork always lags vanilla OpenResty because of these required core patches.
1.31.1.1 brings nginx 1.31.1 (HTTP/3, security fixes). This contribution closes that gap with
minimal, low-risk changes (version-string branches + one tolerance tweak), backed by a full
build + run validation.
Summary by CodeRabbit