Skip to content

[ddtdanilo-lmdb-wrapper] Add new port - #50323

Merged
vicroms merged 3 commits into
microsoft:masterfrom
ddtdanilo:add-lmdb-wrapper
Mar 12, 2026
Merged

[ddtdanilo-lmdb-wrapper] Add new port#50323
vicroms merged 3 commits into
microsoft:masterfrom
ddtdanilo:add-lmdb-wrapper

Conversation

@ddtdanilo

@ddtdanilo ddtdanilo commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Add new port ddtdanilo-lmdb-wrapper version 1.0.1.

ddtdanilo-lmdb-wrapper is a MISRA C compliant wrapper for LMDB (Lightning Memory-Mapped Database). It provides a safe, validated API layer over LMDB with:

  • Full parameter validation on every function call (null checks, invalid value checks)
  • Explicit error codes for all failure modes
  • All return values validated (no unchecked calls)
  • Read API copies values into caller-owned buffers (no dangling pointers)
  • Single return point per function
  • C99, no goto, no dynamic allocation without validation

Use Cases

LMDB is used in production by major projects (Monero, OpenLDAP, Postfix, Caffe). This wrapper adds the MISRA C safety layer required for regulated environments:

  • Blockchain & cryptocurrency — zero-copy reads and lock-free concurrent readers make LMDB ideal for distributed ledger systems
  • Automotive (AUTOSAR, ISO 26262) — functional safety requires MISRA C compliance
  • Medical devices (IEC 62304) — regulatory compliance demands validated, traceable code
  • Industrial control (IEC 61508) — safety instrumented systems require defensive programming
  • Aerospace (DO-178C) — airborne software requires strict coding standards
  • IoT & firmware — persistent config and state on constrained devices; LMDB's ~30KB footprint fits embedded targets

Details

Checklist

  • Port builds successfully
  • License installed via vcpkg_install_copyright
  • versions/baseline.json updated
  • versions/d-/ddtdanilo-lmdb-wrapper.json created with correct git-tree hash (single entry)
  • Tests and examples disabled in vcpkg build (-DLMDB_WRAPPER_BUILD_TESTS=OFF -DLMDB_WRAPPER_BUILD_EXAMPLES=OFF)
  • Port renamed to ddtdanilo-lmdb-wrapper per reviewer request

@ddtdanilo

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@ddtdanilo
ddtdanilo force-pushed the add-lmdb-wrapper branch 3 times, most recently from c9e7433 to 4ed6920 Compare March 6, 2026 04:13
@ddtdanilo

Copy link
Copy Markdown
Contributor Author

Updated to v1.0.1. Changes from 1.0.0:

  • Redesigned lmdbWrapperGet API: the function now copies values into a caller-provided buffer (void *valBuf, size_t valCapacity) instead of returning a pointer to LMDB's internal memory-mapped data. This eliminates dangling pointer risks and gives callers clear ownership of the data.
  • Added LMDB_WRAPPER_ERR_BUFFER_TOO_SMALL error code for when the caller buffer is insufficient (the required size is still returned via valSizeOut).
  • Supports size-only queries by passing valBuf=NULL, valCapacity=0.
  • Added cppcheck static analysis step to CI.
  • Added AGENTS.md for Codex compatibility.

All existing platforms passed on v1.0.0; waiting for v1.0.1 CI results now.

Comment thread versions/l-/lmdb-wrapper.json Outdated

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.

Since this is a new port, the version file should only contain one entry

Comment thread ports/lmdb-wrapper/vcpkg.json Outdated
@@ -0,0 +1,19 @@
{
"name": "lmdb-wrapper",

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.

Googling this project surfaces a different project.

Image

To disambiguate this port from other projects, I ask we change the name to ddtdanilo-lmdb-wrapper

See our naming policy

@JavierMatosD JavierMatosD added the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Mar 6, 2026
@JavierMatosD
JavierMatosD marked this pull request as draft March 6, 2026 16:22
@ddtdanilo ddtdanilo changed the title [lmdb-wrapper] Add new port [ddtdanilo-lmdb-wrapper] Add new port Mar 7, 2026
@ddtdanilo

Copy link
Copy Markdown
Contributor Author

Thanks for the review @JavierMatosD! Done:

  • Renamed port to ddtdanilo-lmdb-wrapper
  • Version file (versions/d-/ddtdanilo-lmdb-wrapper.json) now has a single entry
  • Removed old versions/l-/lmdb-wrapper.json
  • Updated baseline.json accordingly

@ddtdanilo
ddtdanilo marked this pull request as ready for review March 10, 2026 04:45
@vicroms
vicroms merged commit efa4634 into microsoft:master Mar 12, 2026
16 checks passed
ddtdanilo added a commit to ddtdanilo/LMDB-wrapper-MISRA-C that referenced this pull request Mar 31, 2026
Reflect that ddtdanilo-lmdb-wrapper is now an official vcpkg port
(microsoft/vcpkg#50323). Sync vcpkg-port/ reference files with the
merged upstream version, add vcpkg install instructions across
README, llms.txt, llms-full.txt, and docs/context.md, and document
the release process in CONTRIBUTING.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants