summaryrefslogtreecommitdiff
path: root/build-test.sh
diff options
context:
space:
mode:
authorSven Boemer <sbomer@gmail.com>2019-01-31 00:24:33 (GMT)
committerGitHub <noreply@github.com>2019-01-31 00:24:33 (GMT)
commit1b43bd8139d053e24ec51c193054555e3352371a (patch)
treea61f5c4012ef53d7058edb6ff2fe26fbe07ddccb /build-test.sh
parentdbb42159bba3d147559032ee496b55aa7e94e6f7 (diff)
downloadcoreclr-1b43bd8139d053e24ec51c193054555e3352371a.zip
coreclr-1b43bd8139d053e24ec51c193054555e3352371a.tar.gz
coreclr-1b43bd8139d053e24ec51c193054555e3352371a.tar.bz2
Remove run.exe and config.json (#21608)
This moves us one step away from buildtools and towards arcade. This replaces run.sh and run.cmd (and all invocations) with "dotnet.sh msbuild" and "msbuild.cmd". - I'm using these wrapper scripts for now instead of those in eng/common in order to retain the very helpful "Running <command>" output in the build logs. - I'm using msbuild.cmd instead of dotnet.sh to match the current behavior that uses desktop msbuild on windows, instead of dotnet. All of the arguments that used to be implicitly generated by run.exe and config.json are now explicit, resulting in longer (but easier to copy+paste) commands. Some of these arguments are likely unnecessary, but in this change my goal is just to match the run.exe behavior. Later, I would like to go through and clean up parameters that don't need to be passed in every invocation. I might also consider moving more of the common arguments out into variables in a later change. Some of the wrapper scripts now have limited support for parsing "-Argument=Value" style parameters, to support our existing buildpipeline infrastructure, since I thought this was easier to test than changing our buildpipeline definitions. We can remove that parsing logic once we stop using buildpipeline (which has happened at this point). Some subtle parts of the change: * Add msbuild.cmd This simulates the behavior of Tools\msbuild.cmd, which calls desktop msbuild. * Fix BuildOS processing in package build and publish Previously, config.json had its own processing that would set OSName. Instead, we now pass it in explicitly where it's needed (building packages), or not at all (publishing them). * Handle "=" in publish-packages.cmd and other scripts This seems necessary to properly handle the azure access token * Set __BuildOS in PublishPackages Required for cases where the build OS isn't detected during the build such as freebsd. * Use dotnet msbuild in runtest.py This prevents us from having to deal with different quote escape behavior on windows and linux. Previously, arguments like fileloggerparameters and the logger were given quotes to escape semicolons in the argument. On unix, this prevented the argument from being split up by bash. On windows, it seems that the run.cmd/run.exe tools would prevent the extra quotes from being passed to msbuild.exe (desktop msbuild would choke on the quotes if they were passed along). Unlike desktop msbuild, dotnet msbuild is able to parse the quoted strings, so we simply psas the quoted arguments directly to it on windows. We may be able to do the same on unix. * Fix build-test.sh problem with BuildOS When copying native files during the unix test build, we rely on __BuildOS being set. Fixing the import order and always setting __BuildOS fixes this. We should eventually fix the inconsistent use of BuildOS vs __BuildOS.
Diffstat (limited to 'build-test.sh')
-rwxr-xr-xbuild-test.sh60
1 files changed, 37 insertions, 23 deletions
diff --git a/build-test.sh b/build-test.sh
index 7542edb..a0ba5da 100755
--- a/build-test.sh
+++ b/build-test.sh
@@ -189,10 +189,10 @@ generate_layout()
# ===
# =========================================================================================
- build_MSBuild_projects "Restore_Packages" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "-BatchRestorePackages"
+ build_MSBuild_projects "Restore_Packages" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "/t:BatchRestorePackages"
if [ -n "$__UpdateInvalidPackagesArg" ]; then
- __up=-updateinvalidpackageversion
+ __up="/t:UpdateInvalidPackageVersions"
fi
echo "${__MsgPrefix}Creating test overlay..."
@@ -209,7 +209,7 @@ generate_layout()
mkdir -p $CORE_ROOT
- build_MSBuild_projects "Tests_Overlay_Managed" "${__ProjectDir}/tests/runtest.proj" "Creating test overlay" "-testOverlay"
+ build_MSBuild_projects "Tests_Overlay_Managed" "${__ProjectDir}/tests/runtest.proj" "Creating test overlay" "/t:CreateTestOverlay"
chmod +x $__BinDir/corerun
chmod +x $__BinDir/crossgen
@@ -230,7 +230,7 @@ generate_testhost()
mkdir -p $TEST_HOST
- build_MSBuild_projects "Tests_Generate_TestHost" "${__ProjectDir}/tests/runtest.proj" "Creating test host" "-testHost"
+ build_MSBuild_projects "Tests_Generate_TestHost" "${__ProjectDir}/tests/runtest.proj" "Creating test host" "/t:CreateTestHost"
}
@@ -293,7 +293,7 @@ build_Tests()
# =========================================================================================
if [ ${__SkipRestorePackages} != 1 ]; then
- build_MSBuild_projects "Restore_Product" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "-BatchRestorePackages"
+ build_MSBuild_projects "Restore_Product" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "/t:BatchRestorePackages"
fi
if [ $__SkipNative != 1 ]; then
@@ -316,7 +316,7 @@ build_Tests()
else
echo "Checking the Managed Tests Build..."
- build_MSBuild_projects "Check_Test_Build" "${__ProjectDir}/tests/runtest.proj" "Check Test Build" "-ExtraParameters:/t:CheckTestBuild"
+ build_MSBuild_projects "Check_Test_Build" "${__ProjectDir}/tests/runtest.proj" "Check Test Build" "/t:CheckTestBuild"
if [ $? -ne 0 ]; then
echo "${__MsgPrefix}Error: Check Test Build failed."
@@ -330,7 +330,7 @@ build_Tests()
build_test_wrappers
if [ -n "$__UpdateInvalidPackagesArg" ]; then
- __up=-updateinvalidpackageversion
+ __up="/t:UpdateInvalidPackageVersions"
fi
generate_layout
@@ -358,10 +358,10 @@ build_MSBuild_projects()
__BuildErr="$__LogsDir/${__BuildLogRootName}.${__BuildOS}.${__BuildArch}.${__BuildType}.err"
# Use binclashlogger by default if no other logger is specified
- if [[ "${extraBuildParameters[*]}" == *"-MsBuildEventLogging"* ]]; then
- msbuildEventLogging=""
+ if [[ "${extraBuildParameters[*]}" == *"/l:"* ]]; then
+ __msbuildEventLogging=
else
- msbuildEventLogging="-MsBuildEventLogging=\"/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log\""
+ __msbuildEventLogging="/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll\;LogFile=binclash.log"
fi
if [[ "$subDirectoryName" == "Tests_Managed" ]]; then
@@ -389,13 +389,17 @@ build_MSBuild_projects()
export TestBuildSlice=$slice
# Generate build command
- buildArgs=("-Project=$projectName" "-MsBuildLog=${__msbuildLog}" "-MsBuildWrn=${__msbuildWrn}" "-MsBuildErr=${__msbuildErr}")
- buildArgs+=("$msbuildEventLogging")
+ buildArgs=("/nologo" "/verbosity:minimal" "/clp:Summary")
+ buildArgs+=("/p:RestoreDefaultOptimizationDataPackage=false" "/p:PortableBuild=true")
+ buildArgs+=("/p:UsePartialNGENOptimization=false" "/maxcpucount")
+
+ buildArgs+=("$projectName" "${__msbuildLog}" "${__msbuildWrn}" "${__msbuildErr}")
+ buildArgs+=("$__msbuildEventLogging")
buildArgs+=("${extraBuildParameters[@]}")
- buildArgs+=("${__RunArgs[@]}")
+ buildArgs+=("${__CommonMSBuildArgs[@]}")
buildArgs+=("${__UnprocessedBuildArgs[@]}")
- nextCommand="\"$__ProjectRoot/run.sh\" build ${buildArgs[@]}"
+ nextCommand="\"$__ProjectRoot/dotnet.sh\" msbuild ${buildArgs[@]}"
echo "Building step '$stepName' slice=$slice via $nextCommand"
eval $nextCommand
@@ -417,13 +421,17 @@ build_MSBuild_projects()
__msbuildErr="\"/flp2:ErrorsOnly;LogFile=${__BuildErr}\""
# Generate build command
- buildArgs=("-Project=$projectName" "-MsBuildLog=${__msbuildLog}" "-MsBuildWrn=${__msbuildWrn}" "-MsBuildErr=${__msbuildErr}")
- buildArgs+=("$msbuildEventLogging")
+ buildArgs=("/nologo" "/verbosity:minimal" "/clp:Summary")
+ buildArgs+=("/p:RestoreDefaultOptimizationDataPackage=false" "/p:PortableBuild=true")
+ buildArgs+=("/p:UsePartialNGENOptimization=false" "/maxcpucount")
+
+ buildArgs+=("$projectName" "${__msbuildLog}" "${__msbuildWrn}" "${__msbuildErr}")
+ buildArgs+=("$__msbuildEventLogging")
buildArgs+=("${extraBuildParameters[@]}")
- buildArgs+=("${__RunArgs[@]}")
+ buildArgs+=("${__CommonMSBuildArgs[@]}")
buildArgs+=("${__UnprocessedBuildArgs[@]}")
- nextCommand="\"$__ProjectRoot/run.sh\" build ${buildArgs[@]}"
+ nextCommand="\"$__ProjectRoot/dotnet.sh\" msbuild ${buildArgs[@]}"
echo "Building step '$stepName' via $nextCommand"
eval $nextCommand
@@ -468,7 +476,13 @@ build_native_projects()
__versionSourceFile="$intermediatesForBuild/version.cpp"
if [ $__SkipGenerateVersion == 0 ]; then
pwd
- "$__ProjectRoot/run.sh" build -Project=$__ProjectDir/build.proj -generateHeaderUnix -NativeVersionSourceFile=$__versionSourceFile -MsBuildEventLogging="/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log" $__RunArgs $__UnprocessedBuildArgs
+ $__ProjectRoot/dotnet.sh msbuild /nologo /verbosity:minimal /clp:Summary \
+ /p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true \
+ /p:UsePartialNGENOptimization=false /maxcpucount \
+ $__ProjectDir/build.proj /t:GenerateVersionHeader \
+ /p:GenerateVersionHeader=true /p:NativeVersionSourceFile=$__versionSourceFile \
+ /l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll\;LogFile=binclash.log \
+ $__CommonMSBuildArgs $__UnprocessedBuildArgs
else
# Generate the dummy version.cpp, but only if it didn't exist to make sure we don't trigger unnecessary rebuild
__versionSourceLine="static char sccsid[] __attribute__((used)) = \"@(#)No version information produced\";"
@@ -636,7 +650,7 @@ __RootBinDir="$__ProjectDir/bin"
__BuildToolsDir="$__ProjectDir/Tools"
__DotNetCli="${__BuildToolsDir}/dotnetcli/dotnet"
__UnprocessedBuildArgs=
-__RunArgs=
+__CommonMSBuildArgs=
__MSBCleanBuildArgs=
__UseNinja=0
__VerboseBuild=0
@@ -839,7 +853,7 @@ while :; do
priority1)
__priority1=1
- __UnprocessedBuildArgs+=("-priority=1")
+ __UnprocessedBuildArgs+=("/p:CLRTestPriorityToBuild=1")
;;
*)
@@ -863,12 +877,12 @@ else
__NumProc=$(nproc --all)
fi
-__RunArgs=("-BuildArch=$__BuildArch" "-BuildType=$__BuildType" "-BuildOS=$__BuildOS")
+__CommonMSBuildArgs=("/p:__BuildArch=$__BuildArch" "/p:__BuildType=$__BuildType" "/p:__BuildOS=$__BuildOS")
# Configure environment if we are doing a verbose build
if [ $__VerboseBuild == 1 ]; then
export VERBOSE=1
- __RunArgs+=("-verbose")
+ __CommonMSBuildArgs+=("/v:detailed")
fi
# Set default clang version