-
Notifications
You must be signed in to change notification settings - Fork 546
CXX-2577 compile and test with c++20 #968
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
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9da59fe
use latest CMake
rcsanchez97 5cfdeaf
use correct output file path in case of failed example build
rcsanchez97 9f985d1
Fix CMake variable typo
rcsanchez97 7d33e75
CXX-2577 compile and test with c++20
rcsanchez97 09103de
syntax update for c++20 conformance
rcsanchez97 495318c
CXX-2577 compile and test with c++20 (RHEL9 variants)
rcsanchez97 ce477b0
don't generate verbose makefiles
rcsanchez97 825d8ff
include_expansions_in_env to make the distro_id expansion available
rcsanchez97 dc700a8
more cleanly specify C++ standard for example build
rcsanchez97 c542c8a
comment to explain the usage of SKIP_LEGACY_SHELL
rcsanchez97 68ea467
ignore maybe-uninitialized warning around a smaller section of code
rcsanchez97 e023d5b
use bash test syntax
rcsanchez97 efbbc71
remove unnecessary use of "$@"
rcsanchez97 7363796
handling of Boost dependency with newer CMake
rcsanchez97 ffefb92
expand tabs to spaces
rcsanchez97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -357,6 +357,9 @@ functions: | |
export BUILD_TYPE=${build_type} | ||
export PATH="${extra_path}:$PATH" | ||
export RUN_DISTCHECK=${RUN_DISTCHECK} | ||
# distro_id is needed by find-cmake-version.sh, but we don't | ||
# want to use add_expansions_to_env | ||
rcsanchez97 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export distro_id=${distro_id} | ||
|
||
ADDL_OPTS=${code_coverage_cmake_flags} | ||
if [ "${USE_STATIC_LIBS}" ]; then | ||
|
@@ -367,13 +370,20 @@ functions: | |
ADDL_OPTS="$ADDL_OPTS -DENABLE_TESTS=OFF" | ||
fi | ||
|
||
if [ "${REQUIRED_CXX_STANDARD}" ]; then | ||
rcsanchez97 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ADDL_OPTS="$ADDL_OPTS -DCMAKE_CXX_STANDARD=${REQUIRED_CXX_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=ON" | ||
fi | ||
|
||
MONGOC_PREFIX="$(pwd)/../mongoc" | ||
echo "MONGOC_PREFIX=$MONGOC_PREFIX" | ||
|
||
if [ "Windows_NT" == "$OS" ]; then | ||
if [[ "$OSTYPE" =~ cygwin ]]; then | ||
MONGOC_PREFIX=$(cygpath -m "$MONGOC_PREFIX") | ||
fi | ||
export CMAKE=${cmake} | ||
. "$MONGOC_PREFIX/.evergreen/scripts/find-cmake-latest.sh" | ||
declare cmake_binary | ||
export cmake_binary="$(find_cmake_latest)" | ||
command -v "$cmake_binary" | ||
|
||
if [ ! -d ../drivers-evergreen-tools ]; then | ||
git clone --depth 1 [email protected]:mongodb-labs/drivers-evergreen-tools.git ../drivers-evergreen-tools | ||
|
@@ -402,10 +412,13 @@ functions: | |
set -o errexit | ||
set -o pipefail | ||
|
||
# distro_id is needed by find-cmake-version.sh, but we don't | ||
# want to use add_expansions_to_env | ||
export distro_id=${distro_id} | ||
# Grabs the mongocryptd path | ||
pushd .. | ||
export MONGOCRYPTD_PATH=$(pwd)/ | ||
if [ "Windows_NT" == "$OS" ]; then | ||
if [[ "$OSTYPE" =~ cygwin ]]; then | ||
export MONGOCRYPTD_PATH=$(cygpath -m $MONGOCRYPTD_PATH) | ||
fi | ||
popd # .. | ||
|
@@ -453,7 +466,7 @@ functions: | |
|
||
pushd ../../drivers-evergreen-tools | ||
export DRIVERS_TOOLS=$(pwd) | ||
if [ "Windows_NT" == "$OS" ]; then | ||
if [[ "$OSTYPE" =~ cygwin ]]; then | ||
export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) | ||
fi | ||
popd # ../../drivers-evergreen-tools | ||
|
@@ -514,7 +527,7 @@ functions: | |
register_ca_cert() { | ||
local OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
echo "register_ca_cert: OS: $OS" | ||
case "$OS" in | ||
case "$OSTYPE" in | ||
cygwin*) | ||
certutil.exe -addstore "Root" "$DRIVERS_TOOLS\.evergreen\x509gen\ca.pem" | ||
;; | ||
|
@@ -559,7 +572,7 @@ functions: | |
echo "Waiting for mock KMS servers to start... done." | ||
fi | ||
|
||
if [ "Windows_NT" == "$OS" ]; then | ||
if [[ "$OSTYPE" =~ cygwin ]]; then | ||
CTEST_OUTPUT_ON_FAILURE=1 MSBuild.exe /p:Configuration=${build_type} /verbosity:minimal RUN_TESTS.vcxproj | ||
# Only run examples if MONGODB_API_VERSION is unset. We do not append | ||
# API version to example clients, so examples will fail when requireApiVersion | ||
|
@@ -660,8 +673,7 @@ functions: | |
export CC="${example_projects_cc}" | ||
export CXX="${example_projects_cxx}" | ||
export CXX_STANDARD="${example_projects_cxx_standard}" | ||
export CMAKE=${cmake} | ||
if [ "Windows_NT" == "$OS" ]; then | ||
if [[ "$OSTYPE" =~ cygwin ]]; then | ||
export MSVC=1 | ||
elif [ "$(uname -s | tr '[:upper:]' '[:lower:]')" == "darwin" ]; then | ||
export DYLD_LIBRARY_PATH="$(pwd)/build/install/lib:$DYLD_LIBRARY_PATH" | ||
|
@@ -679,7 +691,15 @@ functions: | |
# API version to example clients, so example projects will fail when requireApiVersion | ||
# is true. | ||
if [[ -z "$MONGODB_API_VERSION" ]]; then | ||
if [ "${REQUIRED_CXX_STANDARD}" ]; then | ||
ADDL_OPTS="$ADDL_OPTS -DCMAKE_CXX_STANDARD=${REQUIRED_CXX_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=ON" | ||
CXX_STANDARD=${REQUIRED_CXX_STANDARD} | ||
fi | ||
rcsanchez97 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "Building example projects..." | ||
. "$PREFIX/.evergreen/scripts/find-cmake-latest.sh" | ||
declare cmake_binary | ||
export cmake_binary="$(find_cmake_latest)" | ||
command -v "$cmake_binary" | ||
.evergreen/build_example_projects.sh | ||
echo "Building example projects... done." | ||
fi | ||
|
@@ -839,6 +859,37 @@ tasks: | |
- func: "run_kms_servers" | ||
- func: "test" | ||
|
||
- name: compile_and_test_with_shared_libs_cxx20 | ||
commands: | ||
- func: "setup" | ||
- func: "start_mongod" | ||
- func: "install_c_driver" | ||
- func: "compile" | ||
vars: | ||
RUN_DISTCHECK: 1 | ||
REQUIRED_CXX_STANDARD: 20 | ||
- func: "clone_drivers-evergreen-tools" | ||
- func: "run_kms_servers" | ||
- func: "test" | ||
vars: | ||
REQUIRED_CXX_STANDARD: 20 | ||
|
||
- name: compile_and_test_with_shared_libs_extra_alignment_cxx20 | ||
commands: | ||
- func: "setup" | ||
- func: "start_mongod" | ||
- func: "install_c_driver" | ||
vars: | ||
BSON_EXTRA_ALIGNMENT: 1 | ||
- func: "compile" | ||
vars: | ||
REQUIRED_CXX_STANDARD: 20 | ||
- func: "clone_drivers-evergreen-tools" | ||
- func: "run_kms_servers" | ||
- func: "test" | ||
vars: | ||
REQUIRED_CXX_STANDARD: 20 | ||
|
||
- name: compile_with_shared_libs | ||
commands: | ||
- func: "setup" | ||
|
@@ -1184,6 +1235,8 @@ buildvariants: | |
tasks: | ||
- name: compile_and_test_with_shared_libs | ||
- name: compile_and_test_with_shared_libs_extra_alignment | ||
- name: compile_and_test_with_shared_libs_cxx20 | ||
- 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 | ||
|
@@ -1205,6 +1258,8 @@ buildvariants: | |
tasks: | ||
- name: compile_and_test_with_shared_libs | ||
- name: compile_and_test_with_shared_libs_extra_alignment | ||
- name: compile_and_test_with_shared_libs_cxx20 | ||
- 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 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.