Skip to content

Conversation

@kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Aug 24, 2023

Summary

  • Move bson-dsl.h to src/common.
  • Do not define mongo::detail::c_platform if using system libbson.
  • Add regression test to ensure libmongoc can build with system install of libbson.

Background & Motivation

This PR resolves two observed issues when building libmongoc using a system install of libbson.

On the r1.24 branch, a compile error referenced in CDRIVER-4673 occurs: fatal error: 'bson/bson-dsl.h' file not found. bson-dsl.h is not installed with libbson, but bson-dsl.h is needed to compile libmongoc. 16d6237 moves bson-dsl.h to src/common. This is applied to r1.24 in #1388

On master, there is an additional error reported in cmake. Running ./.evergreen/scripts/install-libmongoc-after-libbson.sh results in:

-- Searching for libbson CMake packages
CMake Error at install-dir/lib/cmake/bson-1.0/bson-targets.cmake:42 (message):
  Some (but not all) targets in this export set were already defined.

  Targets Defined: mongo::detail::c_platform

  Targets not yet defined: mongo::bson_shared, mongo::bson_static

Call Stack (most recent call first):
  install-dir/lib/cmake/bson-1.0/bson-1.0-config.cmake:4 (include)
  CMakeLists.txt:329 (find_package)

8883017 will not define c_platform if using a system libbson install to fix this error.

bson-dsl.h is not installed, but shared between libmongoc and libbson.
Intended to resolve CDRIVER-4673.
@kevinAlbs kevinAlbs marked this pull request as ready for review August 24, 2023 19:23
Copy link
Contributor

@vector-of-bool vector-of-bool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kevinAlbs kevinAlbs merged commit d7b204a into mongodb:master Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants