Skip to content

feat(cli): NOTICE + --help=licenses topic (#115b) - #296

Merged
helly25 merged 2 commits into
mainfrom
feat/notice-licenses
Jul 8, 2026
Merged

feat(cli): NOTICE + --help=licenses topic (#115b)#296
helly25 merged 2 commits into
mainfrom
feat/notice-licenses

Conversation

@helly25

@helly25 helly25 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Rewrites the placeholder NOTICE into a real third-party notice and adds a --help=licenses topic (alias =license).

  • NOTICE: xff (Apache-2.0); core linked libs (Abseil Apache-2.0, RE2 BSD-3-Clause, helly25/mbo Apache-2.0); the build-extras' permissive notice sets (archive via libarchive - BSD-2/Zlib/bzip2/0BSD/BSD-3/BSD-2; regex via PCRE2 BSD-3) marked "linked only when the --//xff:<extra> flag is set". mbedtls explicitly excluded.
  • --help=licenses: xff's license, the always-linked core libs, and each extra with whether THIS binary has it (derived from cli::ExtraEnabled, so it reflects the actual build), pointing at NOTICE for full texts. In the topic index.

Tests: help_topic_test (core deps, archive extra, not-built-in status, NOTICE pointer, =license alias). Full //xff/... green (71).

Completes #115. Next: #83 (libarchive behind --//xff:archive) - the external-dependency step; I'll confirm before pushing the dep.

Rewrite the placeholder NOTICE into a real third-party notice: xff (Apache-2.0),
the core linked libraries (Abseil Apache-2.0, RE2 BSD-3-Clause, helly25/mbo
Apache-2.0), and the build-time extras' permissive notice sets (archive via
libarchive; regex via PCRE2) marked as linked only when the matching --//xff:
flag is set. mbedtls is explicitly excluded.

Add a --help=licenses topic (alias =license) that summarizes xff's license, the
always-linked core libs, and each extra with whether THIS binary contains it
(derived from cli::ExtraEnabled, so it reflects the actual build), pointing at
NOTICE for the full texts. Registered in HelpTopics()/RenderHelp so it appears
in the topic index.

Tests: help_topic_test asserts the topic lists the core deps, the archive extra,
its not-built-in status in a lean build, the NOTICE pointer, and the =license
alias.
@helly25
helly25 enabled auto-merge (squash) July 8, 2026 17:10
@helly25
helly25 disabled auto-merge July 8, 2026 17:16
…license

For single-file binary releases the program must carry its own notices; pointing
at LICENSE/NOTICE files that do not ship does not satisfy notice retention.

- Compile the repo's NOTICE + LICENSE into the binary via a //xff/cli:notices_gen
  genrule that wraps each file (verbatim) in a raw string literal. notices.h
  exposes non-constexpr NoticeText()/LicenseText(), so the text lives only in the
  generated .cc, never a header, and is never needed at compile time. //:LICENSE
  and //:NOTICE are exported for the genrule.
- Split the license help into two topics that reproduce the full texts:
  --help=notice (alias notices) = the third-party manifest + which build extras
  THIS binary contains (via ExtraEnabled); --help=license (alias licenses) =
  xff's Apache-2.0 in full.
- notices.h carries a TODO to move to C++23 #embed and reproduce each dependency's
  own license file verbatim (RE2 BSD-3, the extras) rather than just Apache + the
  NOTICE manifest.

Tests: help_topic_test asserts both topics reproduce their text (Apache text for
license; RE2/libarchive manifest + the extras line for notice) and the plural
aliases resolve.
@helly25
helly25 enabled auto-merge (squash) July 8, 2026 17:42
@helly25
helly25 merged commit a2e9e8e into main Jul 8, 2026
14 of 16 checks passed
@helly25
helly25 deleted the feat/notice-licenses branch July 8, 2026 18:12
helly25 added a commit that referenced this pull request Jul 8, 2026
* feat(license): code-SOT notice lib with self-registration (#115 follow-up)

Invert the notice handling per the agreed design: the code is the SOT and the
repo files are checked against it (not the reverse).

- New xff/license lib: a Notice registry + a Registrar helper. Components
  self-register - core deps (Abseil/RE2/mbo) from license.cc (always linked);
  a build-extra will register from its own TU (so it appears exactly when
  linked). Notices() returns the set sorted by component (deterministic across
  static-init order). NoticeText() assembles the xff attribution header + the
  sorted components; this is the SOT for the repo NOTICE.
- LICENSE stays canonical: LicenseText() is generated from //:LICENSE via a
  genrule (byte-exact, no leading-newline artifact) and embedded so a single
  binary reproduces it.
- --help=notice / --help=license dump the compiled-in subset from the lib.
  Retire #296's files->.cc genrule and xff/cli/notices.*; help_cc now deps
  //xff/license:license_cc.
- license_test guards drift: the committed NOTICE == NoticeText() and LICENSE
  == LicenseText() (read from runfiles), plus the core deps are present + sorted.
  (No extra is linked yet, so NoticeText is the full set; #83 makes the compare
  full-fat once libarchive self-registers.)

TODO(license.h): move to C++23 #embed + reproduce each dependency's own license
file verbatim (RE2 BSD-3 etc.), not just Apache + the manifest.

* chore: spell the author name Boerger (international) not Börger

The copyright name lives in the license SOT (NoticeText in xff/license/license.cc)
and the committed NOTICE; change both to the international spelling 'Boerger'.

* docs(todo): record license self-reg shipped + defer dual-binary/extras to #83/#85

#297 is the code-SOT self-registration license lib (core notices, LICENSE
genrule, drift guard). The dual binary (xff_minimal/xff_full via alias, manual),
the stub/real xff/archive + xff/pcre modules (@libarchive/@pcre2, self-register
their notices), the full-fat NOTICE + full-config drift check, and the CI dual
build are deferred to #83/#85 with the agreed design captured. Under self-
registration a minimal binary's core-only NOTICE is correct; the extras' notices
arrive with their real modules.
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