Skip to content

CXX-2517 Use C Driver scripts to install libmongoc and libmongocrypt #950

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 7 commits into from
Apr 6, 2023

Conversation

eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Apr 5, 2023

Description

This PR unblocks CXX-2517 and other CXX Driver work that depend on libmongocrypt 1.7.0. Verified by this patch.

Minimum C Driver Version

The minimum C Driver version was bumped to the current latest commit (mongodb/mongo-c-driver@9ef1cc9) in anticipation of upcoming CXX-2517 work. The minimum C Driver version should eventually be updated to be 1.24.0 once it is released (documented as a TODO comment).

EVG Config

The add_expansions_to_env parameter is used to simplify the install_c_driver EVG function by removing redundant (re)definitions of EVG expansions as environment variables. The EVG function can now invoke the script directly without additional setup required.

Building libmongocrypt and libmongoc

The install_c_driver.sh script was refactored to use the new C Driver compile-libmongocrypt.sh script (introduced in mongodb/mongo-c-driver@c7e43c1) to satisfy the libmongocrypt dependency. This allowed deferring the libbson and libmongocrypt compile-and-install routine to compile-libmongocrypt.sh.

This also allowed removal of specifying minimum libmongocrypt version in the CXX Driver. Instead, the CXX Driver now transitively depends on the C Driver's minimum libmongocrypt version as defined within compile-libmongocrypt.sh. This required slightly modifying the install_c_driver.sh script to generate a VERSION_CURRENT file that is required when building libbson via libmongocrypt to specify/determine the BUILD_VERSION.

This refactor also uses the C Driver's find-cmake-latest.sh script to obtain a newer CMake version to satisfy libmongocrypt's CMake 3.12 requirement. This also allows the CXX Driver to use newer versions of C++ and corresponding compilers (i.e. VS 2019 and newer).

@eramongodb eramongodb self-assigned this Apr 5, 2023
@kevinAlbs kevinAlbs requested a review from kkloberdanz April 5, 2023 15:29
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM with minor comments. The removal of the extra compile of libbson is much appreciated.

-DENABLE_EXTRA_ALIGNMENT=${ENABLE_EXTRA_ALIGNMENT} -DCMAKE_MACOSX_RPATH=ON
-DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_PREFIX_PATH=$PREFIX"
: "${mongoc_idir:?}"
: "${mongoc_install_idir}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Assuming the intent is to error if this is unset.

Suggested change
: "${mongoc_install_idir}"
: "${mongoc_install_idir:?}"

: "${mongoc_install_idir}"

echo "libmongoc version: ${mongoc_version}"
echo "libmongocrypt version: ${mongocrypt_version}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
echo "libmongocrypt version: ${mongocrypt_version}"

mongocrypt_version is no longer expected.

Copy link
Contributor

@rcsanchez97 rcsanchez97 left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for figuring out the Windows paths and a newer CMake.

@eramongodb eramongodb merged commit 6a49989 into mongodb:master Apr 6, 2023
@eramongodb eramongodb deleted the cxx-2517 branch April 6, 2023 14:11
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