summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh57
1 files changed, 35 insertions, 22 deletions
diff --git a/build.sh b/build.sh
index e450186628..1cb0d7e0dc 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
+# Work around Jenkins CI + msbuild problem: Jenkins sometimes creates very large environment
+# variables, and msbuild can't handle environment blocks with such large variables. So clear
+# out the variables that might be too large.
+export ghprbCommentBody=
+
# resolve python-version to use
if [ "$PYTHON" == "" ] ; then
if ! PYTHON=$(command -v python2.7 || command -v python2 || command -v python)
@@ -394,34 +399,29 @@ isMSBuildOnNETCoreSupported()
build_CoreLib_ni()
{
- if [ $__SkipCrossgen == 1 ]; then
- echo "Skipping generating native image"
- return
+ local __CrossGenExec=$1
+
+ echo "Generating native image for System.Private.CoreLib.dll"
+ echo "$__CrossGenExec /Platform_Assemblies_Paths $__BinDir/IL $__IbcTuning /out $__BinDir/System.Private.CoreLib.dll $__BinDir/IL/System.Private.CoreLib.dll"
+ $__CrossGenExec /Platform_Assemblies_Paths $__BinDir/IL $__IbcTuning /out $__BinDir/System.Private.CoreLib.dll $__BinDir/IL/System.Private.CoreLib.dll
+ if [ $? -ne 0 ]; then
+ echo "Failed to generate native image for System.Private.CoreLib."
+ exit 1
fi
- if [ $__SkipCoreCLR == 0 -a -e $__BinDir/crossgen ]; then
- echo "Generating native image for System.Private.CoreLib."
- echo "$__BinDir/crossgen /Platform_Assemblies_Paths $__BinDir/IL $__IbcTuning /out $__BinDir/System.Private.CoreLib.dll $__BinDir/IL/System.Private.CoreLib.dll"
- $__BinDir/crossgen /Platform_Assemblies_Paths $__BinDir/IL $__IbcTuning /out $__BinDir/System.Private.CoreLib.dll $__BinDir/IL/System.Private.CoreLib.dll
+ if [ "$__BuildOS" == "Linux" ]; then
+ echo "Generating symbol file for System.Private.CoreLib.dll"
+ echo "$__CrossGenExec /Platform_Assemblies_Paths $__BinDir /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.dll"
+ $__CrossGenExec /Platform_Assemblies_Paths $__BinDir /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.dll
if [ $? -ne 0 ]; then
- echo "Failed to generate native image for System.Private.CoreLib."
+ echo "Failed to generate symbol file for System.Private.CoreLib."
exit 1
fi
-
- if [ "$__BuildOS" == "Linux" ]; then
- echo "Generating symbol file for System.Private.CoreLib."
- $__BinDir/crossgen /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.dll
- if [ $? -ne 0 ]; then
- echo "Failed to generate symbol file for System.Private.CoreLib."
- exit 1
- fi
- fi
fi
}
build_CoreLib()
{
-
if [ $__isMSBuildOnNETCoreSupported == 0 ]; then
echo "System.Private.CoreLib.dll build unsupported."
return
@@ -447,18 +447,31 @@ build_CoreLib()
exit 1
fi
+ if [ $__SkipCrossgen == 1 ]; then
+ echo "Skipping generating native image"
+ return
+ fi
+
# The cross build generates a crossgen with the target architecture.
- if [ $__CrossBuild != 1 ]; then
+ if [ $__CrossBuild == 0 ]; then
+ if [ $__SkipCoreCLR == 1 ]; then
+ return
+ fi
+
# The architecture of host pc must be same architecture with target.
if [[ ( "$__HostArch" == "$__BuildArch" ) ]]; then
- build_CoreLib_ni
+ build_CoreLib_ni "$__BinDir/crossgen"
elif [[ ( "$__HostArch" == "x64" ) && ( "$__BuildArch" == "x86" ) ]]; then
- build_CoreLib_ni
+ build_CoreLib_ni "$__BinDir/crossgen"
elif [[ ( "$__HostArch" == "arm64" ) && ( "$__BuildArch" == "arm" ) ]]; then
- build_CoreLib_ni
+ build_CoreLib_ni "$__BinDir/crossgen"
else
exit 1
fi
+ elif [ $__DoCrossArchBuild == 1 ]; then
+ if [[ ( "$__CrossArch" == "x86" ) && ( "$__BuildArch" == "arm" ) ]]; then
+ build_CoreLib_ni "$__CrossComponentBinDir/crossgen"
+ fi
fi
}