Repository navigation
build: harden ABI with hidden visibility and PImpl - #14
Merged
Merged
Conversation
- build the shared and static targets with hidden default symbol visibility; only LIBKEEPASS_API declarations and the kp_* C ABI are exported, and --exclude-libs,ALL hides statically linked dependency symbols on ELF - move KeePass and KdbxFile state into PImpls; copying deep-copies the state and moving leaves the source default-constructed but usable - stop exporting the internal detail::FormatCodecRegistry and add copy/move regression tests for both classes - add tools/check_symbols.sh and a Release CI gate that rejects leaked internal/third-party symbols and checks the C ABI surface - update the ABI policy, roadmap, changelog and stale documentation anchors; fix the feature-request template and roadmap tracking notes This is an intentional ABI break for the 1.0 hardening work: 0.x consumers must rebuild against the new library.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
The moved-from objects are intentionally reused by the new tests, and the move operations allocate a fresh default implementation so they cannot be noexcept. Annotate both with NOLINTNEXTLINE and the precise check names instead of changing the contract.
Reusing a pooled group whose UUID already appeared in the parsed tree made a nested group alias an ancestor, turning the object graph cyclic and recursing without bound in KdbxXml::WriteGroup. fuzz_xml found this as a stack overflow after parsing succeeded. Track the UUIDs seen while parsing the tree and reject duplicates with FormatError. Placeholders created from Meta (RecycleBinUUID, EntryTemplatesGroup) are still reused once. Add a regression test.
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.
Summary
CXX_VISIBILITY_PRESET hidden,VISIBILITY_INLINES_HIDDEN); onlyLIBKEEPASS_APIdeclarations and thekp_*C ABI are exported.--exclude-libs,ALL.KeePassandKdbxFilestate into PImpls, keepingKey,KdbxXmland option flags out of the public headers. Copying deep-copies; moving leaves the source default-constructed but usable.detail::FormatCodecRegistryand add copy/move regression tests.tools/check_symbols.shplus a Release CI gate that rejects leaked internal/third-party symbols and verifies the C ABI surface.Breaking ABI
This is an intentional ABI break for the 1.0 hardening work.
KeePass/KdbxFilelayout changed and moved-from semantics changed, so 0.x consumers must rebuild against the new library.SOVERSIONintentionally stays at0perdocs/abi-policy.md.Verification
cmake --build build -j→ exit 0ctest --test-dir build --output-on-failure→100% tests passed, 0 failed out of 21tools/check_symbols.sh build→OK(nodetail::*besidesBinarySource, no pugixml/OpenSSL/argon2/zlib symbols,kp_*present)build-static,LIBKEEPASS_BUILD_SHARED=OFF) → exit 0clang-format --dry-run --Werroron changed C++ files → exit 0git diff --check→ exit 0Follow-ups for 1.0
detail::FormatCodecimplementations and thecipher.hhalgorithm classes.