diff --git a/.evergreen/abi-stability-setup.sh b/.evergreen/abi-stability-setup.sh index 54d4518d23..1086f683e6 100755 --- a/.evergreen/abi-stability-setup.sh +++ b/.evergreen/abi-stability-setup.sh @@ -26,6 +26,13 @@ declare cmake_binary cmake_binary="$(find_cmake_latest)" command -V "${cmake_binary:?}" +# Use ccache if available. +if [[ -f "./mongoc/.evergreen/scripts/find-ccache.sh" ]]; then + # shellcheck source=/dev/null + . "./mongoc/.evergreen/scripts/find-ccache.sh" + find_ccache_and_export_vars "$(pwd)" || true +fi + # To use a different base commit, replace `--abbrev 0` with the intended commit. # Note: EVG treat all changes relative to the EVG base commit as staged changes! declare base current @@ -55,17 +62,6 @@ else CMAKE_BUILD_PARALLEL_LEVEL="${parallel_level:?}" fi -# Use ccache if available. -if command -V ccache 2>/dev/null; then - export CMAKE_C_COMPILER_LAUNCHER=ccache - export CMAKE_CXX_COMPILER_LAUNCHER=ccache - - # Allow reuse of ccache compilation results between different build directories. - export CCACHE_BASEDIR CCACHE_NOHASHDIR - CCACHE_BASEDIR="$(pwd)/mongo-cxx-driver" - CCACHE_NOHASHDIR=1 -fi - # Install prefix to use for ABI compatibility scripts. mkdir -p "${working_dir}/install" diff --git a/.evergreen/compile.sh b/.evergreen/compile.sh index ef1d3e685e..f02e65ef97 100755 --- a/.evergreen/compile.sh +++ b/.evergreen/compile.sh @@ -66,17 +66,10 @@ CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)" export CMAKE_BUILD_PARALLEL_LEVEL # Use ccache if available. -if command -V ccache 2>/dev/null; then - export CMAKE_CXX_COMPILER_LAUNCHER=ccache - - # Allow reuse of ccache compilation results between different build directories. - export CCACHE_BASEDIR CCACHE_NOHASHDIR - if [[ "${OSTYPE:?}" == "cygwin" ]]; then - CCACHE_BASEDIR="$(cygpath -aw "$(pwd)")" - else - CCACHE_BASEDIR="$(pwd)" - fi - CCACHE_NOHASHDIR=1 +if [[ -f "${mongoc_prefix:?}/.evergreen/scripts/find-ccache.sh" ]]; then + # shellcheck source=/dev/null + . "${mongoc_prefix:?}/.evergreen/scripts/find-ccache.sh" + find_ccache_and_export_vars "$(pwd)" || true fi cmake_build_opts=() diff --git a/.evergreen/install_c_driver.sh b/.evergreen/install_c_driver.sh index 3f3eba3cf5..5afda21337 100755 --- a/.evergreen/install_c_driver.sh +++ b/.evergreen/install_c_driver.sh @@ -131,14 +131,10 @@ else fi # Use ccache if available. -if command -V ccache 2>/dev/null; then - export CMAKE_C_COMPILER_LAUNCHER=ccache - export CMAKE_CXX_COMPILER_LAUNCHER=ccache - - # Allow reuse of ccache compilation results between different build directories. - export CCACHE_BASEDIR CCACHE_NOHASHDIR - CCACHE_BASEDIR="${mongoc_idir}" - CCACHE_NOHASHDIR=1 +if [[ -f "${mongoc_dir:?}/.evergreen/scripts/find-ccache.sh" ]]; then + # shellcheck source=/dev/null + . "${mongoc_dir:?}/.evergreen/scripts/find-ccache.sh" + find_ccache_and_export_vars "$(pwd)" || true fi # Install libmongoc. diff --git a/.evergreen/test.sh b/.evergreen/test.sh index e5e40b524f..8b7ef77ffe 100755 --- a/.evergreen/test.sh +++ b/.evergreen/test.sh @@ -106,6 +106,9 @@ export MONGOCXX_TEST_TLS_CA_FILE="${DRIVERS_TOOLS:?}/.evergreen/x509gen/ca.pem" if [ "$(uname -m)" == "ppc64le" ]; then echo "Skipping CSFLE test setup (CDRIVER-4246/CXX-2423)" +elif [[ "${distro_id:?}" =~ windows-64-vs2015-* ]]; then + # Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found. + echo "Skipping CSFLE test setup (CXX-2628)" else # export environment variables for encryption tests set +o errexit @@ -202,7 +205,7 @@ else for _ in $(seq 60); do # Exit code 7: "Failed to connect to host". if - curl -s "localhost:${port:?}" + curl -s -m 1 "localhost:${port:?}" (($? != 7)) then return 0 diff --git a/.mci.yml b/.mci.yml index 49557bfbaf..370d049d8d 100644 --- a/.mci.yml +++ b/.mci.yml @@ -215,7 +215,7 @@ functions: wait_for_mongohouse() { for _ in $(seq 300); do # Exit code 7: "Failed to connect to host". - if curl -s localhost:$1; (("$?" != 7)); then + if curl -s -m 1 localhost:$1; (("$?" != 7)); then return 0 else sleep 1 @@ -419,23 +419,17 @@ functions: script: |- set -o errexit echo "Preparing CSFLE venv environment..." + if [[ "${distro_id}" =~ windows-64-vs2015-* ]]; then + # Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found. + echo "Preparing CSFLE venv environment... skipped." + exit 0 + fi cd ./drivers-evergreen-tools/.evergreen/csfle # This function ensures future invocations of activate-kmstlsvenv.sh conducted in # parallel do not race to setup a venv environment; it has already been prepared. # This primarily addresses the situation where the "test" and "run_kms_servers" # functions invoke 'activate-kmstlsvenv.sh' simultaneously. - if [[ "$OSTYPE" =~ cygwin && ! -d kmstlsvenv ]]; then - # Avoid using Python 3.10 on Windows due to incompatible cipher suites. - # See CXX-2628. - . ../venv-utils.sh - venvcreate "C:/python/Python39/python.exe" kmstlsvenv || # windows-2017 - venvcreate "C:/python/Python38/python.exe" kmstlsvenv # windows-2015 - python -m pip install --upgrade boto3~=1.19 pykmip~=0.10.0 "sqlalchemy<2.0.0" - deactivate - else - . ./activate-kmstlsvenv.sh - deactivate - fi + . ./activate-kmstlsvenv.sh && deactivate echo "Preparing CSFLE venv environment... done." - command: shell.exec params: @@ -444,6 +438,11 @@ functions: script: |- set -o errexit echo "Starting mock KMS servers..." + if [[ "${distro_id}" =~ windows-64-vs2015-* ]]; then + # Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found. + echo "Starting mock KMS servers... skipped." + exit 0 + fi cd ./drivers-evergreen-tools/.evergreen/csfle . ./activate-kmstlsvenv.sh python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8999 & @@ -1044,19 +1043,8 @@ tasks: export cmake_binary cmake_binary="$(find_cmake_latest)" # Use ccache if available. - if command -V ccache 2>/dev/null; then - export CMAKE_C_COMPILER_LAUNCHER=ccache - export CMAKE_CXX_COMPILER_LAUNCHER=ccache - - # Allow reuse of ccache compilation results between different build directories. - export CCACHE_BASEDIR CCACHE_NOHASHDIR - if [[ "${OSTYPE:?}" == "cygwin" ]]; then - CCACHE_BASEDIR="$(cygpath -aw "$(pwd)")" - else - CCACHE_BASEDIR="$(pwd)" - fi - CCACHE_NOHASHDIR=1 - fi + . ./mongo-c-driver/.evergreen/scripts/find-ccache.sh + find_ccache_and_export_vars "$(pwd)" || true command -v "$cmake_binary" "$cmake_binary" -S . -B build -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF "$cmake_binary" --build build