extras: extract the xff_extras_api base module (RegexBackend seam) - #326
Merged
Conversation
First step of the true-module extras refactor (#123). The RegexBackend plugin interface + PCRE2 registration slot (backend.h) move out of //xff/regex into a new standalone local Bazel module, xff_extras_api, that both the core and every removable extra depend on - so an extra can become a real module without depending back into the core (which would be a cycle). - extra_modules/xff_extras_api/: MODULE.bazel + backend.{h,cc}. Holds RegexBackend, the Pcre2Factory/RegisterPcre2Backend/Pcre2Registrar API, Pcre2Available(), and a new MakePcre2Backend() that owns the slot + the "not built in" Unimplemented. Header keeps its xff/regex/backend.h include path (include_prefix) and xff::regex namespace, so no consumer include or call changes. - //xff/regex: regex.h re-includes backend.h; regex.cc's Compile(kPcre2) calls MakePcre2Backend instead of the local slot; regex_cc deps @xff_extras_api. - extra_modules/pcre2: the backend now gets the interface from @xff_extras_api, not //xff/regex - a step toward pcre2 being a standalone module (b3). - MODULE.bazel: bazel_dep + local_path_override for xff_extras_api; align rules_cc to the resolved 0.2.21 (silences the direct-dep skew the fresh resolution surfaced). No behavior change: regex_test (lean not-built-in) and pcre2_backend_test (full PCRE2 via the relocated slot) both pass; lean //... and --config=xff_full both green.
helly25
enabled auto-merge (squash)
July 10, 2026 22:15
helly25
added a commit
that referenced
this pull request
Jul 11, 2026
…l; minimal-archive CI (#328) * extras: make pcre2 a standalone module; relocate xff_extras_api to top level Final step of the true-module extras refactor (#123). extra_modules/pcre2 becomes its own Bazel module (xff_pcre2), and the shared base module moves out of extra_modules/ so that directory holds ONLY removable extras. - xff_extras_api relocated extra_modules/xff_extras_api -> top-level xff_extras_api/. It is core-required (RegexBackend + license-notice seams), so it must NOT live under extra_modules/; now `rm -rf extra_modules/` (+ dropping the extras' bazel_deps) yields a minimal core archive. (Fixes the location introduced in #326/#327.) - extra_modules/pcre2: new MODULE.bazel (module xff_pcre2, bazel_dep pcre2 + xff_extras_api); root swaps the include() segment for bazel_dep + local_path_override (the override is root-global, so xff_pcre2's bazel_dep(xff_extras_api) resolves). The old pcre2.MODULE.bazel segment + its exports_files are gone. pcre2_backend is //visibility:public. - pcre2_backend_test rewritten to drive the backend through the base seam (MakePcre2Backend / RegexBackend), dropping its //xff/regex dep so it is module-local; the Matcher routing stays covered by //xff/cli:full_binary_test. - xff_full select + CI full cell: //extra_modules/pcre2:... -> @xff_pcre2//:... Verified: lean //... (74/74) has zero extra_modules/@pcre2 deps (cquery); --config=xff_full full_binary_test + @xff_pcre2//:pcre2_backend_test green; --help=notice still lists PCRE2 (full) via the standalone module's license seam. * ci: add a minimal-core-archive cell (drop all of extra_modules/) Guards the full-separation property (#123): strip the whole extra_modules/ directory plus the extras' bazel_dep + local_path_override lines, then build the lean core (//xff/cli:xff). It passes only because xff_extras_api is top-level core infrastructure (not under extra_modules/) and nothing in the core reaches into an extra - so a future core->extra dependency, or a regression that pulls an extra into a lean target, fails here. One cell on the single most-default target (ubuntu default); wired into the done gate. Verified locally: rm -rf extra_modules + the sed strip -> bazel build --nobuild //... re-resolves and loads all targets cleanly (xff_full's @xff_pcre2 select is lazy/manual).
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.
b1 of the true-module extras refactor (#123).
The RegexBackend plugin interface + PCRE2 registration slot (
backend.h) move out of//xff/regexinto a new standalone local Bazel module,xff_extras_api, that both the xff core and every removable extra depend on. This breaks the cycle that blocked a real extra module: an extra (extra_modules/pcre2) can now depend on@xff_extras_apifor the interface instead of reaching back into the core.Changes
extra_modules/xff_extras_api/(new local module):MODULE.bazel+backend.{h,cc}. HoldsRegexBackend, thePcre2Factory/RegisterPcre2Backend/Pcre2RegistrarAPI,Pcre2Available(), and a newMakePcre2Backend()that owns the factory slot + the "not built in"Unimplemented. The header keeps itsxff/regex/backend.hinclude path (viainclude_prefix) andxff::regexnamespace, so no consumer include or call site changes.//xff/regex:regex.hre-includesbackend.h;regex.cc'sCompile(kPcre2)callsMakePcre2Backendinstead of the local slot;regex_ccdeps@xff_extras_api.extra_modules/pcre2: the backend gets the interface from@xff_extras_api, not//xff/regex.MODULE.bazel:bazel_dep+local_path_overrideforxff_extras_api; alignrules_ccto the resolved0.2.21(silences the direct-dep skew the fresh resolution surfaced).Verified
No behavior change.
regex_test(lean not-built-in path viaMakePcre2Backend) andpcre2_backend_test(full PCRE2 compile via the relocated slot) both pass; lean//...(74/74) and--config=xff_full(incl. the manualpcre2_backend_test+full_binary_test) both green.Next (this series)
xff_extras_apitoo.extra_modules/pcre2a real standalone module (ownMODULE.bazel+local_path_override), retiring theinclude()segment.Part of #123.