Skip to content

fix(cmake): install every public header - #113

Merged
biobo-bot[bot] merged 1 commit into
mainfrom
fix/install-missing-headers
Nov 18, 2026
Merged

biobo-bot[bot] merged 1 commit into
mainfrom
fix/install-missing-headers

Conversation

@sentomk

@sentomk sentomk commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

The v0.9.6 package is broken when installed: four new headers are
not installed, so #include <ptn/patternia.hpp> from an installed copy
(vcpkg, cmake --install) fails with
'ptn/core/common/inline.hpp' file not found. Copilot raised this on
microsoft/vcpkg#55156. Using the source tree directly is not affected.

Changes

  • CMakeLists.txt: collect public headers with file(GLOB_RECURSE)
    instead of a hand-written list, which was missing
    index_switch.hpp, inline.hpp, owned_eval.hpp and
    plain_value.hpp. Drop the unused PTN_JOIN_HEADERS helper.
  • New CTest test install.consumer: installs the build tree into a
    scratch prefix, checks every header under include/ was installed,
    then builds and runs a consumer through find_package(patternia).

Testing

  • install.consumer fails on the old CMakeLists.txt and lists the
    four missing headers; it passes with the fix.
  • Full suite on Apple Clang: 440/440 pass.

v0.9.6 added four headers (index_switch.hpp, inline.hpp,
owned_eval.hpp, plain_value.hpp) that were missing from the
hand-written header list in CMakeLists.txt. cmake --install, and so
the vcpkg port, left them out, and including ptn/patternia.hpp from an
installed copy failed with a missing-file error.

Collect the headers with file(GLOB_RECURSE) instead of a list, and add
the install.consumer CTest test: it installs the build tree into a
scratch prefix, checks that every header under include/ was installed,
and builds and runs a consumer that uses find_package(patternia).

@biobo-bot biobo-bot 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.

Thanks, this is a clean fix for a real packaging bug. A hand-written PTN_HEADERS list falling behind new public headers is exactly why #include <ptn/patternia.hpp> broke from an installed tree (and why vcpkg noticed it) while the source tree kept working. For CMake >= 3.23 the FILE_SET install is driven by that list, so collecting include/ptn/*.hpp and *.h with file(GLOB_RECURSE ... CONFIGURE_DEPENDS) plus list(SORT) is the right replacement; dropping the no-op PTN_JOIN_HEADERS helper is fine.

The new install.consumer test is the actual safety net: it installs into a scratch prefix, checks the source include/ptn tree against what landed in the prefix, then configures, builds, and runs a find_package(patternia) consumer that #includes patternia.hpp and exercises dense val<>, is<T>(), and the owning $ path. That would have caught the four missing headers (inline.hpp, index_switch.hpp, owned_eval.hpp, plain_value.hpp). The test is gated on PTN_INSTALL and CMake >= 3.15 (cmake --install --prefix), which matches how CI configures the master project. The consumer correctly inherits cxx_std_17 from the exported interface, so it does not need its own standard setting.

