Skip to content

extras: move the license-notice registry into xff_extras_api - #327

Merged
helly25 merged 1 commit into
mainfrom
feat/extras-license-notice
Jul 10, 2026
Merged

extras: move the license-notice registry into xff_extras_api#327
helly25 merged 1 commit into
mainfrom
feat/extras-license-notice

Conversation

@helly25

@helly25 helly25 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

b2 of the true-module extras refactor (#123).

Mirrors b1: the license-notice registration seam (Notice + Register + Registrar + Notices + the process-wide registry) moves out of //xff/license into a second xff_extras_api target, license_notice. So an extra self-registers its notice via @xff_extras_api, not the core - removing the last root-package dep on extra_modules/pcre2's backend and unblocking b3 (pcre2 as a standalone module).

Changes

  • extra_modules/xff_extras_api: now two targets - regex_backend (backend.{h,cc}, include_prefix xff/regex) and license_notice (notice.{h,cc}, include_prefix xff/license). notice.h keeps the xff/license/notice.h include path + xff::license namespace, so consumers are unchanged.
  • //xff/license: license.h re-includes notice.h; license.cc keeps the core registrars (kAbseil/kRe2/kMbo) + NoticeText() + the generated LicenseText(), drops the moved registry; license_cc deps @xff_extras_api//:license_notice.
  • extra_modules/pcre2: the backend includes xff/license/notice.h and deps @xff_extras_api//:{regex_backend,license_notice} + @pcre2 - no root-package deps left.

Verified

No behavior change. --help=notice still lists PCRE2 (full binary) / omits it (lean) via the base seam; bazel test //... (74/74, incl license_test) and --config=xff_full (pcre2_backend_test + full_binary_test) both green.

Next

  • b3: make extra_modules/pcre2 a real standalone module (own MODULE.bazel + bazel_dep/local_path_override), retiring the include() segment.

Part of #123.

Second step of the true-module extras refactor (#123). The license-notice registration
seam (Notice + Register + Registrar + Notices + the process-wide registry) moves out of
//xff/license into a second xff_extras_api target, license_notice - mirroring b1's
regex_backend. So an extra self-registers its notice via @xff_extras_api, not the core.

- extra_modules/xff_extras_api: split into two targets, regex_backend (backend.{h,cc},
  include_prefix xff/regex) and license_notice (notice.{h,cc}, include_prefix
  xff/license). notice.h keeps the xff/license/notice.h include path + xff::license
  namespace, so consumers are unchanged.
- //xff/license: license.h re-includes notice.h; license.cc keeps the core registrars
  (kAbseil/kRe2/kMbo) + NoticeText() + the generated LicenseText(), drops the moved
  registry; license_cc deps @xff_extras_api//:license_notice.
- extra_modules/pcre2: the backend now includes xff/license/notice.h and deps
  @xff_extras_api//:{regex_backend,license_notice} + @pcre2 - NO root-package deps left,
  which unblocks making pcre2 a standalone module (b3).

No behavior change: --help=notice still lists PCRE2 (full) / omits it (lean) via the base
seam; lean //... (74/74, incl license_test) and --config=xff_full both green.
@helly25
helly25 enabled auto-merge (squash) July 10, 2026 23:17
@helly25
helly25 merged commit d7da777 into main Jul 10, 2026
9 checks passed
@helly25
helly25 deleted the feat/extras-license-notice branch July 10, 2026 23:26
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant