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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
cd6f3e2
Auto download the C driver if it is not already installed
kkloberdanz May 24, 2023
e199b78
pin to latest C driver
kkloberdanz May 24, 2023
2660f5a
Update CMakeLists.txt
kkloberdanz May 24, 2023
9ea5b52
Update CMakeLists.txt
kkloberdanz May 24, 2023
51d91ee
Update CMakeLists.txt
kkloberdanz May 24, 2023
599ca9d
Update CMakeLists.txt
kkloberdanz May 24, 2023
81a6b7c
Update cmake/BsoncxxUtil.cmake
kkloberdanz May 24, 2023
16b115a
Update cmake/MongocxxUtil.cmake
kkloberdanz May 24, 2023
67037d0
Update src/mongocxx/test/CMakeLists.txt
kkloberdanz May 24, 2023
d7de582
Update src/mongocxx/CMakeLists.txt
kkloberdanz May 24, 2023
086a134
Update src/mongocxx/CMakeLists.txt
kkloberdanz May 24, 2023
dce2690
dont need to call ExternalProject_Add and dont need to cache variable
kkloberdanz May 24, 2023
0654a5a
it appears this variable must be CACHE'ed
kkloberdanz May 24, 2023
fec94f4
initialize NEED_DOWNLOAD_C_DRIVER as a simple cmake variable
kkloberdanz May 25, 2023
a921a7c
Update CMakeLists.txt
kkloberdanz May 25, 2023
c28eec5
Update CMakeLists.txt
kkloberdanz May 25, 2023
f30f17c
Update CMakeLists.txt
kkloberdanz May 25, 2023
d805d46
Update CMakeLists.txt
kkloberdanz May 25, 2023
04fbff6
Update CMakeLists.txt
kkloberdanz May 25, 2023
6f7227f
don't make tests opt-in for this PR
kkloberdanz May 26, 2023
b604f40
add LIBMONGOC_DOWNLOAD_VERSION
kkloberdanz May 26, 2023
6477f54
this variable is no longer used
kkloberdanz May 26, 2023
d2f0f76
comment on why remove the C driver uninstall scripts
kkloberdanz May 26, 2023
5ec77f2
supress installation of C driver
kkloberdanz May 30, 2023
7e4bed2
remove unneeded lines
kkloberdanz May 30, 2023
138985f
update documentation to reflect new C driver installation process
kkloberdanz May 30, 2023
9a824f6
remove unused variable
kkloberdanz May 30, 2023
467a8f4
after supressing C driver installation, this is no longer needed
kkloberdanz May 30, 2023
5e4e7ab
check there are no TODOs in CMakeLists.txt when releaseing
kkloberdanz May 30, 2023
b81be04
make auto installation of C driver the default installation path
kkloberdanz May 30, 2023
d9ff175
Update etc/releasing.md
kkloberdanz Jun 1, 2023
0e82524
Document the auto download of the C driver
kkloberdanz Jun 13, 2023
f1c3d36
see if this works
kkloberdanz Jun 13, 2023
91afe7c
Revert "see if this works"
kkloberdanz Jun 13, 2023
7690df4
Merge branch 'master' into auto-download-c-driver
kkloberdanz Jun 13, 2023
39112b3
Merge branch 'master' into auto-download-c-driver
kkloberdanz Jun 13, 2023
2e9d20b
fix merge conflict
kkloberdanz Jul 24, 2023
91f7c7c
make autodownloading the C driver the default for CI
kkloberdanz Jul 24, 2023
fd66160
remove TODOs, remove duplicate definitions
kkloberdanz Jul 25, 2023
6bbe865
use the mongodb repo rather than mine
kkloberdanz Jul 25, 2023
c6e404c
add distcheck unconditionally
kkloberdanz Jul 25, 2023
16166d3
only add distcheck target if it is not yet defined
kkloberdanz Jul 25, 2023
2add8df
Update etc/releasing.md
kkloberdanz Jul 27, 2023
982030e
Update CMakeLists.txt
kkloberdanz Jul 27, 2023
24f2455
Update CMakeLists.txt
kkloberdanz Jul 27, 2023
d34fcd8
Update CMakeLists.txt
kkloberdanz Jul 27, 2023
bf68afa
Update CMakeLists.txt
kkloberdanz Jul 27, 2023
ba550a9
Update docs/content/mongocxx-v3/installation/advanced.md
kkloberdanz Jul 27, 2023
8914c8a
Update docs/content/mongocxx-v3/installation/linux.md
kkloberdanz Jul 27, 2023
e290b37
Update docs/content/mongocxx-v3/installation/macos.md
kkloberdanz Jul 27, 2023
bc9d572
Update docs/content/mongocxx-v3/installation/advanced.md
kkloberdanz Jul 27, 2023
b977253
remove paragraphs describing C deriver auto install as requested
kkloberdanz Jul 27, 2023
2f5a2aa
as suggested, remove mentions of mongo C driver
kkloberdanz Jul 27, 2023
0484da0
Update .mci.yml
kkloberdanz Jul 27, 2023
7b55221
Update docs/content/mongocxx-v3/installation/advanced.md
kkloberdanz Jul 27, 2023
4df03a8
Update CMakeLists.txt
kkloberdanz Jul 27, 2023
95c05dc
'ENABLE_UNINSTALL=OFF' no longer appears to be necessary
kkloberdanz Jul 31, 2023
403665d
install prefix no longer appears necessary
kkloberdanz Jul 31, 2023
bd3b78a
remove -Wno-error
kkloberdanz Jul 31, 2023
c831ec5
rename fetch_latest_cmake to fetch_c_driver_source
kkloberdanz Jul 31, 2023
de87767
dont remove -Werror from CMAKE_CXX_FLAGS
kkloberdanz Aug 1, 2023
3533b51
Revert "dont remove -Werror from CMAKE_CXX_FLAGS"
kkloberdanz Aug 2, 2023
ee573d2
Update .mci.yml
kkloberdanz Aug 2, 2023
e759cd9
Update .mci.yml
kkloberdanz Aug 2, 2023
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
96 changes: 73 additions & 23 deletions .mci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,18 @@ functions:
add_expansions_to_env: true
script: mongo-cxx-driver/.evergreen/install_c_driver.sh

