Wrap the library in the ABI-versioning inline namespace - #360
Merged
Conversation
Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-fable-5
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🤖 Augment PR SummarySummary: This PR introduces ABI versioning for libfn by wrapping all public APIs in Changes:
Technical Notes: Consumers should continue using 🤖 Was this summary useful? React with 👍 or 👎 |
Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-fable-5
Member
Author
|
augment review |
Assisted-by: Claude:claude-fable-5
Member
Author
|
augment review |
Assisted-by: Claude:claude-fable-5
Member
Author
|
augment review |
|
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.



Resolves #352.
Everything in
fnandpfnnow lives ininline namespace LIBFN_VERSION— spelledv0_0_9today, staged tov0_1at the 0.1.0 tag — so different library lines fail loud at link time instead of silently ODR-colliding. Three commits:Stop the
FWDandDEDUCED_RETURNmacros leaking fromfnheaders. The standalone macro headers are folded into a guard-less bracketing pairfn/detail/macro_begin.hpp/macro_end.hpp(push_macro/define on entry, undef/pop_macro on exit — nesting-safe, and a user's own prior definition survives). Every per-header sentinel TU now#errors ifFWD,DEDUCED_RETURNorASSERTsurvives an include: the only macros a libfn header leaves behind are its include guard andLIBFN_VERSION. Tests that relied on the leak include the pair explicitly; the examples define their own one-lineFWD, the idiom a user would write.Add
include/libfn_version.hpp, synced fromVERSION. A new root header — below bothfnandpfn, the only header either may reach outside its own tree — definingLIBFN_VERSIONper branch (v0_0_9, orv0_0_9_cxx26under the user-definedLIBFN_CXX26, reserved for the C++26std::type_ordermode). Never hand-edited:scripts/sync_versions.pyderives both spellings fromVERSION(now 0.0.9) exactly as it mirrors the packaging literals —v0_<y>once a 0.y line is tagged,v0_0_<z>on the 0.0 line, a SemVer prerelease appended (-dev→_dev),_cxx26last. Packaging: exported CMake targetlibfn::version(FILE_SET, same EXPORT; carried by both libraries), Bazel:version; conan and nix pick the header up through their existing recursive copies.Wrap
fnandpfnin the inline namespace. All 35 namespace openings (the sixfn/detailnested forms asnamespace fn::inline LIBFN_VERSION::detail), each wrapped header self-containedly including<libfn_version.hpp>. A new pre-commit hook (scripts/check_namespace_wrap.py) refuses any unwrapped opening — a missed wrap compiles green while its entities silently escape the versioned ABI namespace, so the invariant is enforced textually.tests/fn/libfn_version.cpppinsfn::LIBFN_VERSION::… ≡ fn::…version-agnostically via the macro.Empirical findings worth reviewing:
std::type_orderwill reflect — and the uniform insertion cannot flip any relative ordering, so copack canonical order is unchanged. Pinned per-compiler intests/fn/detail/meta.cpp, version-agnostic via a stringized macro.fn::…references indocs/keep resolving;cmake/Docs.cmakeadditionally expandsLIBFN_VERSIONto the real spelling, parsed from the header. The docs CI job is the authority for the container's doxygen.On the issue's open points:
pfnreceives the same treatment (one shared version header, one ABI story); docs are handled as above; the abigo baseline needs nothing here — the wrapped tree at the 0.1.0 tag becomes the baseline the 0.1 line's z-bumps classify against. TheLIBFN_CXX26wiring (CMakeVALIDATE_CXX26, gcc-16 workflow lane,meta.hppstd::type_order) is deliberately deferred; its spelling is already reserved.🤖 Generated with Claude Code
https://claude.ai/code/session_0198ikYYxtCqwNG54SS1b249