Skip to content

Auto download C Driver #967

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

Merged
merged 64 commits into from
Aug 3, 2023

Conversation

kkloberdanz
Copy link
Contributor

@kkloberdanz kkloberdanz commented May 18, 2023

CXX-2695

  • Auto download the C driver if it is not already installed.
  • Make auto downloading the C driver the default for CI.
  • Libmongocrypt is not yet supported for auto downloading, so use the classic method of installing the C driver separately for tasks that require libmongocrypt.

@kkloberdanz kkloberdanz force-pushed the auto-download-c-driver branch from 7d222a9 to cd6f3e2 Compare May 24, 2023 14:32
@kkloberdanz kkloberdanz marked this pull request as ready for review May 24, 2023 17:09
Copy link
Collaborator

Choose a reason for hiding this comment

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

I expect the automatic C driver install may be the default process for new users installing the C++ driver from source.

I suggest:

  • Update most tasks in Evergreen to remove the install_c_driver function and instead rely on the Auto download C Driver feature. That may provide more test coverage over the default process.
  • Add one task that uses install_c_driver to test building with a separate C driver install.

@@ -69,7 +66,6 @@ else()
find_package(libmongoc-${LIBMONGOC_REQUIRED_ABI_VERSION} ${LIBMONGOC_REQUIRED_VERSION} REQUIRED)
message ("found libmongoc version ${MONGOC_VERSION}")
set(libmongoc_target ${MONGOC_LIBRARIES})
set(libmongoc_include_directories ${MONGOC_INCLUDE_DIRS})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is libmongoc_include_directories not needed? libmongoc_include_directories is referenced in MongocxxUtil.cmake.

Copy link
Contributor Author

@kkloberdanz kkloberdanz May 25, 2023

Choose a reason for hiding this comment

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

This was removed by the following suggestion. @vector-of-bool would you please be able to chime in on the reason for requesting this change?
image

Copy link
Contributor

Choose a reason for hiding this comment

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

If you link to the libmongoc imported targets, the headers search paths for libmongoc will be propagated into users automatically.

CMakeLists.txt Outdated
)

if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_C_FLAGS -Wno-error)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that you will get a better result by doing something like this:

# Disable all warnings for compiling the C driver
target_compile_options (mongo::mongoc_shared PRIVATE -w)
target_compile_options (mongo::mongoc_static PRIVATE -w)

This would go after the add_subdirectory call and would replace all of the flag manipulation you have here.

For reference, this idea is based on what we do with zlib, in src/libmongoc/CMakeLists.txt:L78-79.

kkloberdanz and others added 2 commits August 2, 2023 15:05
Co-authored-by: Kevin Albertson <[email protected]>
Co-authored-by: Kevin Albertson <[email protected]>
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.

4 participants