Add optional PCRE2 runtime support for bundled NetEase rules - #25
Closed
jacklilyhello wants to merge 1 commit into
Closed
jacklilyhello wants to merge 1 commit into
jacklilyhello wants to merge 1 commit into
Conversation
Owner
Author
|
Closing as superseded by #27, which includes the full Phase D implementation plus optional PCRE2 CI coverage. |
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.
Implementation summary
bundled_rules.netease.regex_engine: pcre2while keeping RE2 as the default.pcre2build-tagged direct cgo binding to the PCRE2 8-bit API usingpkg-config: libpcre2-8.Modified files
internal/matcher/*for regex backend abstraction, RE2 wrapper, PCRE2 cgo implementation/stub, and PCRE2-tagged tests.internal/bundled/runtime.gofor backend-aware NetEase rule activation and stats.internal/engine/engine.gofor regex engine selection during prepare/reload.internal/config/*andconfig.example.ymlforregex_engineconfig, defaulting, env override, validation, and tests.README.md,docs/bundled-rules-phase-b-runtime.md,CHANGELOG.md,CODEX.md, andMakefilefor docs, log, and optional PCRE2 targets.Configuration changes
bundled_rules.netease.regex_enginewith allowed valuesre2andpcre2.re2.moderemains supported as a legacy alias for compatibility.OPENAUDIT_BUNDLED_RULES_NETEASE_REGEX_ENGINEenv override following existing bundled-rule env patterns.Build-tag / CGO behavior
-tags pcre2andCGO_ENABLED=1.CGO_ENABLED=0 go build ./...passes.PCRE2 dependency and license notes
pkg-config: libpcre2-8.libpcre2-dev.RE2 default compatibility statement
NetEase rule activation/statistics changes
Timeout/match-limit safety controls
Reload atomicity behavior
Tests run and exact results
go test ./internal/bundled/... ./internal/engine/... ./internal/matcher/... ./internal/rules/... ./internal/config/...go test ./...go vet ./... && go build ./... && CGO_ENABLED=0 go build ./... && make fmt-check && make verify-bundled-neteasego test -race ./internal/bundled/... ./internal/engine/... ./internal/matcher/... && make smoke && make e2emake gosecwas started, downloaded dependencies, but was interrupted after the tool installation exceeded the available time budget.govulncheck ./...was not run becausegovulncheckwas unavailable locally after the gosec install delay.Optional PCRE2 tests
go test -tags pcre2 ./...,go build -tags pcre2 ./...,make test-pcre2, andmake build-pcre2could not run becausepkg-configcould not findlibpcre2-8in this environment.Known limitations
libpcre2-8development files.pcre2_status: not_checkedare handled by runtime PCRE2 compile validation rather than regenerated reports.Explicit non-goals / unchanged behavior