[ci] Explicitly disable hybrid suspend for preemptive and coop tags
[mono-project.git] / scripts / ci / run-jenkins.sh
blobb61ce10e684b8007597039c0a3cbb7167065cfda
1 #!/bin/bash -e
3 export MONO_REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )"
4 export TESTCMD=${MONO_REPO_ROOT}/scripts/ci/run-step.sh
6 export TEST_HARNESS_VERBOSE=1
8 make_timeout=300m
10 if [[ ${CI_TAGS} == *'clang-sanitizer'* ]]; then
11 export CC="clang"
12 export CXX="clang++"
13 export CFLAGS="$CFLAGS -g -O1 -fsanitize=thread -fsanitize-blacklist=${MONO_REPO_ROOT}/scripts/ci/clang-thread-sanitizer-blacklist -mllvm -tsan-instrument-atomics=false"
14 export LDFLAGS="-fsanitize=thread"
15 # TSAN_OPTIONS are used by programs that were compiled with Clang's ThreadSanitizer
16 # see https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags for more details
17 export TSAN_OPTIONS="history_size=7:exitcode=0:force_seq_cst_atomics=1"
18 make_timeout=30m
21 if [[ ${CI_TAGS} == *'win-'* ]]; then
22 # Passing -ggdb3 on Cygwin breaks linking against libmonosgen-x.y.dll
23 export CFLAGS="$CFLAGS -g -O2"
24 else
25 export CFLAGS="$CFLAGS -ggdb3 -O2"
28 if [[ $CI_TAGS == *'collect-coverage'* ]]; then
29 # Collect coverage for further use by lcov and similar tools.
30 # Coverage must be collected with -O0 and debug information.
31 export CFLAGS="$CFLAGS -ggdb3 --coverage -O0"
34 if [[ $CI_TAGS == *'retry-flaky-tests'* ]]; then
35 export MONO_FLAKY_TEST_RETRIES=5
38 if [[ ${CI_TAGS} == *'osx-i386'* ]]; then CFLAGS="$CFLAGS -m32 -arch i386 -mmacosx-version-min=10.7"; LDFLAGS="$LDFLAGS -m32 -arch i386"; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --host=i386-apple-darwin11.2.0 --build=i386-apple-darwin11.2.0"; fi
39 if [[ ${CI_TAGS} == *'osx-amd64'* ]]; then CFLAGS="$CFLAGS -m64 -arch x86_64 -mmacosx-version-min=10.7"; LDFLAGS="$LDFLAGS -m64 -arch x86_64" EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib"; fi
40 if [[ ${CI_TAGS} == *'win-i386'* ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=i686-w64-mingw32"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/Win32/bin/Release/mono-sgen.exe"; fi
41 if [[ ${CI_TAGS} == *'win-amd64'* ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=x86_64-w64-mingw32 --disable-boehm"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/x64/bin/Release/mono-sgen.exe"; fi
43 if [[ ${CI_TAGS} == *'coop-suspend'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-hybrid-suspend --enable-cooperative-suspend";
44 elif [[ ${CI_TAGS} == *'hybrid-suspend'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-hybrid-suspend";
45 elif [[ ${CI_TAGS} == *'preemptive-suspend'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-hybrid-suspend";
48 if [[ ${CI_TAGS} == *'checked-coop'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=gc,thread"; fi
49 if [[ ${CI_TAGS} == *'checked-all'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=all"; fi
51 if [[ ${CI_TAGS} == *'mcs-compiler'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-csc=mcs"; fi
52 if [[ ${CI_TAGS} == *'disable-mcs-build'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-mcs-build"; fi
54 if [[ ${CI_TAGS} == *'fullaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=fullaot_llvm ";
55 elif [[ ${CI_TAGS} == *'hybridaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=hybridaot_llvm";
56 elif [[ ${CI_TAGS} == *'aot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=aot_llvm ";
57 elif [[ ${CI_TAGS} == *'jit_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes"; export MONO_ENV_OPTIONS="$MONO_ENV_OPTIONS --llvm";
58 elif [[ ${CI_TAGS} == *'fullaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=fullaot";
59 elif [[ ${CI_TAGS} == *'hybridaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=hybridaot";
60 elif [[ ${CI_TAGS} == *'winaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=winaot";
61 elif [[ ${CI_TAGS} == *'aot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=aot";
62 elif [[ ${CI_TAGS} == *'bitcode'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=bitcode";
63 elif [[ ${CI_TAGS} == *'acceptance-tests'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=${MONO_REPO_ROOT}/tmp/mono-acceptance-tests --with-sgen-default-concurrent=yes";
64 elif [[ ${CI_TAGS} == *'all-profiles'* ]]; then
65 # only enable build of the additional profiles on one config to save time
66 EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=all"
67 # when building profiles like monotouch/monodroid which don't build System.Drawing.dll in the Mono repo we need
68 # to build the facades against _something_ to satisfy the typeforwards. In CI we can cheat a little and pass
69 # them System.Drawing.dll from the 'build' profile since we don't test those profiles here (we just ensure they compile).
70 export EXTERNAL_FACADE_DRAWING_REFERENCE=${MONO_REPO_ROOT}/mcs/class/lib/build/System.Drawing.dll
73 if [ -x "/usr/bin/dpkg-architecture" ];
74 then
75 EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
76 #force build arch = dpkg arch, sometimes misdetected
77 mkdir -p ~/.config/.mono/
78 wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
81 if [[ ${CI_TAGS} == *'win-'* ]];
82 then
83 mkdir -p ~/.config/.mono/
84 wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
87 if [[ ${CI_TAGS} == *'product-sdks-ios'* ]];
88 then
89 echo "DISABLE_ANDROID=1" > sdks/Make.config
90 echo "DISABLE_WASM=1" >> sdks/Make.config
91 export device_test_suites="Mono.Runtime.Tests System.Core"
92 ${TESTCMD} --label=runtimes --timeout=60m --fatal make -j4 -C sdks/builds package-ios-sim64 package-ios-target64
93 ${TESTCMD} --label=cross --timeout=60m --fatal make -j4 -C sdks/builds package-ios-cross64 package-ios-cross32
94 ${TESTCMD} --label=bcl --timeout=60m --fatal make -j4 -C sdks/builds package-bcl
95 ${TESTCMD} --label=build-tests --timeout=10m --fatal make -C sdks/ios compile-tests
96 ${TESTCMD} --label=run-sim --timeout=20m make -C sdks/ios run-ios-sim-all
97 ${TESTCMD} --label=build-ios-dev --timeout=60m make -C sdks/ios build-ios-dev-all
98 if [[ ${CI_TAGS} == *'run-device-tests'* ]]; then
99 for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-${suite} --timeout=10m make -C sdks/ios run-ios-dev-${suite}; done
101 ${TESTCMD} --label=build-ios-dev-llvm --timeout=60m make -C sdks/ios build-ios-dev-llvm-all
102 if [[ ${CI_TAGS} == *'run-device-tests'* ]]; then
103 for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-llvm-${suite} --timeout=10m make -C sdks/ios run-ios-dev-${suite}; done
105 ${TESTCMD} --label=package --timeout=60m tar cvzf mono-product-sdk-$GIT_COMMIT.tar.gz -C sdks/out/ bcl ios-llvm64 ios-llvm32 ios-cross32-release ios-cross64-release
106 exit 0
109 if [[ ${CI_TAGS} == *'product-sdks-android'* ]];
110 then
111 echo "IGNORE_PROVISION_ANDROID=1" > sdks/Make.config
112 echo "IGNORE_PROVISION_MXE=1" >> sdks/Make.config
113 echo "DISABLE_CCACHE=1" >> sdks/Make.config
114 ${TESTCMD} --label=provision-android --timeout=120m --fatal make -j4 -C sdks/builds provision-android
115 if [[ ${CI_TAGS} == *'provision-mxe'* ]]; then
116 ${TESTCMD} --label=provision-mxe --timeout=240m --fatal make -j4 -C sdks/builds provision-mxe
118 ${TESTCMD} --label=runtimes --timeout=120m --fatal make -j4 -C sdks/builds package-android-{armeabi,armeabi-v7a,arm64-v8a,x86,x86_64} package-android-host-{Darwin,mxe-Win64}
119 exit 0
122 if [[ ${CI_TAGS} == *'webassembly'* ]];
123 then
124 echo "DISABLE_ANDROID=1" > sdks/Make.config
125 echo "DISABLE_IOS=1" >> sdks/Make.config
126 ${TESTCMD} --label=runtimes --timeout=60m --fatal make -j4 -C sdks/builds package-wasm-interp
127 ${TESTCMD} --label=bcl --timeout=60m --fatal make -j4 -C sdks/builds package-bcl
128 ${TESTCMD} --label=wasm-build --timeout=60m --fatal make -j4 -C sdks/wasm build
129 ${TESTCMD} --label=ch-mini-test --timeout=60m make -C sdks/wasm run-ch-mini
130 ${TESTCMD} --label=v8-mini-test --timeout=60m make -C sdks/wasm run-v8-mini
131 ${TESTCMD} --label=sm-mini-test --timeout=60m make -C sdks/wasm run-sm-mini
132 ${TESTCMD} --label=jsc-mini-test --timeout=60m make -C sdks/wasm run-jsc-mini
133 #The following tests are not passing yet, so enabling them would make us perma-red
134 #${TESTCMD} --label=mini-corlib --timeout=60m make -C sdks/wasm run-all-corlib
135 #${TESTCMD} --label=mini-system --timeout=60m make -C sdks/wasm run-all-system
136 # Chakra crashes with System.Core. See https://github.com/mono/mono/issues/8345
137 ${TESTCMD} --label=ch-system-core --timeout=60m make -C sdks/wasm run-ch-system-core
138 ${TESTCMD} --label=v8-system-core --timeout=60m make -C sdks/wasm run-v8-system-core
139 ${TESTCMD} --label=sm-system-core --timeout=60m make -C sdks/wasm run-sm-system-core
140 ${TESTCMD} --label=jsc-system-core --timeout=60m make -C sdks/wasm run-jsc-system-core
141 ${TESTCMD} --label=package --timeout=60m make -C sdks/wasm package
142 exit 0
146 if [[ ${CI_TAGS} != *'mac-sdk'* ]]; # Mac SDK builds Mono itself
147 then
148 ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh $EXTRA_CONF_FLAGS
150 if [[ ${CI_TAGS} == *'win-i386'* ]];
151 then
152 # only build boehm on w32 (only windows platform supporting boehm).
153 ${TESTCMD} --label=make-msvc --timeout=60m --fatal /cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=${PLATFORM} /p:Configuration=Release /p:MONO_TARGET_GC=boehm msvc/mono.sln
155 if [[ ${CI_TAGS} == *'win-'* ]];
156 then
157 ${TESTCMD} --label=make-msvc-sgen --timeout=60m --fatal /cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=${PLATFORM} /p:Configuration=Release /p:MONO_TARGET_GC=sgen msvc/mono.sln
160 if [[ ${CI_TAGS} == *'winaot'* ]];
161 then
162 # The AOT compiler on Windows requires Visual Studio's clang.exe and link.exe in $PATH
163 # and we must make sure Visual Studio's link.exe comes before Cygwin's link.exe
164 VC_ROOT="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC"
165 export PATH="$VC_ROOT/ClangC2/bin/amd64:$VC_ROOT/bin/amd64":$PATH
168 if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi
170 make_parallelism=-j4
171 if [[ ${CI_TAGS} == *'linux-ppc64el'* ]]; then make_parallelism=-j1; fi
173 make_continue=
174 if [[ ${CI_TAGS} == *'checked-all'* ]]; then make_continue=-k; fi
176 if [[ ${CI_TAGS} != *'mac-sdk'* ]]; # Mac SDK builds Mono itself
177 then
178 ${TESTCMD} --label=make --timeout=${make_timeout} --fatal make ${make_parallelism} ${make_continue} -w V=1
181 if [[ ${CI_TAGS} == *'checked-coop'* ]]; then export MONO_CHECK_MODE=gc,thread; fi
182 if [[ ${CI_TAGS} == *'checked-all'* ]]; then export MONO_CHECK_MODE=all; fi
184 export MONO_ENV_OPTIONS="$MONO_ENV_OPTIONS $MONO_TEST_ENV_OPTIONS"
186 if [[ ${CI_TAGS} == *'acceptance-tests'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-acceptance-tests.sh;
187 elif [[ ${CI_TAGS} == *'profiler-stress-tests'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-profiler-stress-tests.sh;
188 elif [[ ${CI_TAGS} == *'stress-tests'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-stress-tests.sh;
189 elif [[ ${CI_TAGS} == *'interpreter'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-interpreter.sh;
190 elif [[ ${CI_TAGS} == *'mcs-compiler'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-mcs.sh;
191 elif [[ ${CI_TAGS} == *'mac-sdk'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-mac-sdk.sh;
192 elif [[ ${CI_TAGS} == *'no-tests'* ]]; then exit 0;
193 else make check-ci;