|
31 | 31 |
|
32 | 32 | cached_enivron = os.environ.copy() |
33 | 33 |
|
| 34 | +# This constant is used to indicate if the prebuilt HAF / TF-A binaries are in sync with the source code. |
| 35 | +# When the TF-A source code is updated in a way that is not compatible with the existing prebuilts, this should be set |
| 36 | +# to False, which ensures that HAF / TF-A will be build from source if supported. On Windows, TF-A cannot be built from |
| 37 | +# source, so the platform build will be skipped with a warning. |
| 38 | +HAF_TFA_EXTDEP_BINS_CURRENT = True |
| 39 | + |
34 | 40 | # Declare test whose failure will not return a non-zero exit code |
35 | 41 | FAILURE_EXEMPT_TESTS = { |
36 | 42 | # example "PiValueTestApp.efi": datetime.datetime(3141, 5, 9, 2, 6, 53, 589793), |
@@ -323,7 +329,22 @@ def SetPlatformEnv(self): |
323 | 329 | self.env.SetValue("CONF_AUTOGEN_INCLUDE_PATH", self.edk2path.GetAbsolutePathOnThisSystemFromEdk2RelativePath("QemuSbsaPkg", "Include"), "Platform Defined") |
324 | 330 | self.env.SetValue("MU_SCHEMA_DIR", self.edk2path.GetAbsolutePathOnThisSystemFromEdk2RelativePath("QemuSbsaPkg", "CfgData"), "Platform Defined") |
325 | 331 | self.env.SetValue("MU_SCHEMA_FILE_NAME", "QemuSbsaPkgCfgData.xml", "Platform Hardcoded") |
326 | | - self.env.SetValue("HAF_TFA_BUILD", "FALSE", "Platform Hardcoded") |
| 332 | + self.env.SetValue("HAF_TFA_BUILD", "FALSE", "Platform Hardcoded", overridable=True) |
| 333 | + |
| 334 | + # If HAF/TF-A binaries are not in sync, and we are on Windows, exit without building the platform because we |
| 335 | + # cannot compile TF-A on Windows. Otherwise, (if on Linux) we force the build of TF-A to ensure the binaries |
| 336 | + # are in sync. |
| 337 | + if not HAF_TFA_EXTDEP_BINS_CURRENT: |
| 338 | + if GetHostInfo().os == "Windows": |
| 339 | + logging.warning("Prebuilt TF-A binaries are no longer in sync with source code and cannot be built on Windows.") |
| 340 | + logging.warning("Only linux hosts are currently supported until the prebuilts can be updated.") |
| 341 | + logging.warning("Skipping build.") |
| 342 | + self.SkipPreBuild = True |
| 343 | + self.SkipBuild = True |
| 344 | + self.SkipPostBuild = True |
| 345 | + self.FlashImage = False |
| 346 | + else: |
| 347 | + self.env.SetValue("HAF_TFA_BUILD", "TRUE", "Hardcoded due to TF-A prebuilts being out of date.") |
327 | 348 |
|
328 | 349 | if self.Helper.generate_secureboot_pcds(self) != 0: |
329 | 350 | logging.error("Failed to generate include PCDs") |
|
0 commit comments