diff --git a/.evergreen/generated_configs/legacy-config.yml b/.evergreen/generated_configs/legacy-config.yml index 4ed6cb81a9..8a02511ae8 100644 --- a/.evergreen/generated_configs/legacy-config.yml +++ b/.evergreen/generated_configs/legacy-config.yml @@ -139,6 +139,7 @@ functions: set -o errexit # Build libmongoc with CMake and compile a program that links # dynamically to it, using variables from pkg-config.exe. + "PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC cmd.exe /c .\\.evergreen\\scripts\\link-sample-program-mingw.cmd link sample program MSVC bson: - command: shell.exec @@ -165,6 +166,7 @@ functions: set -o errexit # Build libmongoc with CMake and compile a program that links # dynamically to it, using variables from pkg-config.exe. + "PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC cmd.exe /c .\\.evergreen\\scripts\\link-sample-program-mingw-bson.cmd update codecov.io: - command: shell.exec diff --git a/.evergreen/legacy_config_generator/evergreen_config_lib/functions.py b/.evergreen/legacy_config_generator/evergreen_config_lib/functions.py index f0fcedc743..060c2bfc4c 100644 --- a/.evergreen/legacy_config_generator/evergreen_config_lib/functions.py +++ b/.evergreen/legacy_config_generator/evergreen_config_lib/functions.py @@ -157,6 +157,7 @@ r""" # Build libmongoc with CMake and compile a program that links # dynamically to it, using variables from pkg-config.exe. + "PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC cmd.exe /c .\\.evergreen\\scripts\\link-sample-program-mingw.cmd """, ) @@ -185,6 +186,7 @@ r""" # Build libmongoc with CMake and compile a program that links # dynamically to it, using variables from pkg-config.exe. + "PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC cmd.exe /c .\\.evergreen\\scripts\\link-sample-program-mingw-bson.cmd """, ) diff --git a/.evergreen/scripts/compile-windows.sh b/.evergreen/scripts/compile-windows.sh index 4b581916bf..8cd398e5a1 100755 --- a/.evergreen/scripts/compile-windows.sh +++ b/.evergreen/scripts/compile-windows.sh @@ -84,21 +84,19 @@ build_dir="cmake-build" find_ccache_and_export_vars "$(pwd)" || true if [[ "${CC}" =~ 'gcc' ]]; then + PATH="/cygdrive/c/ProgramData/chocolatey/lib/winlibs/tools/mingw64/bin:${PATH:-}" # mingw-w64 GCC + export CMAKE_GENERATOR="Ninja" # MinGW has trouble compiling src/cpp-check.cpp without some assistance. configure_flags_append "-DCMAKE_CXX_STANDARD=11" - cmake \ - -S . \ - -B "${build_dir:?}" \ - -G "Ninja" \ - "${configure_flags[@]}" \ - "${extra_configure_flags[@]}" + # mingw-w64 doesn't like lld (hangs indefinitely?). + configure_flags_append "-DMONGO_USE_LLD=OFF" + + cmake "${configure_flags[@]}" "${extra_configure_flags[@]}" -B "${build_dir:?}" - cmake --build "${build_dir:?}" - cmake --build "${build_dir:?}" --target mongo_c_driver_tests - cmake --build "${build_dir:?}" --target mongo_c_driver_examples + cmake --build "${build_dir:?}" --target all mongo_c_driver_tests mongo_c_driver_examples else # MSBuild task-based parallelism (VS 2019 16.3 and newer). export UseMultiToolTask=true diff --git a/.evergreen/scripts/link-sample-program-mingw-bson.cmd b/.evergreen/scripts/link-sample-program-mingw-bson.cmd index 43648927e6..5f4cc347e6 100755 --- a/.evergreen/scripts/link-sample-program-mingw-bson.cmd +++ b/.evergreen/scripts/link-sample-program-mingw-bson.cmd @@ -25,7 +25,7 @@ set version=1.31.0 cd %BUILD_DIR% || goto :error rem Build libmongoc, with flags that the downstream R driver mongolite uses -uvx cmake -G "Ninja" DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_C_FLAGS="-pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake -DENABLE_STATIC=ON .. || goto :error +uvx cmake -G "Ninja" -DMONGO_USE_LLD=OFF -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_C_FLAGS="-pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake -DENABLE_STATIC=ON .. || goto :error uvx cmake --build . --parallel || goto :error uvx cmake --build . --target install || goto :error diff --git a/.evergreen/scripts/link-sample-program-mingw.cmd b/.evergreen/scripts/link-sample-program-mingw.cmd index 57857b2e09..78c671c995 100755 --- a/.evergreen/scripts/link-sample-program-mingw.cmd +++ b/.evergreen/scripts/link-sample-program-mingw.cmd @@ -25,7 +25,7 @@ set major=1 cd %BUILD_DIR% || goto :error rem Build libmongoc, with flags that the downstream R driver mongolite uses -uvx cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_C_FLAGS="-pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake %CMAKE_FLAGS% .. || goto :error +uvx cmake -G "Ninja" -DMONGO_USE_LLD=OFF -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_C_FLAGS="-pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake %CMAKE_FLAGS% .. || goto :error uvx cmake --build . --parallel || goto :error uvx cmake --build . --target install || goto :error