Skip to content

feat: S30.03 generate the integration manifest from CMake (anti-drift)#572

Merged
DavidCozens merged 2 commits into
mainfrom
feat/s30-03-generate-manifest
Jun 11, 2026
Merged

feat: S30.03 generate the integration manifest from CMake (anti-drift)#572
DavidCozens merged 2 commits into
mainfrom
feat/s30-03-generate-manifest

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Purpose

Final E30 (#566) story. Generate the non-CMake integration manifest from
CMake
so the file/include/-D list can't drift from the build, and replace the
hand-authored lists in getting-started.md (S30.01) with generated output.

Closes #569

Change Description

  • cmake/Manifest.cmake — a manifest target that emits the integration
    manifest for the active configuration. The .c lists are read straight from the
    build (the Core lib's SOURCES + each selected pack's INTERFACE_SOURCES,
    populated in S30.02), so they can't drift. Stable per-pack knowledge (the config
    header each pack needs) is a small curated map.
    • Selection via SOLIDSYSLOG_MANIFEST_PACKS (;-list of pack short-names;
      empty = every defined SolidSyslog::<Pack>). Core always included.
    • Host Pattern-A adapters baked into the Core target
      (POSIX/Windows/OpenSSL/C11-atomics) are filtered out — they're host-build
      conveniences, not part of an embedded manifest. Include dirs de-duplicated.
    • Generation runs at configure time (writes ${BINARY_DIR}/solidsyslog-manifest.txt,
      plus SOLIDSYSLOG_MANIFEST_OUTPUT when set). The manifest target prints it
      via a -P helper (cmake/PrintManifest.cmake) so it works on the project's
      CMake 3.16 floor (cmake -E cat is 3.18+).
  • Committed sample + gating CI diff. The beta-stack manifest is committed at
    docs/generated/beta-stack-manifest.txt;
    the new verify-manifest CI job regenerates it in the cpputest-freertos image
    and git diff --exit-codes (fails on drift). The beta sample includes the DNS
    resolver (matching the FreeRtosLwip BDD target), so it demonstrates the opt-in
    component + -DLWIP_DNS=1.
  • getting-started.md now consumes the generated file — the hand-listed .c
    blocks are gone, replaced by a pointer to the committed manifest + the
    regenerate command. Bare code fences in the touched file tagged (text).
  • DEVLOG updated.

Test Evidence

CMake/docs only (no .c/.h changed). Verified locally in the cpputest-freertos
image:

  • manifest target emits a correct manifest; Core list has no Platform/
    leak
    ; include dirs de-duplicated.
  • The committed beta sample matches a fresh regeneration — git diff --exit-code
    is clean (the gate passes and would catch real drift).
  • Default selection (cmake --preset debug, all 7 packs) configures and the full
    junit build passes.

Areas Affected

cmake/Manifest.cmake (new), cmake/PrintManifest.cmake (new), CMakeLists.txt
(include + call), docs/generated/beta-stack-manifest.txt (new committed sample),
docs/getting-started.md, .github/workflows/ci.yml (new verify-manifest
job), DEVLOG.md.

Action for the maintainer: add verify-manifest to the branch-protection
required checks so the drift gate blocks merges (the job runs and is wired into
the summary aggregator now, but won't block until it's marked required).

Summary by CodeRabbit

  • New Features

    • Integration manifests are now generated from the build configuration to keep exported sources, includes, and config flags in sync with selected packs.
  • Documentation

    • Getting-started guide and DEVLOG updated with the new manifest workflow and instructions for regenerating manifests for different pack selections.
  • Chores

    • CI now includes a verification step that regenerates and checks the committed manifest to prevent drift.

Add cmake/Manifest.cmake: a `manifest` target that emits the non-CMake
file/include/-D integration manifest for the active configuration, reading the
.c lists straight from the build (Core SOURCES + each selected pack's
INTERFACE_SOURCES) so they can't drift. Selection via SOLIDSYSLOG_MANIFEST_PACKS
(empty = all defined packs); Core is always included; the host Pattern-A adapters
baked into Core are filtered out; include dirs are de-duplicated. Generation runs
at configure time; the target prints via a -P helper (3.16-floor safe).

Commit the generated beta-stack manifest at docs/generated/beta-stack-manifest.txt
and add the gating `verify-manifest` CI job that regenerates it and fails on drift
(git diff --exit-code). getting-started.md now consumes that generated file
(hand-listed .c blocks removed) and documents the regenerate command.

