Skip to content

Commit f63fbaa

Browse files
committed
CDRIVER-959 MinGW-W64 config for Evergreen
1 parent 670366c commit f63fbaa

File tree

7 files changed

+66
-5
lines changed

7 files changed

+66
-5
lines changed

.evergreen/compile-windows-mingw.bat

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
rem Ensure Cygwin executables like sh.exe are not in PATH
2+
set PATH=C:\Windows\system32;C:\Windows;C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin;C:\mongo-c-driver\bin
3+
4+
echo CONFIGURE_FLAGS %CONFIGURE_FLAGS%
5+
6+
set CMAKE=C:\cmake\bin\cmake
7+
set CMAKE_MAKE_PROGRAM=C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin\mingw32-make.exe
8+
set CC=C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin\gcc.exe
9+
10+
cd src\libbson
11+
%CMAKE% -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver %CONFIGURE_FLAGS%
12+
13+
%CMAKE_MAKE_PROGRAM%
14+
%CMAKE_MAKE_PROGRAM% install
15+
16+
cd ..\..
17+
%CMAKE% -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DBSON_ROOT_DIR=C:\mongo-c-driver -DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver %CONFIGURE_FLAGS%
18+
19+
%CMAKE_MAKE_PROGRAM%
20+
%CMAKE_MAKE_PROGRAM% install
21+
22+
set MONGOC_TEST_SKIP_LIVE=on
23+
test-libmongoc.exe --no-fork -d -F test-results.json

.evergreen/compile-windows.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ case "$SSL" in
5353
esac
5454
esac
5555

56-
# Resolve the compiler name to correct MSBuild location
56+
export CONFIGURE_FLAGS
57+
5758
case "$CC" in
59+
mingw*)
60+
git submodule update --init
61+
cmd.exe /c .evergreen\\compile-windows-mingw.bat
62+
exit 0
63+
;;
64+
# Resolve the compiler name to correct MSBuild location
5865
"Visual Studio 10 2010")
5966
BUILD="/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe"
6067
;;

.evergreen/compile.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
set -o xtrace # Write all commands first to stderr
33
set -o errexit # Exit the script with error if any of the commands fail
44

5-
65
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
76

87
case "$OS" in
@@ -18,4 +17,3 @@ case "$OS" in
1817
fi
1918
;;
2019
esac
21-

.evergreen/config.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ functions:
232232
working_dir: "mongoc"
233233
script: |
234234
set -o errexit
235-
AUTH=${AUTH} SSL=${SSL} URI=${URI} sh .evergreen/run-tests.sh
235+
CC="${CC}" AUTH=${AUTH} SSL=${SSL} URI=${URI} sh .evergreen/run-tests.sh
236236
237237
"run auth tests":
238238
- command: shell.exec
@@ -6411,6 +6411,16 @@ buildvariants:
64116411
- ".2.6 .nossl .nosasl"
64126412
# There is no 2.4 build for Windows
64136413

6414+
- name: mingw
6415+
display_name: "MinGW-W64"
6416+
expansions:
6417+
CC: "mingw"
6418+
run_on:
6419+
- windows-64-vs2013-compile
6420+
tasks:
6421+
- ".debug-compile .nossl .nosasl"
6422+
- ".latest .nossl .nosasl .server"
6423+
64146424
- name: power8-rhel71
64156425
display_name: "*Power8 (ppc64le) (RHEL 7.1)"
64166426
expansions:

.evergreen/integration-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ case "$OS" in
6161
echo "{ \"releases\": { \"default\": \"c:\\\\mongodb\\\\bin\" }}" > orchestration.config
6262

6363
# Crazy python stuff to make sure MO is running latest version
64-
python -m virtualenv venv
64+
python.exe -m virtualenv venv
6565
cd venv
6666
. Scripts/activate
6767
git clone https://github.com/10gen/mongo-orchestration.git

.evergreen/run-tests-mingw.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set PATH=C:\Windows\system32;C:\Windows;C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin;C:\mongo-c-driver\bin
2+
3+
rem "make install" would work, except we run tests on different Evergreen hosts,
4+
rem in different working directories, than where the driver was built. This
5+
rem causes errors in "make install" like:
6+
rem CMake Error at cmake_install cannot find
7+
rem "C:/data/mci/d3ba3391950aca9119e841818a8884bc/mongoc/src/libbson/libbson-1.0.dll"
8+
rem
9+
rem So just copy files manually
10+
11+
rmdir /Q /S C:\mongo-c-driver
12+
md C:\mongo-c-driver
13+
md C:\mongo-c-driver\bin
14+
copy /Y libmongoc-1.0.dll C:\mongo-c-driver\bin
15+
copy /Y src\libbson\libbson-1.0.dll C:\mongo-c-driver\bin
16+
17+
test-libmongoc.exe --no-fork -d -F test-results.json

.evergreen/run-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ export MONGOC_TEST_FUTURE_TIMEOUT_MS=30000
2626
export MONGOC_TEST_URI="$URI"
2727
export MONGOC_TEST_SERVER_LOG="json"
2828

29+
if [ "$CC" = "mingw" ]; then
30+
chmod +x test-libmongoc.exe
31+
cmd.exe /c .evergreen\\run-tests-mingw.bat
32+
exit 0
33+
fi
34+
2935
case "$OS" in
3036
cygwin*)
3137
export PATH=$PATH:`pwd`/tests:`pwd`/Debug:`pwd`/src/libbson/Debug

0 commit comments

Comments
 (0)