Do not compile with system libmongoc during integration tests #1308
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.
Addresses recent Evergreen flaky test failures on MacOS distros due to unexpectedly compiling with a system-installed libmongoc (CMake reports version 1.29.1 despite
MONGOC_DOWNLOAD_VERSION
being 1.29.0). This leads to the libbson library having aBSON_EXTRA_ALIGN
that is inconsistent with test expectations. Filed DEVPROD-13793.This PR sets
CMAKE_DISABLE_FIND_PACKAGE_<PackageName>=ON
when a preinstalled C Driver is not detected (the presence of thebson-config.h
header, as used by the extra alignment consistency checks). This forces CMake to "fail" to find an existing C Driver, thus ensuring it fetch-and-builds the C Driver as expected by integration tests.