# fetch_c_driver_source may be used to fetch the C driver source without installing the C driver.
# This can be used when only CI scripts are needed.
"fetch_c_driver_source":
- command: shell.exec
params:
shell: bash
working_dir: "."
script: |
set -o errexit
set -o pipefail
git clone --depth 1 https://github.com/mongodb/mongo-c-driver mongoc

"lint":
- command: shell.exec
params:
Expand Down Expand Up @@ -832,45 +844,49 @@ tasks:
- name: clang-tidy
commands:
- func: "setup"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
- func: "clang-tidy"

- name: compile_and_test_with_shared_libs
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
# Call "install_c_driver" before "test" to build static C driver libraries. Example projects require static C driver libraries.
- func: "install_c_driver"
- func: "test"

- name: compile_and_test_with_shared_libs_extra_alignment
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "compile"
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"

- name: compile_and_test_with_shared_libs_cxx20
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
RUN_DISTCHECK: 1
REQUIRED_CXX_STANDARD: 20
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"
vars:
REQUIRED_CXX_STANDARD: 20
Expand All @@ -880,14 +896,15 @@ tasks:
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "compile"
vars:
REQUIRED_CXX_STANDARD: 20
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"
vars:
REQUIRED_CXX_STANDARD: 20
Expand All @@ -897,13 +914,13 @@ tasks:
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"

- name: compile_without_tests
commands:
- func: "setup"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
ENABLE_TESTS: OFF
Expand All @@ -914,7 +931,7 @@ tasks:
- func: "start_mongod"
vars:
AUTH: auth
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
- func: "test auth"
- func: "test atlas connectivity"
Expand All @@ -923,13 +940,14 @@ tasks:
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
USE_STATIC_LIBS: 1
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"
vars:
USE_STATIC_LIBS: 1
Expand All @@ -938,19 +956,39 @@ tasks:
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
vars:
BSON_EXTRA_ALIGNMENT: 1
- func: "compile"
vars:
USE_STATIC_LIBS: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"
vars:
USE_STATIC_LIBS: 1