A couple of non-blocking notes:

  1. In run_install_test.cmake, file(GLOB_RECURSE ... include/ptn/*) is broader than the install glob (*.hpp / *.h) and, for GLOB_RECURSE, LIST_DIRECTORIES defaults to true. That is harmless today because the tree is headers only and install creates the directories, but tightening the glob to *.hpp / *.h and setting LIST_DIRECTORIES false would keep the check aligned with what FILE_SET actually installs.
  2. cmake --install is invoked with OUTPUT_QUIET, so a failure only reports the exit code. Dropping that (or capturing ERROR_VARIABLE) would make a CI failure easier to diagnose.
  3. project(patternia VERSION 0.9.6) is unchanged. If this is meant to repair the already-released v0.9.6 package, a patch bump will still be needed for the vcpkg/release side; fine to do that separately.

Approving.

@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark comparison (informational)

Base 0513d94 vs PR 0f25b75, run one after the other on the same GitHub-hosted runner. This does not block merging.

Noise estimate: the 24 control rows below do not run Patternia code, so they should not change between base and PR. As a group they moved by a median of +0.1% (run order and machine drift); that offset is divided out of the Patternia deltas (Adjusted). The controls then scatter by a median of 0.1%. Adjusted differences under 5.0% are treated as noise.

Patternia: 10 benchmarks, 0 slower, 0 faster, 10 within noise.

Benchmark Base (ns) PR (ns) Delta Adjusted Verdict
PatterniaPipe CommandParser 1.346 1.347 +0.1% -0.0% within noise
PatterniaPipe LiteralMatch64 0.695 0.696 +0.1% +0.0% within noise
PatterniaPipe LiteralMatchRDense 0.658 0.652 -0.8% -0.9% within noise
PatterniaPipe PacketMixed 1.534 1.531 -0.2% -0.3% within noise
PatterniaPipe PacketMixedHeavyBind 1.656 1.660 +0.2% +0.1% within noise
PatterniaPipe ProtocolRouter 1.431 1.438 +0.5% +0.4% within noise
PatterniaPipe VariantAltHot 0.522 0.523 +0.2% +0.1% within noise
PatterniaPipe VariantAltHotGuarded 0.702 0.707 +0.7% +0.5% within noise
PatterniaPipe VariantMixed 0.802 0.803 +0.2% +0.1% within noise
PatterniaPipe VariantMixedGuarded 1.024 1.026 +0.2% +0.0% within noise
Control rows (not Patternia code)
Benchmark Base (ns) PR (ns) Delta
IfElse CommandParser 1.697 1.681 -0.9%
IfElse LiteralMatch64 0.695 0.696 +0.1%
IfElse LiteralMatchRDense 0.604 0.606 +0.2%
IfElse ProtocolRouter 1.728 1.728 -0.1%
Sequential VariantAltHot 0.660 0.735 +11.4%
Sequential VariantAltHotGuarded 0.587 0.588 +0.2%
Sequential VariantMixed 0.888 0.889 +0.1%
Sequential VariantMixedGuarded 1.078 1.079 +0.1%
StdVisit CommandParser 1.479 1.476 -0.2%
StdVisit ProtocolRouter 1.248 1.251 +0.2%
StdVisit VariantAltHot 0.519 0.519 -0.0%
StdVisit VariantAltHotGuarded 0.749 0.754 +0.6%
StdVisit VariantMixed 0.786 0.785 -0.2%
StdVisit VariantMixedGuarded 1.005 1.005 +0.1%
SwitchIndex VariantAltHot 0.476 0.476 +0.0%
SwitchIndex VariantAltHotGuarded 0.587 0.595 +1.2%
SwitchIndex VariantMixed 0.826 0.828 +0.3%
SwitchIndex VariantMixedGuarded 1.021 1.023 +0.2%
Switch CommandParser 1.278 1.273 -0.4%
Switch LiteralMatch64 0.695 0.696 +0.1%
Switch LiteralMatchRDense 0.657 0.634 -3.6%
Switch PacketMixed 1.202 1.206 +0.3%
Switch PacketMixedHeavyBind 1.433 1.427 -0.4%
Switch ProtocolRouter 1.635 1.638 +0.2%

Raw results and the comparison chart are attached to this workflow run as an artifact. Shared runners are noisy, so use this as a trend, not a measurement.

@biobo-bot
biobo-bot Bot merged commit 707a769 into main Nov 18, 2026
30 checks passed
@biobo-bot
biobo-bot Bot deleted the fix/install-missing-headers branch November 18, 2026 16:57
sentomk added a commit that referenced this pull request Nov 18, 2026
Problem
An installed copy of v0.9.6 does not compile: four headers added in
v0.9.6 were missing from the install, so ptn/patternia.hpp fails to
include them.

Implementation
Hotfix release carrying the install fix from #113. Bump the version to
0.9.7 in CMakeLists.txt, packaging/vcpkg/vcpkg.json and the README
FetchContent tag, add docs/changelog/v0.9.7.md, and register it in
releases.md, the mkdocs nav and the roadmap's Released table. Move
the planned result-type and lazy-expression work from v0.9.7 to
v0.9.8 in the roadmap. No performance note: generated code is
unchanged.

Tests
Full suite on Apple Clang: 440 tests pass, including the
install.consumer test from #113.
biobo-bot Bot pushed a commit that referenced this pull request Nov 18, 2026
**Summary**

Hotfix release v0.9.7. An installed copy of v0.9.6 does not compile
because four new headers were left out of the install; #113 fixed
that on `main`. This release ships the fix. Library code and generated
code are the same as in v0.9.6.

**Changes**

- Bump the version to 0.9.7 in `CMakeLists.txt`,
  `packaging/vcpkg/vcpkg.json` and the README FetchContent `GIT_TAG`.
- Add `docs/changelog/v0.9.7.md` and register it in
  `docs/changelog/releases.md`, the `mkdocs.yml` nav and the roadmap's
  Released table, and move the planned result-type and lazy-expression
  work from v0.9.7 to v0.9.8 (delivery sequence, section heading and
  the Exploring note).
- No performance note: nothing since v0.9.6 changes generated code or
  dispatch.

**Testing**

- Full suite on Apple Clang: 440 tests pass, including
  `install.consumer`, which installs the package and builds a
  consumer through `find_package(patternia)`.
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