From b155a1781d1a7b3eb803e747109ce8b87833df01 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Mon, 12 Feb 2024 15:08:04 -0800 Subject: [PATCH 1/2] remove edk2-basetools Removes edk2-basetools from pip-requirements.txt and any usage of it in the CISettings.py. The is done as there are changes in the build tools python source code that are available locally in BaseTools (as i --- .pytool/CISettings.py | 50 +------------------------------------------ pip-requirements.txt | 1 - 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py index 228a34d9..7ba61dca 100644 --- a/.pytool/CISettings.py +++ b/.pytool/CISettings.py @@ -16,13 +16,7 @@ from edk2toollib.utility_functions import GetHostInfo from pathlib import Path -try: - # May not be present until submodules are populated - root = Path(__file__).parent.parent.resolve() - sys.path.append(str(root / 'MU_BASECORE' / '.pytool' / 'Plugin' / 'CodeQL' / 'integration')) - import stuart_codeql as codeql_helpers -except ImportError: - pass +from edk2toolext import codeql as codeql_helpers class Settings( @@ -37,7 +31,6 @@ def __init__(self): self.ActualTargets = [] self.ActualArchitectures = [] self.ActualToolChainTag = "" - self.UseBuiltInBaseTools = None self.ActualScopes = None # ####################################################################################### # @@ -45,36 +38,12 @@ 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) except NameError: pass 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) except NameError: @@ -166,23 +135,6 @@ def GetActiveScopes(self): 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 # noqa: F401 - - self.UseBuiltInBaseTools = True - except ImportError: - self.UseBuiltInBaseTools = False - pass - - if self.UseBuiltInBaseTools is 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") - if is_linux and self.ActualToolChainTag.upper().startswith("GCC"): if "AARCH64" in self.ActualArchitectures: scopes += ("gcc_aarch64_linux",) diff --git a/pip-requirements.txt b/pip-requirements.txt index 843cf82e..28cfe48e 100644 --- a/pip-requirements.txt +++ b/pip-requirements.txt @@ -14,7 +14,6 @@ edk2-pytool-library==0.21.2 edk2-pytool-extensions==0.27.2 -edk2-basetools==0.1.49 antlr4-python3-runtime==4.13.1 xmlschema==3.0.1 regex==2023.12.25 From ec3b57d6d8676def8935ff9a6e672c63cc6f76d3 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Mon, 12 Feb 2024 15:22:46 -0800 Subject: [PATCH 2/2] update --- .pytool/CISettings.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py index 7ba61dca..e6a2002c 100644 --- a/.pytool/CISettings.py +++ b/.pytool/CISettings.py @@ -6,7 +6,6 @@ import glob import os import logging -import sys from edk2toolext.environment import shell_environment from edk2toolext.invocables.edk2_ci_build import CiBuildSettingsManager from edk2toolext.invocables.edk2_ci_setup import CiSetupSettingsManager @@ -14,8 +13,6 @@ from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager from edk2toollib.utility_functions import GetHostInfo -from pathlib import Path - from edk2toolext import codeql as codeql_helpers