Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 7 additions & 20 deletions src/coreclr/build-runtime.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down Expand Up @@ -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 (
Expand Down
21 changes: 7 additions & 14 deletions src/coreclr/build-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="$?"
Expand Down