Note: verify-manifest must be added to branch-protection required checks (manual)
to block merges on drift.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c408ee7-623d-4bbe-b892-80e5822353e6

📥 Commits

Reviewing files that changed from the base of the PR and between 3d068a5 and 7ee7fc6.

📒 Files selected for processing (1)
  • docs/getting-started.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/getting-started.md

📝 Walkthrough

Walkthrough

Adds a CMake manifest generator and manifest print target, integrates generation into top-level CMake, adds a CI verify-manifest job that fails when regenerated manifest diverges from the committed beta manifest, and updates documentation and DEVLOG to reflect the new generated source of truth.

Changes

Manifest Generation & Drift Verification

Layer / File(s) Summary
Manifest generation module
cmake/Manifest.cmake
Defines pack mappings, cache variables for selection/output, helpers for path normalization and source collection, and the solidsyslog_generate_manifest() implementation that assembles selected packs, filtered Core/pack .c lists, deduplicated include dirs, required defines, and writes the manifest.
Build integration & printing support
CMakeLists.txt, cmake/PrintManifest.cmake
Top-level CMakeLists.txt includes Manifest and calls solidsyslog_generate_manifest() after target setup; cmake/PrintManifest.cmake validates and prints the generated manifest for the manifest custom target.
CI drift verification gate
.github/workflows/ci.yml
Adds verify-manifest job that regenerates the beta-stack manifest with a fixed pack list and fails the job if git diff detects drift; updates summary.needs to include verify-manifest.
Documentation & implementation notes
docs/getting-started.md, DEVLOG.md
Replaces the hand-authored worked-manifest section with the generated committed file docs/generated/beta-stack-manifest.txt, adds regeneration instructions and renumbering/formatting tweaks; DEVLOG documents S30.03 decisions and CI verification.

Sequence Diagram

