Repository navigation
trafficserver10: init at 10.2.1 - #474177
Conversation
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
b3ec461 to
c7ca951
Compare
c7ca951 to
4796544
Compare
|
Might be related: |
|
@Sigmanificient I'm sorry, but I'm not really following the PCRE1 stuff. I suspect there are many packages using PCRE1. - This won't block this PR, correct? |
4796544 to
0746824
Compare
|
Closing and reopening to fix CI, see #499751 |
0746824 to
3fa75fc
Compare
|
Rebased onto current master, squashed into a single commit, and addressed nix-idiomatic issues:
|
|
Upstream has already purged PCRE completely: apache/trafficserver@b38147f |
|
I assume the latest tag https://github.com/apache/trafficserver/releases/tag/10.1.4 could be built without PCRE 1 support? |
3fa75fc to
320c646
Compare
|
@fliiiix good question — I checked the sources: 10.1.4 still requires PCRE1 ( So I've prepared this PR against 10.2.0-rc1 to be PCRE1-free and make the eventual bump trivial — not expecting it to merge as an RC. The plan is to re-pin to stable 10.2.0 with a quick version + hash update once it's released, and merge then. |
320c646 to
a99370d
Compare
|
Did some extra multi-architecture testing on real hardware and via cross-compilation, and tightened the platform metadata as a result: aarch64-linux — built and run natively. Compiled riscv64 — unsupported upstream, now excluded via Traffic Server's lock-free freelist needs an ABA-safe atomic head and picks one of two strategies: a generic path when the toolchain has a lock-free 128-bit compare-and-swap ( badPlatforms = lib.platforms.riscv;so the package advertises the restriction instead of failing to build on RISC-V. Cross-compile correctness. The cross attempt also exposed that doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;Native builds are unaffected (the check still runs); cross builds now skip it cleanly. x86_64-linux + native aarch64-linux both build green with only PCRE2 linked. Description updated with the details. |
a99370d to
0315411
Compare
|
For the record: I filed a friendly heads-up upstream about the riscv64 build failure, since it's an upstream limitation rather than a packaging issue — apache/trafficserver#13555. It documents the |
|
|
||
| stdenv.mkDerivation (finalAttrs: { | ||
| pname = "trafficserver10"; | ||
| version = "10.2.0-rc1"; |
There was a problem hiding this comment.
i guess 10.2.0 is also tagged? https://github.com/apache/trafficserver/releases/tag/10.2.0 i guess this could be updated
8f6fa9c to
4f17135
Compare
|
This is now ready for review. Sorry it has been open so long; it was waiting on a stable PCRE2-only release. @fliiiix thanks, good catch: it's now on the stable 10.2.0 tag (the rc1 commit promoted unchanged, so the source hash didn't change). Since the last push:
@midchildan, as maintainer of the v9 🤖 Generated with Claude Code |
|
@drupol would love to see this merged |
drupol
left a comment
There was a problem hiding this comment.
Made a few comments, let me know if they make sense to you.
Also, would it be possible to add a versionCheckHook if the CLi supports it ?
| pname = "trafficserver10"; | ||
| version = "10.2.0"; | ||
|
|
||
| # 10.2.x drops the legacy PCRE1 dependency and links only PCRE2. |
There was a problem hiding this comment.
This comment doesn't really make sense here. Or am I missing something ?
| ++ lib.optional withBrotli brotli | ||
| ++ lib.optional withCap libcap | ||
| ++ lib.optional withCjose cjose | ||
| ++ lib.optional withCurl curl | ||
| ++ lib.optional withHiredis hiredis | ||
| ++ lib.optional withHwloc hwloc | ||
| ++ lib.optional withImageMagick imagemagick | ||
| ++ lib.optional withJansson jansson | ||
| ++ lib.optional withKyotoCabinet kyotocabinet | ||
| ++ lib.optional withCurses ncurses | ||
| ++ lib.optional withLuaJIT luajit | ||
| ++ lib.optional withUnwind libunwind | ||
| ++ lib.optional withMaxmindDB libmaxminddb; |
There was a problem hiding this comment.
I would prefer to continue using lib.optionals here.
| ++ lib.optional withBrotli brotli | |
| ++ lib.optional withCap libcap | |
| ++ lib.optional withCjose cjose | |
| ++ lib.optional withCurl curl | |
| ++ lib.optional withHiredis hiredis | |
| ++ lib.optional withHwloc hwloc | |
| ++ lib.optional withImageMagick imagemagick | |
| ++ lib.optional withJansson jansson | |
| ++ lib.optional withKyotoCabinet kyotocabinet | |
| ++ lib.optional withCurses ncurses | |
| ++ lib.optional withLuaJIT luajit | |
| ++ lib.optional withUnwind libunwind | |
| ++ lib.optional withMaxmindDB libmaxminddb; | |
| ++ lib.optionals withBrotli [ brotli ] | |
| ++ lib.optionals withCap [ libcap ] | |
| ++ lib.optionals withCjose [ cjose ] | |
| ++ lib.optionals withCurl [ curl ] | |
| ++ lib.optionals withHiredis [ hiredis ] | |
| ++ lib.optionals withHwloc [ hwloc ] | |
| ++ lib.optionals withImageMagick [ imagemagick ] | |
| ++ lib.optionals withJansson [ jansson ] | |
| ++ lib.optionals withKyotoCabinet [ kyotocabinet ] | |
| ++ lib.optionals withCurses [ ncurses ] | |
| ++ lib.optionals withLuaJIT [ luajit ] | |
| ++ lib.optionals withUnwind [ libunwind ] | |
| ++ lib.optionals withMaxmindDB [ libmaxminddb ]; |
| installCheckPhase = '' | ||
| runHook preInstallCheck | ||
|
|
||
| # Verify traffic_via parses Via headers correctly | ||
| output=$($out/bin/traffic_via '[uScMsEf p eC:t cCMp sF]') | ||
| echo "$output" | grep -q "Via header is" | ||
| echo "$output" | grep -q "Length is 22" | ||
| echo "$output" | grep -q "cache miss" | ||
|
|
||
| runHook postInstallCheck | ||
| ''; |
There was a problem hiding this comment.
Opinionated: I don't think we should test this in here, but perhaps in a test ? (passthru.smoke-test = runCommand ... ?)
Apache Traffic Server 10.x, the CMake-based successor to the 9.x line packaged as trafficserver. 10.2 links only PCRE2. Add __riscv to the stack-growth-direction allowlist in UnixEventProcessor.cc so riscv64 builds; 10.2.1 already includes the libatomic 128-bit CAS fallback (apache/trafficserver#13571). cjose is only enabled on glibc: its sole user, the uri_signing plugin, needs hsearch_r and re_compile_pattern, so it fails to build on Darwin. Assisted-by: Claude Code (Claude Opus 5.5)
4f17135 to
d8160dd
Compare
|
@drupol thanks, all addressed:
Built natively on x86_64-linux, aarch64-linux (Pi 5) and aarch64-darwin (M5); on each, the version check and passthru test pass, and ATS reverse-proxies with cache hits under 8 concurrent clients. riscv64 cross-compiles; a native build on the BPI-F3 is running and should finish by tomorrow, and I'll follow up then. |
|
Thanks for merging. Follow-up on riscv64: the cross-built 10.2.1 ( |
Add Apache Traffic Server 10.x as
trafficserver10, the current major version of the HTTP caching proxy.It is a separate package from the existing
trafficserver(v9.x), because v10 has breaking changes:trafficserver)trafficserver10)tspushutility$out/etc/$out/share/trafficserver/The existing NixOS module (
services.trafficserver) is unchanged and still usespkgs.trafficserver(v9). Wiring v10 into the module is left for a follow-up.Features enabled by default
All optional features except MaxmindDB are enabled. Upstream's CMake auto-detects them from
buildInputs:compress.so)tslua.so). Gated onlib.meta.availableOn, so it is off on platforms without LuaJIT (e.g. riscv64)webp_transform.so)uri_signing.so). glibc only: the plugin needshsearch_randre_compile_patternMaxmindDB (GeoIP) is off by default because it needs separate database files. All of these can be toggled with
.override:Package structure
Default configs are moved from
etc/toshare/trafficserver/because the store is read-only; a module copies them to/etc/trafficserver/.Platform support
Each native platform was tested with a reverse-proxy smoke test: ATS proxied a local origin, served the second fetch as a fresh RAM cache hit (Via
[cRs f ]), then answered 8 concurrent clients × 500 requests, all 200, without further origin fetches.passthru.testspass, proxies and caches trafficpassthru.testspass, proxies and caches trafficpassthru.testspass, proxies and caches trafficpkgsCross.riscv64.trafficserver10, all 64 plugins); ⏳ native build on a Banana Pi BPI-F3 (SpacemiT K1) in progressriscv64:
src/iocore/eventsystem/UnixEventProcessor.cchas a hard-coded list of architectures whose stack grows down, and errors on anything else.riscv-stack-growth-direction.patchadds__riscv, whose stack also grows down. It is not fixed upstream yet. The freelist's 128-bit CAS falls back to libatomic on riscv64 since 10.2.1 (apache/trafficserver#13571); x86_64 and aarch64 keep the inline CAS.Darwin: the
uri_signingplugin uses glibc'shsearch_randre_compile_pattern, so it fails to build on Darwin. cjose is only used by that plugin, sowithCjosedefaults tostdenv.hostPlatform.libc == "glibc".Build verification
Things done
Built on platform:
x86_64-linux
aarch64-linux
x86_64-darwin
aarch64-darwin
Tested, as applicable:
[NixOS tests] in [nixos/tests].
[Package tests] at
passthru.tests.Tests in [lib/tests] or [pkgs/test] for functions and "core" functionality.
Ran
nixpkgs-reviewon this PR. See [nixpkgs-review usage].Tested basic functionality of all binary files, usually in
./result/bin/.traffic_server --version(versionCheckHook) ✓ (x86_64-linux, aarch64-linux, aarch64-darwin)traffic_viaheader parsing (passthru.tests.traffic-via) ✓ (same)Nixpkgs Release Notes
NixOS Release Notes
Module addition: when adding a new NixOS module.
Module update: when the change is significant.
Fits [CONTRIBUTING.md], [pkgs/README.md], [maintainers/README.md] and other READMEs.
Links
🤖 Generated with Claude Code