* [PATCH 2/4] Platform/Intel:Add build parameter to support Binary Cache
@ 2019-05-31 1:37 Fan, ZhijuX
2019-05-31 1:57 ` Chiu, Chasel
0 siblings, 1 reply; 2+ messages in thread
From: Fan, ZhijuX @ 2019-05-31 1:37 UTC (permalink / raw)
To: devel@edk2.groups.io
Cc: Gao, Liming, Feng, Bob C, Shi, Steven, Lu, Shifei A, Zhou, Bowen,
Oram, Isaac W, Chiu, Chasel, Kubacki, Michael A,
Desimone, Nathaniel L
[-- Attachment #1: Type: text/plain, Size: 3595 bytes --]
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1784
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1785
Need extend the options in the Intel/build_bios.py file
to support Binary Cache.
--hash:
Enable hash-based caching during build process.
--binary-destination:
Generate a cache of binary files in the specified directory.
--binary-source:
Consume a cache of binary files from the specified directory.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Shifei A Lu <shifei.a.lu@intel.com>
Cc: Xiaohu Zhou <bowen.zhou@intel.com>
Cc: Isaac W Oram <isaac.w.oram@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
---
Platform/Intel/build_bios.py | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/Platform/Intel/build_bios.py b/Platform/Intel/build_bios.py
index 9f8d78f6e8..628b127417 100644
--- a/Platform/Intel/build_bios.py
+++ b/Platform/Intel/build_bios.py
@@ -333,6 +333,7 @@ def build(config):
print(" SILENT_MODE = ", config.get("SILENT_MODE"))
print(" REBUILD_MODE = ", config.get("REBUILD_MODE"))
print(" BUILD_ROM_ONLY = ", config.get("BUILD_ROM_ONLY"))
+ print(" BINARY_CACHE_CMD_LINE = ", config.get("HASH"), config.get("BINARY_CACHE_CMD_LINE"))
print("==========================================")
command = ["build", "-n", config["NUMBER_OF_PROCESSORS"]]
@@ -343,6 +344,10 @@ def build(config):
if config["EXT_BUILD_FLAGS"] and config["EXT_BUILD_FLAGS"] != "":
command.append(config["EXT_BUILD_FLAGS"])
+ if config.get('BINARY_CACHE_CMD_LINE'):
+ command.append(config['HASH'])
+ command.append(config['BINARY_CACHE_CMD_LINE'])
+
if config.get("SILENT_MODE", "FALSE") == "TRUE":
command.append("--silent")
command.append("--quiet")
@@ -848,6 +853,17 @@ def get_cmd_config_arguments(arguments):
if arguments.fspapi is True:
result["API_MODE_FSP_WRAPPER_BUILD"] = "TRUE"
+ if not arguments.UseHashCache:
+ result['BINARY_CACHE_CMD_LINE'] = ''
+ elif arguments.BinCacheDest:
+ result['HASH'] = '--hash'
+ result['BINARY_CACHE_CMD_LINE'] = '--binary-destination=%s' % arguments.BinCacheDest
+ elif arguments.BinCacheSource:
+ result['HASH'] = '--hash'
+ result['BINARY_CACHE_CMD_LINE'] = '--binary-source=%s' % arguments.BinCacheSource
+ else:
+ result['BINARY_CACHE_CMD_LINE'] = ''
+
return result
@@ -924,6 +940,17 @@ def get_cmd_arguments(build_config):
parser.add_argument("--fspapi", help="API mode fsp wrapper build enabled",
action='store_true', dest="fspapi")
+ parser.add_argument("--hash", action="store_true", dest="UseHashCache", default=False,
+ help="Enable hash-based caching during build process.")
+
+ parser.add_argument("--binary-destination", help="Generate a cache of binary \
+ files in the specified directory.",
+ action='store', dest="BinCacheDest")
+
+ parser.add_argument("--binary-source", help="Consume a cache of binary files \
+ from the specified directory.",
+ action='store', dest="BinCacheSource")
+
return parser.parse_args()
--
2.14.1.windows.1
[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4671 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/4] Platform/Intel:Add build parameter to support Binary Cache
2019-05-31 1:37 [PATCH 2/4] Platform/Intel:Add build parameter to support Binary Cache Fan, ZhijuX
@ 2019-05-31 1:57 ` Chiu, Chasel
0 siblings, 0 replies; 2+ messages in thread
From: Chiu, Chasel @ 2019-05-31 1:57 UTC (permalink / raw)
To: Fan, ZhijuX, devel@edk2.groups.io
Cc: Gao, Liming, Feng, Bob C, Shi, Steven, Lu, Shifei A, Zhou, Bowen,
Oram, Isaac W, Kubacki, Michael A, Desimone, Nathaniel L
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
> -----Original Message-----
> From: Fan, ZhijuX
> Sent: Friday, May 31, 2019 9:38 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C <bob.c.feng@intel.com>;
> Shi, Steven <steven.shi@intel.com>; Lu, Shifei A <shifei.a.lu@intel.com>; Zhou,
> Bowen <bowen.zhou@intel.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> Chiu, Chasel <chasel.chiu@intel.com>; Kubacki, Michael A
> <michael.a.kubacki@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [PATCH 2/4] Platform/Intel:Add build parameter to support Binary
> Cache
>
> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1784
> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1785
>
> Need extend the options in the Intel/build_bios.py file to support Binary Cache.
>
> --hash:
> Enable hash-based caching during build process.
> --binary-destination:
> Generate a cache of binary files in the specified directory.
> --binary-source:
> Consume a cache of binary files from the specified directory.
>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Steven Shi <steven.shi@intel.com>
> Cc: Shifei A Lu <shifei.a.lu@intel.com>
> Cc: Xiaohu Zhou <bowen.zhou@intel.com>
> Cc: Isaac W Oram <isaac.w.oram@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Michael Kubacki <michael.a.kubacki@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
> ---
> Platform/Intel/build_bios.py | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/Platform/Intel/build_bios.py b/Platform/Intel/build_bios.py index
> 9f8d78f6e8..628b127417 100644
> --- a/Platform/Intel/build_bios.py
> +++ b/Platform/Intel/build_bios.py
> @@ -333,6 +333,7 @@ def build(config):
> print(" SILENT_MODE = ", config.get("SILENT_MODE"))
> print(" REBUILD_MODE = ", config.get("REBUILD_MODE"))
> print(" BUILD_ROM_ONLY = ", config.get("BUILD_ROM_ONLY"))
> + print(" BINARY_CACHE_CMD_LINE = ", config.get("HASH"),
> + config.get("BINARY_CACHE_CMD_LINE"))
> print("==========================================")
>
> command = ["build", "-n", config["NUMBER_OF_PROCESSORS"]] @@
> -343,6 +344,10 @@ def build(config):
> if config["EXT_BUILD_FLAGS"] and config["EXT_BUILD_FLAGS"] != "":
> command.append(config["EXT_BUILD_FLAGS"])
>
> + if config.get('BINARY_CACHE_CMD_LINE'):
> + command.append(config['HASH'])
> + command.append(config['BINARY_CACHE_CMD_LINE'])
> +
> if config.get("SILENT_MODE", "FALSE") == "TRUE":
> command.append("--silent")
> command.append("--quiet")
> @@ -848,6 +853,17 @@ def get_cmd_config_arguments(arguments):
> if arguments.fspapi is True:
> result["API_MODE_FSP_WRAPPER_BUILD"] = "TRUE"
>
> + if not arguments.UseHashCache:
> + result['BINARY_CACHE_CMD_LINE'] = ''
> + elif arguments.BinCacheDest:
> + result['HASH'] = '--hash'
> + result['BINARY_CACHE_CMD_LINE'] = '--binary-destination=%s' %
> arguments.BinCacheDest
> + elif arguments.BinCacheSource:
> + result['HASH'] = '--hash'
> + result['BINARY_CACHE_CMD_LINE'] = '--binary-source=%s' %
> arguments.BinCacheSource
> + else:
> + result['BINARY_CACHE_CMD_LINE'] = ''
> +
> return result
>
>
> @@ -924,6 +940,17 @@ def get_cmd_arguments(build_config):
> parser.add_argument("--fspapi", help="API mode fsp wrapper build
> enabled",
> action='store_true', dest="fspapi")
>
> + parser.add_argument("--hash", action="store_true",
> dest="UseHashCache", default=False,
> + help="Enable hash-based caching during build
> + process.")
> +
> + parser.add_argument("--binary-destination", help="Generate a cache of
> binary \
> + files in the specified directory.",
> + action='store', dest="BinCacheDest")
> +
> + parser.add_argument("--binary-source", help="Consume a cache of binary
> files \
> + from the specified directory.",
> + action='store', dest="BinCacheSource")
> +
> return parser.parse_args()
>
>
> --
> 2.14.1.windows.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-31 1:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-31 1:37 [PATCH 2/4] Platform/Intel:Add build parameter to support Binary Cache Fan, ZhijuX
2019-05-31 1:57 ` Chiu, Chasel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox