From 40bcfe3a6ba3eb98dd55fd60c157d131906e434e Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Mon, 28 Aug 2023 15:10:05 -0400 Subject: [PATCH] .pytool/CISettings.py: Set rust-ci scope and use in tree BaseTools The Rust BaseTool changes are not in the edk2-basetools PIP module, so this change updates CISettings.py to use the in tree tools by default. The `rust-ci` scope is added as an active scope so Rust related plugins like `RustHostUnitTestPlugin` will run. Signed-off-by: Michael Kubacki --- .pytool/CISettings.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py index e93f165ccb..0e106a270f 100644 --- a/.pytool/CISettings.py +++ b/.pytool/CISettings.py @@ -32,8 +32,10 @@ def __init__(self): self.ActualTargets = [] self.ActualArchitectures = [] self.ActualToolChainTag = "" - self.UseBuiltInBaseTools = None self.ActualScopes = None + # In tree BaseTools are required for Rust build support so enable + # it by default. + self.UseBuiltInBaseTools = False # ####################################################################################### # # Extra CmdLine configuration # @@ -42,7 +44,6 @@ def __init__(self): def AddCommandLineOptions(self, parserObj): group = parserObj.add_mutually_exclusive_group() group.add_argument("-force_piptools", "--fpt", dest="force_piptools", action="store_true", default=False, help="Force the system to use pip tools") - group.add_argument("-no_piptools", "--npt", dest="no_piptools", action="store_true", default=False, help="Force the system to not use pip tools") try: codeql_helpers.add_command_line_option(parserObj) @@ -51,10 +52,9 @@ def AddCommandLineOptions(self, parserObj): def RetrieveCommandLineOptions(self, args): super().RetrieveCommandLineOptions(args) + if args.force_piptools: self.UseBuiltInBaseTools = True - if args.no_piptools: - self.UseBuiltInBaseTools = False try: self.codeql = codeql_helpers.is_codeql_enabled_on_command_line(args) @@ -149,27 +149,17 @@ def SetTargets(self, list_of_requested_target): def GetActiveScopes(self): ''' return tuple containing scopes that should be active for this process ''' if self.ActualScopes is None: - scopes = ("cibuild", "edk2-build", "host-based-test") + scopes = ("cibuild", "edk2-build", "host-based-test", "rust-ci") self.ActualToolChainTag = shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "") is_linux = GetHostInfo().os.upper() == "LINUX" - if self.UseBuiltInBaseTools is None: - is_linux = GetHostInfo().os.upper() == "LINUX" - # try and import the pip module for basetools - try: - import edk2basetools - self.UseBuiltInBaseTools = True - except ImportError: - self.UseBuiltInBaseTools = False - pass - if self.UseBuiltInBaseTools == True: scopes += ('pipbuild-unix',) if is_linux else ('pipbuild-win',) logging.warning("Using Pip Tools based BaseTools") else: - logging.warning("Falling back to using in-tree BaseTools") + logging.info("Using in-tree BaseTools") if is_linux and self.ActualToolChainTag.upper().startswith("GCC"): if "AARCH64" in self.ActualArchitectures: