zstd patch
build-and-publish / build (Raccoon, ubuntu:26.04, NEXUS_PASS_RACCOON, NEXUS_REPO_RACCOON, NEXUS_USER_RACCOON, raccoon) (push) Successful in 3m39s
build-and-publish / build (Trixie, debian:13, NEXUS_PASS_TRIXIE, NEXUS_REPO_TRIXIE, NEXUS_USER_TRIXIE, trixie) (push) Successful in 3m26s

This commit is contained in:
theraw
2026-07-01 22:59:28 +00:00
parent 0078fdbc53
commit 730a4cc47f
4 changed files with 28 additions and 116 deletions
+10 -19
View File
@@ -244,27 +244,18 @@ function clean_install() {
cd /opt/mod/; git clone --recurse-submodules https://github.com/wargio/naxsi.git naxsi
fi
# NGX_MOD_ZSTD — Zstandard compression module from tokers. Pinned via
# NGX_MOD_ZSTD; tarball pattern (dir name embeds version → cache invalidates
# automatically when the pin moves).
# NGX_MOD_ZSTD — Zstandard compression module from eilandert (maintained
# fork of tokers/zstd-nginx-module, which has been abandoned since 0.1.1 in
# 2023-10-23). Pinned via NGX_MOD_ZSTD; tarball pattern (dir name embeds
# version → cache invalidates automatically when the pin moves).
#
# The fork ships the flush-loop CPU-spin fix we previously carried as
# build/patches/zstd-nginx-module-0.1.1-flush-cpu-spin.patch — see PR #23,
# PR #49, and the "content-less flush completed" branch in
# filter/ngx_http_zstd_filter_module.c. No local patching needed.
if [ ! -d /opt/mod/zstd-nginx-module-${NGX_MOD_ZSTD} ]; then
cd /opt/mod/; wget https://github.com/tokers/zstd-nginx-module/archive/refs/tags/${NGX_MOD_ZSTD}.tar.gz
cd /opt/mod/; wget https://github.com/eilandert/zstd-nginx-module/archive/refs/tags/${NGX_MOD_ZSTD}.tar.gz
cd /opt/mod/; tar xf ${NGX_MOD_ZSTD}.tar.gz; rm -Rf ${NGX_MOD_ZSTD}.tar.gz
# Local fix for the zstd-nginx-module 0.1.1 worker CPU spin (100% CPU on
# a flushed compressible response: proxy_buffering off, SSE, PHP flush()).
# Upstream is unmaintained (0.1.1 is the latest tag), so we carry it.
# Applied here rather than in apply_patches() because the module lives
# outside the nginx source tree; the [ ! -d ] guard above makes this a
# fresh-extract-only operation (rm the module dir to force a re-patch).
zstd_fix="${SCRIPT_DIR}/patches/zstd-nginx-module-${NGX_MOD_ZSTD}-flush-cpu-spin.patch"
if [ "${APPLY_PATCH_ZSTD_FLUSH_FIX:-1}" = "1" ]; then
[ -f "$zstd_fix" ] || { echo "[patch] MISSING $zstd_fix"; exit 1; }
echo "[patch] applying zstd-nginx-module-${NGX_MOD_ZSTD}-flush-cpu-spin.patch"
( cd /opt/mod/zstd-nginx-module-${NGX_MOD_ZSTD} && patch -p1 < "$zstd_fix" )
else
echo "[patch] skip zstd flush fix (APPLY_PATCH_ZSTD_FLUSH_FIX=0)"
fi
fi
# END OF NGINX MODULES