From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: steven.shi@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Wed, 08 May 2019 20:21:49 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2019 20:21:46 -0700 X-ExtLoop1: 1 Received: from jshi19-mobl.ccr.corp.intel.com ([10.249.170.209]) by fmsmga005.fm.intel.com with ESMTP; 08 May 2019 20:21:46 -0700 From: "Steven Shi" To: devel@edk2.groups.io Cc: chasel.chiu@intel.com, shifei.a.lu@intel.com, liming.gao@intel.com, dandan.bi@intel.com, michael.a.kubacki@intel.com Subject: [PATCH 1/2] KabylakeOpenBoardPkg/KabylakeRvp3: Extend build to support Binary Cache Date: Thu, 9 May 2019 11:21:18 +0800 Message-Id: <20190509032119.2084-2-steven.shi@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 In-Reply-To: <20190509032119.2084-1-steven.shi@intel.com> References: <20190509032119.2084-1-steven.shi@intel.com> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1784 Need extend the options in the Kabylake build bld.bat file to support Binary Cache. --- .../KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat index e0ad5eefdc..f9a12d565a 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat @@ -68,6 +68,11 @@ copy /y /b %WORKSPACE_FSP_BIN%\KabylakeFspBinPkg\Fsp_Rebased_S.fd+%WORKSPACE_FSP @SET REBUILD_MODE= @SET BUILD_ROM_ONLY= +@if not defined BINARY_CACHE_PATH ( + echo Info: BINARY_CACHE_PATH is empty, use BinCache as default + SET BINARY_CACHE_PATH=BinCache +) + :: Loop through arguements until all are processed :BUILD_FLAGS_LOOP @@ -93,6 +98,20 @@ copy /y /b %WORKSPACE_FSP_BIN%\KabylakeFspBinPkg\Fsp_Rebased_S.fd+%WORKSPACE_FSP shift goto BUILD_FLAGS_LOOP ) + +@if "%~1" == "cache-produce" ( + SET BINARY_CACHE_CMD_LINE= --hash --binary-destination=%BINARY_CACHE_PATH% + shift + goto BUILD_FLAGS_LOOP +) + +@if "%~1" == "cache-consume" ( + SET BINARY_CACHE_CMD_LINE= --hash --binary-source=%BINARY_CACHE_PATH% + shift + goto BUILD_FLAGS_LOOP +) + + :: Unknown build flag. shift goto BUILD_FLAGS_LOOP @@ -105,11 +124,12 @@ goto BUILD_FLAGS_LOOP @echo SILENT_MODE = %SILENT_MODE% @echo REBUILD_MODE = %REBUILD_MODE% @echo BUILD_ROM_ONLY = %BUILD_ROM_ONLY% +@echo BINARY_CACHE_CMD_LINE = %BINARY_CACHE_CMD_LINE% @echo. @if %SILENT_MODE% EQU TRUE goto BldSilent -call build -n %NUMBER_OF_PROCESSORS% %REBUILD_MODE% %EXT_BUILD_FLAGS% +call build -n %NUMBER_OF_PROCESSORS% %REBUILD_MODE% %EXT_BUILD_FLAGS% %BINARY_CACHE_CMD_LINE% @if %ERRORLEVEL% NEQ 0 goto BldFail @echo. @@ -128,7 +148,7 @@ call %WORKSPACE_PLATFORM%\%PROJECT%\postbuild.bat %BUILD_ROM_ONLY% @echo ************************************************************************ >> Build.log @echo. >> Build.log -call build -n %NUMBER_OF_PROCESSORS% %REBUILD_MODE% %EXT_BUILD_FLAGS% 1>>Build.log 2>&1 +call build -n %NUMBER_OF_PROCESSORS% %REBUILD_MODE% %EXT_BUILD_FLAGS% %BINARY_CACHE_CMD_LINE% 1>>Build.log 2>&1 @if %ERRORLEVEL% NEQ 0 goto BldFail @echo. >> Build.log -- 2.17.1.windows.2