diff options
author | Jeremy Koritzinsky <jekoritz@microsoft.com> | 2021-07-14 01:26:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-14 01:26:47 +0300 |
commit | b1a8e3ed946f07297716dbde2456571407875dfd (patch) | |
tree | 44286ca23f96cc0185220e223d4b4fd0a2f48c38 /src | |
parent | 002370bd1b2d848dcf65ef11cf6b2f4592a6fb89 (diff) |
Do PGO restore as part of PGO path lookup. (#55584)
Diffstat (limited to 'src')
-rw-r--r-- | src/coreclr/build-runtime.cmd | 27 | ||||
-rwxr-xr-x | src/coreclr/build-runtime.sh | 21 |
2 files changed, 14 insertions, 34 deletions
diff --git a/src/coreclr/build-runtime.cmd b/src/coreclr/build-runtime.cmd index 731c255468e..ab805f370aa 100644 --- a/src/coreclr/build-runtime.cmd +++ b/src/coreclr/build-runtime.cmd @@ -246,10 +246,6 @@ if NOT "%__BuildType%"=="Release" ( set __PgoOptimize=0 ) -if %__PgoOptimize%==0 ( - set __RestoreOptData=0 -) - set "__BinDir=%__RootBinDir%\bin\coreclr\%__TargetOS%.%__BuildArch%.%__BuildType%" set "__IntermediatesDir=%__RootBinDir%\obj\coreclr\%__TargetOS%.%__BuildArch%.%__BuildType%" set "__LogsDir=%__RootBinDir%\log\!__BuildType!" @@ -335,29 +331,20 @@ REM === Restore optimization profile data REM === REM ========================================================================================= -set OptDataProjectFilePath=%__ProjectDir%\.nuget\optdata\optdata.csproj -if %__RestoreOptData% EQU 1 ( - echo %__MsgPrefix%Restoring the OptimizationData Package - set "__BinLog=\"%__LogsDir%\OptRestore_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog\"" - powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" /clp:nosummary %__ArcadeScriptArgs%^ - "%OptDataProjectFilePath%" /t:Restore^ - %__CommonMSBuildArgs% %__UnprocessedBuildArgs%^ - /nodereuse:false /bl:!__BinLog! - if not !errorlevel! == 0 ( - set __exitCode=!errorlevel! - echo %__ErrMsgPrefix%%__MsgPrefix%Error: Failed to restore the optimization data package. - goto ExitWithCode - ) -) set __PgoOptDataPath= if %__PgoOptimize% EQU 1 ( + set OptDataProjectFilePath=%__ProjectDir%\.nuget\optdata\optdata.csproj + set __OptDataRestoreArg= + if %__RestoreOptData% EQU 1 ( + set __OptDataRestoreArg=/restore + ) set PgoDataPackagePathOutputFile=%__IntermediatesDir%\optdatapath.txt set "__BinLog=\"%__LogsDir%\PgoVersionRead_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog\"" REM Parse the optdata package versions out of msbuild so that we can pass them on to CMake powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" /clp:nosummary %__ArcadeScriptArgs%^ - "%OptDataProjectFilePath%" /t:DumpPgoDataPackagePath^ - /p:PgoDataPackagePathOutputFile="!PgoDataPackagePathOutputFile!"^ + "!OptDataProjectFilePath!" /t:DumpPgoDataPackagePath^ + /p:PgoDataPackagePathOutputFile="!PgoDataPackagePathOutputFile!" !__OptDataRestoreArg!^ %__CommonMSBuildArgs% %__UnprocessedBuildArgs% /bl:!__BinLog! if not !errorlevel! == 0 ( diff --git a/src/coreclr/build-runtime.sh b/src/coreclr/build-runtime.sh index 0b39613aac3..1d9881f281b 100755 --- a/src/coreclr/build-runtime.sh +++ b/src/coreclr/build-runtime.sh @@ -39,27 +39,20 @@ setup_dirs_local() restore_optdata() { local OptDataProjectFilePath="$__ProjectRoot/.nuget/optdata/optdata.csproj" - if [[ "$__SkipRestoreOptData" == 0 && "$__IsMSBuildOnNETCoreSupported" == 1 ]]; then - echo "Restoring the OptimizationData package" - "$__RepoRootDir/eng/common/msbuild.sh" /clp:nosummary $__ArcadeScriptArgs \ - $OptDataProjectFilePath /t:Restore /m \ - -bl:"$__LogsDir/OptRestore_$__ConfigTriplet.binlog" \ - $__CommonMSBuildArgs $__UnprocessedBuildArgs \ - /nodereuse:false - local exit_code="$?" - if [[ "$exit_code" != 0 ]]; then - echo "${__ErrMsgPrefix}Failed to restore the optimization data package." - exit "$exit_code" - fi - fi if [[ "$__PgoOptimize" == 1 && "$__IsMSBuildOnNETCoreSupported" == 1 ]]; then # Parse the optdata package versions out of msbuild so that we can pass them on to CMake local PgoDataPackagePathOutputFile="${__IntermediatesDir}/optdatapath.txt" + local RestoreArg="" + + if [[ "$__SkipRestoreOptData" == "0" ]]; then + RestoreArg="/restore" + fi + # Writes into ${PgoDataPackagePathOutputFile} - "$__RepoRootDir/eng/common/msbuild.sh" /clp:nosummary $__ArcadeScriptArgs $OptDataProjectFilePath /t:DumpPgoDataPackagePath \ + "$__RepoRootDir/eng/common/msbuild.sh" /clp:nosummary $__ArcadeScriptArgs $OptDataProjectFilePath $RestoreArg /t:DumpPgoDataPackagePath \ ${__CommonMSBuildArgs} /p:PgoDataPackagePathOutputFile=${PgoDataPackagePathOutputFile} \ -bl:"$__LogsDir/PgoVersionRead_$__ConfigTriplet.binlog" > /dev/null 2>&1 local exit_code="$?" |