Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lmdb cmake race condition #11959

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions barretenberg/cpp/cmake/module.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ function(barretenberg_module MODULE_NAME)
# enable msgpack downloading via dependency (solves race condition)
add_dependencies(${MODULE_NAME} msgpack-c)
add_dependencies(${MODULE_NAME}_objects msgpack-c)

# enable lmdb downloading via dependency (solves race condition)
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "wasm32")
add_dependencies(${MODULE_NAME} lmdb_repo)
add_dependencies(${MODULE_NAME}_objects lmdb_repo)
endif()
list(APPEND lib_targets ${MODULE_NAME})

set(MODULE_LINK_NAME ${MODULE_NAME})
Expand Down Expand Up @@ -156,6 +162,12 @@ function(barretenberg_module MODULE_NAME)
# enable msgpack downloading via dependency (solves race condition)
add_dependencies(${MODULE_NAME}_test_objects msgpack-c)
add_dependencies(${MODULE_NAME}_tests msgpack-c)

# enable lmdb downloading via dependency (solves race condition)
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "wasm32")
add_dependencies(${MODULE_NAME}_test_objects lmdb_repo)
add_dependencies(${MODULE_NAME}_tests lmdb_repo)
endif()
if(NOT WASM)
# If collecting coverage data, set profile
# For some reason processor affinity doesn't work, so the developer has to set it manually anyway
Expand Down Expand Up @@ -277,6 +289,12 @@ function(barretenberg_module MODULE_NAME)
# enable msgpack downloading via dependency (solves race condition)
add_dependencies(${BENCHMARK_NAME}_bench_objects msgpack-c)
add_dependencies(${BENCHMARK_NAME}_bench msgpack-c)

# enable lmdb downloading via dependency (solves race condition)
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "wasm32")
add_dependencies(${BENCHMARK_NAME}_bench_objects lmdb_repo)
add_dependencies(${BENCHMARK_NAME}_bench lmdb_repo)
endif()
add_custom_target(
run_${BENCHMARK_NAME}_bench
COMMAND ${BENCHMARK_NAME}_bench
Expand Down
Loading