- name: compile_and_test_with_shared_libs_replica_set
commands:
- func: "setup"
- func: "start_mongod"
vars:
TOPOLOGY: "replica_set"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"

# Auto downloading the C driver in the C++ build does not currently include
# support for libmongocrypt, therefore it is not configured with
# -DENABLE_CLIENT_SIDE_ENCRYPTION=ON. For now, CSFLE tests will need to have
# a manually configured C driver, hence the need to seperate this task.
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
commands:
- func: "setup"
- func: "start_mongod"
Expand All @@ -967,7 +1005,7 @@ tasks:
- name: uninstall_check
commands:
- func: "setup"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
- command: expansions.update
params:
Expand All @@ -987,7 +1025,7 @@ tasks:
- name: uninstall_check_windows
commands:
- func: "setup"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
- command: expansions.update
params:
Expand Down Expand Up @@ -1023,7 +1061,7 @@ tasks:
export CMAKE="$(find_cmake_latest)"
cd build
$CMAKE ..
$CMAKE --build . -- -j 8
$CMAKE --build . -- -j $(nproc)
./hello_mongocxx

- name: debian-package-build
Expand Down Expand Up @@ -1098,7 +1136,7 @@ tasks:
- name: test_mongohouse
commands:
- func: "setup"
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
- func: "build_mongohouse"
- func: "run_mongohouse"
Expand All @@ -1113,7 +1151,7 @@ tasks:
# Authentication with versioned API should already be tested
# in the C driver.
AUTH: noauth
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
Expand All @@ -1128,7 +1166,7 @@ tasks:
vars:
ORCHESTRATION_FILE: versioned-api-testing.json
AUTH: noauth
- func: "install_c_driver"
- func: "fetch_c_driver_source"
- func: "compile"
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
Expand Down Expand Up @@ -1220,7 +1258,7 @@ buildvariants:
matrix_spec: {os: "ubuntu-1804", mongodb_version: "*"}
display_name: "${os} replica set (MongoDB ${mongodb_version})"
tasks:
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt

- matrix_name: "auth"
matrix_spec: {os: "*", mongodb_version: "latest"}
Expand Down Expand Up @@ -1265,7 +1303,7 @@ buildvariants:
- name: compile_and_test_with_shared_libs_extra_alignment_cxx20
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- rhel90-large
Expand All @@ -1288,7 +1326,7 @@ buildvariants:
- name: compile_and_test_with_shared_libs_extra_alignment_cxx20
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- rhel90-arm64-large
Expand All @@ -1310,7 +1348,7 @@ buildvariants:
- name: compile_and_test_with_shared_libs_extra_alignment_cxx20
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- debian11-large
Expand Down Expand Up @@ -1354,7 +1392,7 @@ buildvariants:
- name: compile_and_test_with_shared_libs_extra_alignment
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- debian10-large
Expand All @@ -1381,6 +1419,18 @@ buildvariants:
- debian10-large
- name: uninstall_check

# Add matrix for specification test requirement of mongocryptd:
# "Drivers MUST run all tests with mongocryptd on at least one platform for all tested server versions (4.2+)."
- matrix_name: "mongocryptd"
matrix_spec:
os: "ubuntu-1804"
mongodb_version: ["4.2", "4.4", "5.0", "latest"]
display_name: "${os} (MongoDB ${mongodb_version}) with mongocryptd"
tasks:
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
expansions:
use_mongocryptd: true

- name: ubuntu2004-release-latest
display_name: "Ubuntu 20.04 Release (MongoDB Latest)"
expansions:
Expand All @@ -1396,7 +1446,7 @@ buildvariants:
- name: compile_and_test_with_shared_libs_extra_alignment
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- ubuntu2004-large
Expand Down Expand Up @@ -1439,7 +1489,7 @@ buildvariants:
- name: compile_and_test_with_shared_libs_extra_alignment
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- ubuntu1804-build
Expand Down
Loading