From c59beb4d7ede7e44735f8e9239c76c2bb3894f84 Mon Sep 17 00:00:00 2001 From: Bret Barkelew Date: Fri, 19 Apr 2019 21:49:02 +0000 Subject: [PATCH] Merged PR 1111: Work around a break in incremental builds. Incremental builds are broken in Mu release/201903 due to an improper use of unordered set() and dict() types. By pinning the PYTHONHASHSEED prior to calling build.py, we ensure that the order is at least consistent from build to build. --- MuEnvironment/UefiBuild.py | 10 ++++++++++ README.rst | 1 + 2 files changed, 11 insertions(+) diff --git a/MuEnvironment/UefiBuild.py b/MuEnvironment/UefiBuild.py index b5de626..714f39c 100644 --- a/MuEnvironment/UefiBuild.py +++ b/MuEnvironment/UefiBuild.py @@ -234,7 +234,17 @@ def Build(self): for key, value in buildvars.items(): params += " -D " + key + "=" + value output_stream = MuLogging.create_output_stream() + + env = ShellEnvironment.ShellEnvironment() + # WORKAROUND - Pin the PYTHONHASHSEED so that TianoCore build tools + # have consistent ordering. Addresses incremental builds. + pre_build_env_chk = env.checkpoint() + env.set_shell_var('PYTHONHASHSEED', '0') + env.log_environment() ret = RunCmd("build", params) + # WORKAROUND - Undo the workaround. + env.restore_checkpoint(pre_build_env_chk) + problems = MuLogging.scan_compiler_output(output_stream) MuLogging.remove_output_stream(output_stream) for level, problem in problems: diff --git a/README.rst b/README.rst index 64e0368..d862288 100644 --- a/README.rst +++ b/README.rst @@ -25,6 +25,7 @@ Version History Main Changes: - Errors and warnings from the compiler are now intermingled and displayed in the order that they are emitted. +- Add a workaround for incremental build break in Mu release/201903. Pinning PYTHONHASHSEED prevents unordered set() and dict() structures from changing build-to-build. 0.3.8