#!/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)
if [ "$__HostOS" == "Linux" ]; then
if [ -e /etc/os-release ]; then
source /etc/os-release
- if [[ $ID == "alpine" || $ID == "rhel" ]]; then
+ if [[ $ID == "rhel" ]]; then
# remove the last version digit
VERSION_ID=${VERSION_ID%.*}
fi
__HostDistroRid="$ID.$VERSION_ID-$__HostArch"
+ if [[ $ID == "alpine" ]]; then
+ __HostDistroRid="linux-musl-$__HostArch"
+ fi
elif [ -e /etc/redhat-release ]; then
local redhatRelease=$(</etc/redhat-release)
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
hash cmake 2>/dev/null || { echo >&2 "Please install cmake before running this script"; exit 1; }
- # Minimum required version of clang is version 3.9 for arm/armel cross build
+ # Minimum required version of clang is version 4.0 for arm/armel cross build
if [[ $__CrossBuild == 1 && ("$__BuildArch" == "arm" || "$__BuildArch" == "armel") ]]; then
- if ! [[ "$__ClangMajorVersion" -gt "3" || ( $__ClangMajorVersion == 3 && $__ClangMinorVersion == 9 ) ]]; then
- echo "Please install clang3.9 or latest for arm/armel cross build"; exit 1;
+ if ! [[ "$__ClangMajorVersion" -ge "4" ]]; then
+ echo "Please install clang4.0 or latest for arm/armel cross build"; exit 1;
fi
fi
if [[ ( $__SkipRestoreOptData == 0 ) && ( $__isMSBuildOnNETCoreSupported == 1 ) ]]; then
echo "Restoring the OptimizationData package"
- "$__ProjectRoot/run.sh" sync -optdata $__UnprocessedBuildArgs
+ "$__ProjectRoot/run.sh" build -optdata $__RunArgs $__UnprocessedBuildArgs
if [ $? != 0 ]; then
echo "Failed to restore the optimization data package."
exit 1
if [ "$__HostArch" == "x64" ]; then
export CROSSCOMPILE=1
fi
+ elif [[ ("$__BuildArch" == "arm64") && "$__CrossArch" == "x64" ]]; then
+ export CROSSCOMPILE=0
+ __SkipCrossArchBuild=0
else
# not supported
return
elif [ $__DoCrossArchBuild == 1 ]; then
if [[ ( "$__CrossArch" == "x86" ) && ( "$__BuildArch" == "arm" ) ]]; then
build_CoreLib_ni "$__CrossComponentBinDir/crossgen"
+ elif [[ ( "$__HostArch" == "x64" ) && ( "$__BuildArch" == "arm64" ) ]]; then
+ build_CoreLib_ni "$__CrossComponentBinDir/crossgen"
fi
fi
}
# Set default clang version
if [[ $__ClangMajorVersion == 0 && $__ClangMinorVersion == 0 ]]; then
- __ClangMajorVersion=3
- __ClangMinorVersion=9
+ if [[ "$__BuildArch" == "arm" || "$__BuildArch" == "armel" ]]; then
+ __ClangMajorVersion=5
+ __ClangMinorVersion=0
+ else
+ __ClangMajorVersion=3
+ __ClangMinorVersion=9
+ fi
fi
if [[ "$__BuildArch" == "armel" ]]; then