[netcore] Remove local copy of static alc resolve methods
[mono-project.git] / scripts / ci / run-test-msbuild.sh
blobc678b68b856716cf19b91f1e518b54ee570cbda2
1 #!/bin/bash
3 set -u
4 set -e
5 # set -x
7 OLD_CWD=`pwd`
8 TESTCMD=`realpath ${TESTCMD}`
10 rm -rf /tmp/xplat-master || true
11 rm -rf /tmp/mono-from-source || true
13 ${TESTCMD} --label=make-install --timeout=15m make install
15 OLD_PATH=${PATH}
16 export PATH=/tmp/mono-from-source/bin/:${OLD_PATH}
18 # hack: execution environment may not have certificates, which breaks nuget. roslyn and msbuild both need nuget.
19 # ${TESTCMD} --label=cert-sync --timeout=15m /tmp/mono-from-source/bin/cert-sync /etc/ssl/certs/ca-certificates.crt
21 # we bump the OS X version of msbuild by modifying msbuild.py, so we want to pull that revision hash out
22 # and match it here so we are verifying the same revision mac users get
23 MSBUILD_REVISION=`grep -Po "(?<=revision \= \')[0-9a-f]+" packaging/MacSDK/msbuild.py`
24 echo Detected msbuild hash ${MSBUILD_REVISION} in MacSDK/msbuild.py
26 ${TESTCMD} --label=clone-msbuild --timeout=5m git clone https://github.com/mono/msbuild.git /tmp/xplat-master
27 cd /tmp/xplat-master
29 XPLAT_MASTER_REVISION=`git rev-parse xplat-master`
30 echo Detected msbuild hash ${XPLAT_MASTER_REVISION} in mono/msbuild branch xplat-master
32 COMPARISON="\"${MSBUILD_REVISION}\" = \"${XPLAT_MASTER_REVISION}\""
34 # fixme: the xplat-master and macsdk hashes don't match right now
35 #${TESTCMD} --label=compare-hashes --timeout=5m test ${COMPARISON}
37 # hack: we can test against latest xplat-master but we don't want to do that on ci
38 #MSBUILD_REVISION=${XPLAT_MASTER_REVISION}
40 ${TESTCMD} --label=checkout-xplat-master --timeout=5m git checkout ${MSBUILD_REVISION}
42 # DisableNerdbankVersioning: Nerdbank relies on libgit2, which relies on libssl1.0.0, which is extremely old and has been dropped from some distributions. Newer libssl is not binary compatible so fixing this will require an update to both libgit2 and nerdbank. libssl1.0.0 was removed for security reasons (AFAIK) so getting it back is a bad idea.
43 # CreateBootstrap: Building without this means some important configuration files will be missing
44 # Projects: Building regular MSBuild.csproj appears to work but also leaves out important files. Building the whole sln will compile the automated test suite and other tools which may fail for reasons that are unimportant to us.
45 # AssemblyVersion: Nerdbank is responsible for setting assembly versions, so without setting one here you may get errors due to a default version of 42.42.42.42. Suggested by Rainer Sigwald
47 ${TESTCMD} --label=compile-msbuild --timeout=15m ./eng/cibuild_bootstrapped_msbuild.sh --host_type mono --configuration Release /p:DisableNerdbankVersioning=true /p:CreateBootstrap=true "/p:Projects=/tmp/xplat-master/src/MSBuild.Bootstrap/MSBuild.Bootstrap.csproj" /p:AssemblyVersion=15.1.0.0
49 # hack: this is useful for debugging some of the errors that will occur if there are assembly load bugs
50 # in the mono runtime, issues with msbuild's compile-time dependencies, or runtime dependencies
51 #export MONO_LOG_MASK=asm
52 #export MONO_LOG_LEVEL=debug
54 MONO=/tmp/mono-from-source/bin/mono
55 # using artifacts/2/bin instead of artifacts/bin here is important because it is produced by later steps
56 # in the build process. A build may appear to succeed by having a /bin which will hide problems and result
57 # in confusing errors
58 DLL_PATH=`realpath /tmp/xplat-master/artifacts/2/bin/MSBuild.Bootstrap/*-MONO/net472/MSBuild.dll`
60 ${TESTCMD} --label=check-for-dll --timeout=1m test -s ${DLL_PATH}
62 # BuildProjectReferences: Without doing this culevel will trigger build of mscorlib.dll etc which may
63 # fail and is unnecessary given that make created its dependencies earlier.
64 ${TESTCMD} --label=try-to-use-built-msbuild-to-build-culevel --timeout=1m ${MONO} ${DLL_PATH} ${OLD_CWD}/mcs/tools/culevel/culevel.csproj /p:BuildProjectReferences=false
66 ${TESTCMD} --label=check-for-culevel-exe-1 --timeout=1m test -s ${OLD_CWD}/mcs/class/lib/net_4_x-*/culevel.exe
68 # install-mono-prefix below needs a 'msbuild' so we add the bootstrap msbuild folder into the PATH
69 # in front of the folder we installed our prefix into. Suggested by Ankit Jain
70 export PATH=/tmp/xplat-master/artifacts/mono-msbuild:/tmp/mono-from-source/bin:${OLD_PATH}
72 # hack: this is fixed in latest xplat-master but we haven't bumped macsdk.
73 sed -i "s/ln -sfh Current/ln -sfn Current/g" mono/build/install.proj
75 ${TESTCMD} --label=install-msbuild --timeout=2m ./install-mono-prefix.sh /tmp/mono-from-source/
77 rm -f mcs/class/lib/net_4_x-*/culevel.exe || true
79 export PATH=/tmp/mono-from-source/bin:${OLD_PATH}
81 # BuildProjectReferences: See above
82 # We are building using both msbuild-direct-from-outdir and msbuild-installed-to-prefix because
83 # each scenario can reveal different bugs and configuration issues. We care about any failures in
84 # either scenario.
85 ${TESTCMD} --label=try-to-use-installed-msbuild-to-build-culevel --timeout=1m msbuild ${OLD_CWD}/mcs/tools/culevel/culevel.csproj /p:BuildProjectReferences=false
87 ${TESTCMD} --label=check-for-culevel-exe-2 --timeout=1m test -s ${OLD_CWD}/mcs/class/lib/net_4_x-*/culevel.exe