Skip to content

Commit

Permalink
[ci] Add {,hybrid,full}aot_llvm presets to make sure we compile with …
Browse files Browse the repository at this point in the history
…LLVM (#8053)

* [ci] Add {,hybrid,full}aot_llvm presets to make sure we compile with LLVM

* [configure] Rename runtime_preset to runtime-preset

* [bcl] Make sure we build the testing_aot_{hybrid,full} profiles when building all profiles

* [test-runner] Factor test-runner parameters for picking up and passing arguments to the runtime

* [hybridaot] Fix testing_aot_hybrid build

* [mini-llvm-aot] Fix common race condition in parallel builds due to common defaults.
  • Loading branch information
luhenry committed Apr 11, 2018
1 parent aa729d1 commit 4f2522e
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 30 deletions.
46 changes: 38 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ AC_ARG_WITH(unreal, [ --with-unreal=yes,no If you w
AC_ARG_WITH(wasm, [ --with-wasm=yes,no If you want to build the WebAssembly (defaults to no)], [], [with_wasm=default])


AC_ARG_WITH(runtime_preset, [ --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode,unreal Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
AC_ARG_WITH(runtime-preset, [ --with-runtime-preset=net_4_x,all,aot,aot_llvm,hybridaot,hybridaot_llvm,fullaot,fullaot_llvm,bitcode,unreal Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
AC_ARG_WITH(spectre-mitigation, [ --with-spectre-mitigation=yes,no If you want to build the runtime with compiler flags that enable Spectre mitigation (defaults to no)], [], [with_spectre_mitigation=default])
AC_ARG_WITH(spectre-indirect-branch-choice, [ --with-spectre-indirect-branch-choice=keep,thunk,inline,extern Convert indirect branches to the specified kind of thunk (defaults to inline)], [], [with_spectre_indirect_branch_choice=inline])
AC_ARG_WITH(spectre-function-return-choice, [ --with-spectre-function-return-choice=keep,thunk,inline,extern Convert function return instructions to the specified kind of thunk (defaults to inline)], [], [with_spectre_function_return_choice=inline])
Expand Down Expand Up @@ -1086,6 +1086,25 @@ elif test x$with_runtime_preset = xall; then
with_orbis_default=yes
with_unreal_default=yes
with_wasm_default=yes
with_testing_aot_hybrid_default=yes
with_testing_aot_full_default=yes
elif test x$with_runtime_preset = xbitcode; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_full_default=yes
with_bitcode_default=yes
with_cooperative_gc_default=yes
TEST_PROFILE=testing_aot_full
enable_llvm_default=yes

mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_reflection_emit_save='yes'
mono_feature_disable_reflection_emit='yes'
mono_feature_disable_appdomains='yes'

AOT_BUILD_FLAGS="--runtime=mobile --aot=llvmonly,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --llvmonly"
AOT_MODE="llvmonly"
elif test x$with_runtime_preset = xfullaot; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_full_default=yes
Expand All @@ -1100,36 +1119,47 @@ elif test x$with_runtime_preset = xfullaot; then
AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
AOT_MODE="full"
elif test x$with_runtime_preset = xbitcode; then
elif test x$with_runtime_preset = xfullaot_llvm; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_full_default=yes
with_bitcode_default=yes
with_cooperative_gc_default=yes
TEST_PROFILE=testing_aot_full
enable_llvm_default=yes

mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_reflection_emit_save='yes'
mono_feature_disable_reflection_emit='yes'
mono_feature_disable_appdomains='yes'

AOT_BUILD_FLAGS="--runtime=mobile --aot=llvmonly,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --llvmonly"
AOT_MODE="llvmonly"
AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --llvm --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
AOT_MODE="full"
elif test x$with_runtime_preset = xhybridaot; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_hybrid_default=yes
TEST_PROFILE=testing_aot_hybrid

AOT_BUILD_FLAGS="--runtime=mobile --aot=hybrid,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
elif test x$with_runtime_preset = xhybridaot_llvm; then
DISABLE_MCS_DOCS_default=yes
with_testing_aot_hybrid_default=yes
TEST_PROFILE=testing_aot_hybrid

AOT_BUILD_FLAGS="--runtime=mobile --llvm --aot=hybrid,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
elif test x$with_runtime_preset = xaot; then
with_profile4_x_default=yes

AOT_BUILD_FLAGS="--aot=$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS=""

DISABLE_MCS_DOCS_default=yes
elif test x$with_runtime_preset = xaot_llvm; then
with_profile4_x_default=yes

AOT_BUILD_FLAGS="--llvm --aot=$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS=""

DISABLE_MCS_DOCS_default=yes
elif test x$with_runtime_preset = xwinaot; then
DISABLE_MCS_DOCS_default=yes
Expand Down
4 changes: 4 additions & 0 deletions mcs/class/System/testing_aot_hybrid_System.dll.sources
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
#include mobile_System.dll.sources

../../../external/corefx/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/CompiledRegexRunnerFactory.cs
../../../external/corefx/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs
../../../external/corefx/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexLWCGCompiler.cs
13 changes: 10 additions & 3 deletions mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -12738,13 +12738,20 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options,
else
acfg->llvm_sfile = g_strdup (acfg->aot_opts.llvm_outfile);
} else {
acfg->tmpbasename = (strcmp (acfg->aot_opts.temp_path, "") == 0) ?
g_strdup_printf ("%s", "temp") :
g_build_filename (acfg->aot_opts.temp_path, "temp", NULL);
gchar *temp_path;
if (strcmp (acfg->aot_opts.temp_path, "") != 0) {
temp_path = g_strdup (acfg->aot_opts.temp_path);
} else {
temp_path = mkdtemp(g_strdup ("mono_aot_XXXXXX"));

This comment has been minimized.

Copy link
@jaykrell

jaykrell Apr 11, 2018

Contributor

Is the directory ever deleted?

g_assertf (temp_path, "mkdtemp failed, error = (%d) %s", errno, g_strerror (errno));
}

acfg->tmpbasename = g_build_filename (temp_path, "temp", NULL);
acfg->tmpfname = g_strdup_printf ("%s.s", acfg->tmpbasename);
acfg->llvm_sfile = g_strdup_printf ("%s-llvm.s", acfg->tmpbasename);
acfg->llvm_ofile = g_strdup_printf ("%s-llvm.o", acfg->tmpbasename);

g_free (temp_path);
}
}
#endif
Expand Down
5 changes: 3 additions & 2 deletions mono/tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
/*.o
/*.lo
/*.so
/*.dylib
/*.dylib.dSYM
**.dylib
**.dylib.dSYM
/*.netmodule
/imt_big_iface_test.cs
/bin
Expand All @@ -35,3 +35,4 @@
/testlist.sorted
/reflection-load-dir
/assemblyresolve_deps
/mono_aot_*
18 changes: 11 additions & 7 deletions mono/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,15 @@ MCS = $(MCS_NO_LIB)

ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe

TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)"
TEST_RUNNER = ./test-runner.exe

if HOST_WIN32
TEST_RUNNER += --config tests-config --runtime "$(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),$(top_builddir)/runtime/mono-wrapper)"
else
TEST_RUNNER += --config tests-config --runtime "$(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$(top_builddir)/runtime/mono-wrapper)"
endif

TEST_RUNNER += --mono-path "$(CLASS)"

if FULL_AOT_TESTS
TEST_RUNNER += --runtime-args "$(TEST_AOT_RUN_FLAGS)"
Expand All @@ -230,11 +238,7 @@ if HYBRID_AOT_TESTS
TEST_RUNNER += --runtime-args "$(TEST_AOT_RUN_FLAGS)"
endif

if HOST_WIN32
TEST_RUNNER += --config tests-config --runtime $(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),mono)
else
TEST_RUNNER += --config tests-config --runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
endif
TEST_RUNNER += --runtime-args "$(TEST_RUNTIME_FLAGS)"

TEST_RUNNER += $(if $(V), --verbose,)

Expand Down Expand Up @@ -1508,7 +1512,7 @@ runtest: compile-tests
fi

runtest-managed: test-runner.exe compile-tests
$(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j a --testsuite-name "runtime" --timeout 300 --disabled "$(DISABLED_TESTS)" --runtime-args "$(TEST_RUNTIME_FLAGS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
$(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j a --testsuite-name "runtime" --timeout 300 --disabled "$(DISABLED_TESTS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)

runtest-managed-serial: test-runner.exe compile-tests
$(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j 1 --testsuite-name "runtime" --disabled "$(DISABLED_TESTS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
Expand Down
2 changes: 1 addition & 1 deletion runtime/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if INSTALL_4_x
symlinks += etc/mono/4.0/machine.config etc/mono/4.0/web.config etc/mono/4.5/web.config etc/mono/4.0/Browsers/Compat.browser etc/mono/4.5/Browsers/Compat.browser
endif

# This is needed at least to build configure -with-runtime_preset=fullaot.
# This is needed at least to build configure --with-runtime-preset=fullaot.
symlinks += etc/mono/4.5/machine.config

etc/mono/2.0/machine.config: $(top_srcdir)/data/net_2_0/machine.config
Expand Down
18 changes: 9 additions & 9 deletions scripts/ci/run-jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ if [[ ${CI_TAGS} == *'checked-all'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAG
if [[ ${CI_TAGS} == *'mcs-compiler'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-csc=mcs"; fi
if [[ ${CI_TAGS} == *'disable-mcs-build'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-mcs-build"; fi

if [[ ${CI_TAGS} == *'fullaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime_preset=fullaot ";
elif [[ ${CI_TAGS} == *'hybridaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime_preset=hybridaot";
elif [[ ${CI_TAGS} == *'aot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime_preset=aot ";
elif [[ ${CI_TAGS} == *'fullaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=fullaot";
elif [[ ${CI_TAGS} == *'hybridaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=hybridaot";
elif [[ ${CI_TAGS} == *'winaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=winaot";
elif [[ ${CI_TAGS} == *'aot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot";
elif [[ ${CI_TAGS} == *'bitcode'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=bitcode";
if [[ ${CI_TAGS} == *'fullaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=fullaot_llvm ";
elif [[ ${CI_TAGS} == *'hybridaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=hybridaot_llvm";
elif [[ ${CI_TAGS} == *'aot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=aot_llvm ";
elif [[ ${CI_TAGS} == *'fullaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=fullaot";
elif [[ ${CI_TAGS} == *'hybridaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=hybridaot";
elif [[ ${CI_TAGS} == *'winaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=winaot";
elif [[ ${CI_TAGS} == *'aot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=aot";
elif [[ ${CI_TAGS} == *'bitcode'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=bitcode";
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";
elif [[ ${CI_TAGS} == *'all-profiles'* ]]; then
# only enable build of the additional profiles on one config to save time
EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=all"
EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=all"
# when building profiles like monotouch/monodroid which don't build System.Drawing.dll in the Mono repo we need
# to build the facades against _something_ to satisfy the typeforwards. In CI we can cheat a little and pass
# them System.Drawing.dll from the 'build' profile since we don't test those profiles here (we just ensure they compile).
Expand Down

0 comments on commit 4f2522e

Please sign in to comment.