[edk2-devel] [PATCH] BaseTools:Change build cache option name from --binary- to --cache-

Steven Shi posted 1 patch 4 years, 10 months ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/build/build.py | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
[edk2-devel] [PATCH] BaseTools:Change build cache option name from --binary- to --cache-
Posted by Steven Shi 4 years, 10 months ago
https://bugzilla.tianocore.org/show_bug.cgi?id=1896

Current build cache is enabled by the below two options:
  --binary-destination, which is to produce the cache.
  --binary-source, which is to consume the cache.

Since current build cache does not only support to store the binary
file (e.g. .efi file) but also support the library and other type
files (.lib, .pdb, .inf etc), so the prefix "--binary-" will confuse
user with misunderstanding that the build cache will only support
binary file.

This patch is to change the build cache option prefix name from
--binary- to --cache- like below:
  --cache-destination
  --cache-source
---
 BaseTools/Source/Python/build/build.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index 2dca3c7b34..bc90a34bf5 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -731,13 +731,13 @@ class Build():
         GlobalData.gDisableIncludePathCheck = BuildOptions.DisableIncludePathCheck
 
         if GlobalData.gBinCacheDest and not GlobalData.gUseHashCache:
-            EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--binary-destination must be used together with --hash.")
+            EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--cache-destination must be used together with --hash.")
 
         if GlobalData.gBinCacheSource and not GlobalData.gUseHashCache:
-            EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--binary-source must be used together with --hash.")
+            EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--cache-source must be used together with --hash.")
 
         if GlobalData.gBinCacheDest and GlobalData.gBinCacheSource:
-            EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--binary-destination can not be used together with --binary-source.")
+            EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--cache-destination can not be used together with --cache-source.")
 
         if GlobalData.gBinCacheSource:
             BinCacheSource = os.path.normpath(GlobalData.gBinCacheSource)
@@ -746,7 +746,7 @@ class Build():
             GlobalData.gBinCacheSource = BinCacheSource
         else:
             if GlobalData.gBinCacheSource is not None:
-                EdkLogger.error("build", OPTION_VALUE_INVALID, ExtraData="Invalid value of option --binary-source.")
+                EdkLogger.error("build", OPTION_VALUE_INVALID, ExtraData="Invalid value of option --cache-source.")
 
         if GlobalData.gBinCacheDest:
             BinCacheDest = os.path.normpath(GlobalData.gBinCacheDest)
@@ -755,7 +755,7 @@ class Build():
             GlobalData.gBinCacheDest = BinCacheDest
         else:
             if GlobalData.gBinCacheDest is not None:
-                EdkLogger.error("build", OPTION_VALUE_INVALID, ExtraData="Invalid value of option --binary-destination.")
+                EdkLogger.error("build", OPTION_VALUE_INVALID, ExtraData="Invalid value of option --cache-destination.")
 
         if self.ConfDirectory:
             # Get alternate Conf location, if it is absolute, then just use the absolute directory name
@@ -2334,15 +2334,14 @@ def MyOptionParser():
         help="Specify the specific option to parse EDK UNI file. Must be one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI UNI file. "\
              "This option can also be specified by setting *_*_*_BUILD_FLAGS in [BuildOptions] section of platform DSC. If they are both specified, this value "\
              "will override the setting in [BuildOptions] section of platform DSC.")
-    Parser.add_option("-N", "--no-cache", action="store_true", dest="DisableCache", default=False, help="Disable build cache mechanism")
     Parser.add_option("--conf", action="store", type="string", dest="ConfDirectory", help="Specify the customized Conf directory.")
     Parser.add_option("--check-usage", action="store_true", dest="CheckUsage", default=False, help="Check usage content of entries listed in INF file.")
     Parser.add_option("--ignore-sources", action="store_true", dest="IgnoreSources", default=False, help="Focus to a binary build and ignore all source files")
     Parser.add_option("--pcd", action="append", dest="OptionPcd", help="Set PCD value by command line. Format: \"PcdName=Value\" ")
     Parser.add_option("-l", "--cmd-len", action="store", type="int", dest="CommandLength", help="Specify the maximum line length of build command. Default is 4096.")
     Parser.add_option("--hash", action="store_true", dest="UseHashCache", default=False, help="Enable hash-based caching during build process.")
-    Parser.add_option("--binary-destination", action="store", type="string", dest="BinCacheDest", help="Generate a cache of binary files in the specified directory.")
-    Parser.add_option("--binary-source", action="store", type="string", dest="BinCacheSource", help="Consume a cache of binary files from the specified directory.")
+    Parser.add_option("--cache-destination", action="store", type="string", dest="BinCacheDest", help="Generate build cache files in the specified directory.")
+    Parser.add_option("--cache-source", action="store", type="string", dest="BinCacheSource", help="Consume build cache files from the specified directory.")
     Parser.add_option("--genfds-multi-thread", action="store_true", dest="GenfdsMultiThread", default=False, help="Enable GenFds multi thread to generate ffs file.")
     Parser.add_option("--disable-include-path-check", action="store_true", dest="DisableIncludePathCheck", default=False, help="Disable the include path check for outside of package.")
     (Opt, Args) = Parser.parse_args()
-- 
2.17.1.windows.2


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42521): https://edk2.groups.io/g/devel/message/42521
Mute This Topic: https://groups.io/mt/32102383/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-