Skip to content

Commit 09345bd

Browse files
committed
chore: correct stale bb-dependency comments in lmdblib/kvdb CMake
These packages were made barretenberg-free, but the lmdblib CMake header still claimed it depended on bb headers (db_stats.hpp) and that consumers link libbarretenberg.a — contradicting a later comment in the same file. The Release-default comments likewise cited a 'compile bb headers' ODR rationale that no longer applies. Correct both to the real reason: the Release default keeps lmdblib's own templated/inline headers' codegen identical between liblmdblib.a and the consumers that include them (kvdb .node, wsdb).
1 parent 3aa3849 commit 09345bd

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

native-packages/kvdb/cpp/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1414
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1515
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
1616

17-
# Match barretenberg's prebuilt archive (Release -> -O3 -DNDEBUG): bb headers compiled
18-
# here must use the same NDEBUG/opt as bb to avoid ODR-divergent inlined code.
17+
# Default to Release (-O3 -DNDEBUG) to match the prebuilt liblmdblib.a it links: the
18+
# shared lmdblib templated/inline headers must be compiled the same way in both, or
19+
# their inline codegen diverges (ODR).
1920
if(NOT CMAKE_BUILD_TYPE)
2021
set(CMAKE_BUILD_TYPE Release)
2122
endif()

native-packages/lmdblib/cpp/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# - liblmdb.a : the upstream LMDB C library (pinned to bb's commit)
77
# - liblmdblib.a : the bb::lmdblib C++ wrapper objects
88
#
9-
# It depends on barretenberg only for *headers* (serialize, common, numeric, and
10-
# crypto/merkle_tree/db_stats.hpp for the shared DBStats type). The wrapper's
11-
# unresolved bb symbols are satisfied when a consumer links libbarretenberg.a.
9+
# It is barretenberg-free: it includes no bb headers and links no bb archives. It
10+
# vendors its own msgpack-c + lmdb (commits pinned to barretenberg/cpp/cmake/*) and
11+
# defines the shared DBStats POD locally (src/lmdblib/types.hpp).
1212

1313
cmake_minimum_required(VERSION 3.24)
1414
# C is enabled so CMAKE_C_COMPILER is populated for lmdb's ExternalProject build.
@@ -19,8 +19,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1919
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2020
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
2121

22-
# Match barretenberg's prebuilt archive (Release -> -O3 -DNDEBUG): bb headers compiled
23-
# here must use the same NDEBUG/opt as bb to avoid ODR-divergent inlined code.
22+
# Default to Release (-O3 -DNDEBUG). lmdblib's templated/inline headers (serialise_key,
23+
# value_cmp, the msgpack adaptors) are compiled into both liblmdblib.a and into every
24+
# consumer that includes them (the kvdb .node, the wsdb service). Matching the consumers'
25+
# Release build keeps that inline codegen identical and avoids ODR divergence.
2426
if(NOT CMAKE_BUILD_TYPE)
2527
set(CMAKE_BUILD_TYPE Release)
2628
endif()

0 commit comments

Comments
 (0)