Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Lorensson <lateralusx.github@gmail.com>2019-02-01 19:54:45 +0300
committerLudovic Henry <luhenry@microsoft.com>2019-02-01 19:54:45 +0300
commit7710b4c099718c27a5f54cf9196bef96474dff1a (patch)
tree0df1e77b0e55d07591b42b4cf563b1cdfefc861e /msvc/mono-sgen-msvc.sh
parentdc1cdb9983fd1c42aae7d8fcce6a5ac5dcedd039 (diff)
Add support for Windows x64 winaot, winaot_llvm builds/tests on CI. (#12601)
Add support for building Windows x64 fullaot version of winaot profile that can be run on CI. Initial changes also add execution of mini regression tests on CI. More tests will be added going forward and when having full pass rate. Add support for building Windows x64 fullaot+llvm version of winaot profile that can be run on CI. Initial changes also add execution of mini regression tests on CI. More tests will be added going forward and when having full pass rate. In order to get deterministic build results and working build on CI, we need to setup a correct build environment for the MSVC builds. Since MSVC build is currently run from cygwin, there are environment problems, both general but also in our CI environment, since we add cygwin bin folder to system path (needed by Jenkins plugin). When running more complex cmake builds like BTLS and LLVM, this will cause problems picking up incorrect tools, failing builds on CI. Another problem is the AOT compilation using MSVC toolchain. In the past CI used some "hard coded paths" to make sure clang.exe and link.exe was found. This is not optimal and won't work when including LLVM as part of full AOT since link.exe will need access to more of the full build environment setup by VS development environments (like platform libraries). In order to get a better build environment on CI this commit includes and enhance a couple of build scripts used to run msbuild.exe and mono-sgen.exe (as AOT compiler) in a VS development environment, isolate that build process from cygwin environment. The build scripts will locate installed VS tooling, VS2015 build tools or VS dev env, VS2017 build tools or VS dev env and use corresponding development environment scripts as part of running msbuild.exe and mono-sgen.exe in AOT mode. In order to make sure mono-sgen.exe as AOT compiler is run through these scripts an additional environment variable MONO_EXECUTABLE_WRAPPER is introduced and used in mono-wrapper when set. Without this indirection there will be problems on CI tests since the environment is using MONO_EXECUTABLE and pass that into for example test driver that run child processes of mono-sgen.exe, meaning that we can't use scripts for MONO_EXECUTABLE, but splitting the MONO_EXECUTABLE to represent mono runtime and have a MONO_EXECUTABLE_WRAPPER that could be a launch script solves this issue. This commit also includes several smaller fixes made to the generic fullaot build infrastructure. Fix additional msbuild arguments. Add Mono.SIMD assembly to winaot profile. Run msbuild.exe as part of .bat file.
Diffstat (limited to 'msvc/mono-sgen-msvc.sh')
-rw-r--r--msvc/mono-sgen-msvc.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/msvc/mono-sgen-msvc.sh b/msvc/mono-sgen-msvc.sh
new file mode 100644
index 00000000000..03757366d09
--- /dev/null
+++ b/msvc/mono-sgen-msvc.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Wrapper that can be used as MONO_EXECUTABLE_WRAPPER in mono-wrapper when running MSVC build
+# mono-sgen.exe. Simplify the setup of VS and MSVC toolchain, primarly when running MSVC build
+# mono-sgen.exe as AOT compiler, since it needs to locate libraries as well as ClangC2 and linker
+# from VS MSVC for corresponding architecture.
+
+# NOTE, MSVC build mono-sgen.exe AOT compiler currently support 64-bit AMD codegen. mono-sgen-msvc.bat will ony setup
+# amd64 versions of VS MSVC build environment and corresponding ClangC2 compiler.
+
+# Optimization, only run full build environment when running mono-sgen.exe as AOT compiler.
+# If not, just run mono-sgen.exe with supplied arguments.
+
+MONO_SGEN_MSVC_SCRIPT_PATH=$(cd "$(dirname "$0")"; pwd)
+
+if [[ "$@" != *"--aot="* ]]; then
+ "$MONO_SGEN_MSVC_SCRIPT_PATH/mono-sgen.exe" "$@"
+else
+ MONO_SGEN_MSVC_SCRIPT_PATH=$(cygpath -w "$MONO_SGEN_MSVC_SCRIPT_PATH/mono-sgen-msvc.bat")
+ "$WINDIR/System32/cmd.exe" /c "$MONO_SGEN_MSVC_SCRIPT_PATH" "$@"
+fi