feat(cli): NOTICE + --help=licenses topic (#115b) - #296
Merged
Conversation
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
enabled auto-merge (squash)
July 8, 2026 17:10
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
enabled auto-merge (squash)
July 8, 2026 17:42
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.
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.
Rewrites the placeholder
NOTICEinto a real third-party notice and adds a--help=licensestopic (alias=license).--//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 fromcli::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,=licensealias). Full//xff/...green (71).Completes #115. Next: #83 (libarchive behind
--//xff:archive) - the external-dependency step; I'll confirm before pushing the dep.