sequenceDiagram
  participant Developer
  participant CMakeConfig as CMake Configure
  participant ManifestModule as Manifest.cmake
  participant ManifestTarget as manifest Target
  participant PrintScript as PrintManifest.cmake
  participant CIJob as verify-manifest Job
  participant Stdout

  Developer->>CMakeConfig: cmake -DSOLIDSYSLOG_MANIFEST_PACKS=...
  CMakeConfig->>ManifestModule: solidsyslog_generate_manifest()
  ManifestModule->>ManifestModule: read INTERFACE_SOURCES from targets
  ManifestModule->>ManifestModule: collect INTERFACE_INCLUDE_DIRECTORIES deduped
  ManifestModule->>ManifestModule: emit config headers + conditional defines
  ManifestModule->>ManifestModule: write solidsyslog-manifest.txt
  Developer->>ManifestTarget: cmake --build . --target manifest
  ManifestTarget->>PrintScript: -DSOLIDSYSLOG_MANIFEST_FILE=...
  PrintScript->>Stdout: read and emit manifest
  CIJob->>CMakeConfig: regenerate manifest for beta pack set
  CMakeConfig->>ManifestModule: solidsyslog_generate_manifest()
  ManifestModule->>CIJob: produces file
  CIJob->>CIJob: git diff --exit-code -> fail on drift
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 A manifest born from CMake's keen eye,
No drift shall hide when CI guards the sky!
Packs and sources listed straight and true,
Docs and build now speak as one, too —
A rabbit hops, the repo sings anew.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title correctly summarizes the main change: generating the integration manifest from CMake to prevent drift, matching the PR's primary objective (issue #569, S30.03).
Description check ✅ Passed The PR description fully covers all required sections: Purpose (links to #569 and E30 epic #566), detailed Change Description (CMake module, committed sample, docs updates, CI gating), Test Evidence (local verification), and Areas Affected. All sections are complete and substantive.
Linked Issues check ✅ Passed All coding-related requirements from #569 are met: manifest target added, generated manifest format correct, committed beta sample included, CI verification via verify-manifest job, and getting-started.md updated to consume generated output. DEVLOG updated.
Out of Scope Changes check ✅ Passed All changes are in scope for #569. CMake module additions, CI job additions, documentation updates, and committed sample manifest directly support the goal of generating manifests from CMake. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/s30-03-generate-manifest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/getting-started.md (1)

182-223: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

DNS define guidance contradicts the selected beta stack.

Line 219 says no LWIP_DNS is required, but Line 182 includes DNS in the target stack and the generated manifest referenced on Line 190 includes -DLWIP_DNS=1. This can lead integrators to a broken config.

Suggested fix
 ### 2. Defines

 ```text
 -DSOLIDSYSLOG_USER_TUNABLES_FILE="my_tunables.h"   # your tunable overrides
+-DLWIP_DNS=1                                       # required by SolidSyslog::LwipRawDnsResolver

-> No LWIP_DNS is required for this stack (numeric resolver). The header-configured
+> LWIP_DNS=1 is required for this stack because it includes the lwIP DNS resolver.
+> The header-configured

upstreams take their settings from your config headers, not from -Ds:
lwipopts.h (incl. NO_SYS, LWIP_RAW/UDP/TCP), mbedtls_config.h,
FreeRTOSConfig.h (with configSUPPORT_STATIC_ALLOCATION=1 for the mutex),
ffconf.h.

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/getting-started.md around lines 182 - 223, The docs contradict
themselves about LWIP_DNS: the beta stack includes LwipRawDnsResolver (manifest
references the pack and adds -DLWIP_DNS=1) but the text claims no LWIP_DNS is
required; update the getting-started.md guidance to require LWIP_DNS for the
numeric resolver by adding a note that -DLWIP_DNS=1 is required when using
SolidSyslog::LwipRawDnsResolver (and the generated manifest in
docs/generated/beta-stack-manifest.txt reflects this), and adjust the paragraph
that currently says “No LWIP_DNS is required” to instead state that
LWIP_DNS=1 is required for this stack so integrators enable it in their
build/tunables.


</details>

<!-- cr-comment:v1:2bd6c06fff6f2eaa02156b93 -->

</blockquote></details>

</blockquote></details>
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/getting-started.md`:
- Around line 182-223: The docs contradict themselves about LWIP_DNS: the beta
stack includes LwipRawDnsResolver (manifest references the pack and adds
-DLWIP_DNS=1) but the text claims no LWIP_DNS is required; update the
getting-started.md guidance to require LWIP_DNS for the numeric resolver by
adding a note that `-DLWIP_DNS=1` is required when using
SolidSyslog::LwipRawDnsResolver (and the generated manifest in
docs/generated/beta-stack-manifest.txt reflects this), and adjust the paragraph
that currently says “No `LWIP_DNS` is required” to instead state that
`LWIP_DNS=1` is required for this stack so integrators enable it in their
build/tunables.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 30db0f02-f063-499a-87b4-489f72b9f342

📥 Commits

Reviewing files that changed from the base of the PR and between 639ab27 and 3d068a5.

⛔ Files ignored due to path filters (1)
  • docs/generated/beta-stack-manifest.txt is excluded by !**/generated/**
📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • CMakeLists.txt
  • DEVLOG.md
  • cmake/Manifest.cmake
  • cmake/PrintManifest.cmake
  • docs/getting-started.md

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1521 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1872 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1453 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1453 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 16 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 14 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 16 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 49 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 88% successful (✔️ 46 passed, 🙈 6 skipped)
   🚦   bdd-freertos-qemu-plustcp: 87% successful (✔️ 45 passed, 🙈 7 skipped)
   🚦   bdd-freertos-qemu-lwip: 87% successful (✔️ 45 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1298 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1453 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

The beta sample stack includes SolidSyslog::LwipRawDnsResolver (the generated
manifest lists -DLWIP_DNS=1), but the Defines note still claimed no LWIP_DNS was
required — a contradiction that could lead integrators to a broken config. Align
the note with the stack and point at the generated manifest as authoritative.
(CodeRabbit, PR #572.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1521 passed)
   🚦   build-freertos-host-tdd-plustcp: 100% successful (✔️ 1872 passed)
   🚦   build-linux-clang: 100% successful (✔️ 1453 passed)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1453 passed)
   🚦   integration-linux-openssl: 100% successful (✔️ 16 passed)
   🚦   integration-linux-mbedtls: 100% successful (✔️ 14 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 16 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 49 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 88% successful (✔️ 46 passed, 🙈 6 skipped)
   🚦   bdd-freertos-qemu-plustcp: 87% successful (✔️ 45 passed, 🙈 7 skipped)
   🚦   bdd-freertos-qemu-lwip: 87% successful (✔️ 45 passed, 🙈 7 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1298 passed)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1453 passed)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens merged commit 9605afa into main Jun 11, 2026
28 checks passed
@DavidCozens DavidCozens deleted the feat/s30-03-generate-manifest branch June 11, 2026 06:57
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.

S30.03: Generate the integration manifest from CMake (anti-drift)

1 participant