summaryrefslogtreecommitdiff
path: root/.pytool/CISettings.py
diff options
context:
space:
mode:
Diffstat (limited to '.pytool/CISettings.py')
-rw-r--r--.pytool/CISettings.py57
1 files changed, 42 insertions, 15 deletions
diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py
index e6c5ac7..5f71eca 100644
--- a/.pytool/CISettings.py
+++ b/.pytool/CISettings.py
@@ -22,16 +22,24 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
self.ActualTargets = []
self.ActualArchitectures = []
self.ActualToolChainTag = ""
+ self.UseBuiltInBaseTools = None
+ self.ActualScopes = None
# ####################################################################################### #
# Extra CmdLine configuration #
# ####################################################################################### #
def AddCommandLineOptions(self, parserObj):
- pass
+ 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")
def RetrieveCommandLineOptions(self, args):
- pass
+ super().RetrieveCommandLineOptions(args)
+ if args.force_piptools:
+ self.UseBuiltInBaseTools = True
+ if args.no_piptools:
+ self.UseBuiltInBaseTools = False
# ####################################################################################### #
# Default Support for this Ci Build #
@@ -128,19 +136,38 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
def GetActiveScopes(self):
''' return tuple containing scopes that should be active for this process '''
- scopes = ("cibuild", "edk2-build", "host-based-test")
-
- self.ActualToolChainTag = shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "")
-
- if GetHostInfo().os.upper() == "LINUX" and self.ActualToolChainTag.upper().startswith("GCC"):
- if "AARCH64" in self.ActualArchitectures:
- scopes += ("gcc_aarch64_linux",)
- if "ARM" in self.ActualArchitectures:
- scopes += ("gcc_arm_linux",)
- if "RISCV64" in self.ActualArchitectures:
- scopes += ("gcc_riscv64_unknown",)
-
- return scopes
+ if self.ActualScopes is None:
+ scopes = ("cibuild", "edk2-build", "host-based-test")
+
+ 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")
+
+ if is_linux and self.ActualToolChainTag.upper().startswith("GCC"):
+ if "AARCH64" in self.ActualArchitectures:
+ scopes += ("gcc_aarch64_linux",)
+ if "ARM" in self.ActualArchitectures:
+ scopes += ("gcc_arm_linux",)
+ if "RISCV64" in self.ActualArchitectures:
+ scopes += ("gcc_riscv64_unknown",)
+ self.ActualScopes = scopes
+ return self.ActualScopes
def GetRequiredSubmodules(self):
''' return iterable containing RequiredSubmodule objects.