From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mx.groups.io with SMTP id smtpd.web12.649.1666030023055107980 for ; Mon, 17 Oct 2022 11:07:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YsStnVvf; spf=pass (domain: gmail.com, ip: 209.85.216.44, mailfrom: joey.vagedes@gmail.com) Received: by mail-pj1-f44.google.com with SMTP id o17-20020a17090aac1100b0020d98b0c0f4so13616864pjq.4 for ; Mon, 17 Oct 2022 11:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7O/xpINvgoshIgoWQjA0WMAauGYBYrLXnqWrqcENjUc=; b=YsStnVvf97yFgNjD68VX54T1IA0+G54OM26w7HEsHYTIrzBnBRiIuANglvWoilo/Zq TCJ5MpmPRRKtxIwC4jHjsBzdJR53UYA9WdwopOUShJCcGZmwm+GI9KsgKDn+RrsXtum5 ZkrdGki4sRPK77UQUk3lXJILDK3Q9naXNzmKU0x5ja4GGG7LRzFss4t55DXRAn8gwX5c ++inGva1cB1Q6f23s5GH+9TUistEKdSPv5jpV2cbl2DMM6jzo5ZotcinCWKsGempulcJ oUvh6W8lCO+GtQlvpaCY9adxwgE5UWQn396zM7JF/YNU5I3j8rqz14ed0npCKfwUM9Tt u1mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7O/xpINvgoshIgoWQjA0WMAauGYBYrLXnqWrqcENjUc=; b=RkdUJr2oUwyXYVcJt6qC/q1NdqUGNYbwr5P5izSg3P9+NDORcRgx3UFzwAE8Wdn/wN fPHgJ0cLcvqptTEbI+zkTTuytWlMxpQLTrnC0rP8nHifuNYyCBCjsQD5EbqrVTbxvQs2 luZOVrueXEd1iF6eVOl5RCV3RRZQaR764VySJ0Law8VuxSk8TB+vE4nYANuZHO2KlNL7 M7RrxR5zqtF67UEJLV6kVeuFb5NPAWS4Y7kLN2z4vrbEzxpPBHnK+Wi4uutJQ75pTKhK CitpelLZ9p7i6jdc6NOtPrBPQmVbNLEmM/fc5zonnJS7gDK1uGCBkln797c5t7tx2W14 WdfA== X-Gm-Message-State: ACrzQf3xr9A4Wkyw9F07xA2lu+EUIAISiYrOvKY9NS7QAKjeyPfQbdoA axqXhdWZa0SQdF84fYWTMvmAXruckVCuCw== X-Google-Smtp-Source: AMsMyM5SFgArIs+NHRDoTsEToLaYct1jBYd9+DJN8Wsfbf9BAkTgIU6j7m3kLM52igPbnq3PyFbfYg== X-Received: by 2002:a17:903:210a:b0:183:e8a2:9757 with SMTP id o10-20020a170903210a00b00183e8a29757mr13183484ple.129.1666030022188; Mon, 17 Oct 2022 11:07:02 -0700 (PDT) Return-Path: Received: from localhost.localdomain (c-24-22-143-11.hsd1.wa.comcast.net. [24.22.143.11]) by smtp.gmail.com with ESMTPSA id e17-20020a17090301d100b001782398648dsm7011233plh.8.2022.10.17.11.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 11:07:01 -0700 (PDT) From: Joey Vagedes To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni Subject: [PATCH v1 3/3] EmulatorPkg/PlatformCI: Dyn BaseTools Selection Date: Mon, 17 Oct 2022 11:06:35 -0700 Message-Id: <20221017180635.488-4-joey.vagedes@gmail.com> X-Mailer: git-send-email 2.38.0.windows.1 In-Reply-To: <20221017180635.488-1-joey.vagedes@gmail.com> References: <20221017180635.488-1-joey.vagedes@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable When using pytools to build EmulatorPkg, add the ability to dynamically=0D determine which BaseTools to build with. The Pypi BaseTools will be used=0D if present, otherwise defaulting to the in-tree Basetools.=0D =0D Reference: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4085=0D =0D Cc: Andrew Fish =0D Cc: Ray Ni =0D =0D Signed-off-by: Joey Vagedes =0D ---=0D EmulatorPkg/PlatformCI/PlatformBuild.py | 37 ++++++++++++++++++--=0D 1 file changed, 35 insertions(+), 2 deletions(-)=0D =0D diff --git a/EmulatorPkg/PlatformCI/PlatformBuild.py b/EmulatorPkg/Platform= CI/PlatformBuild.py=0D index 6defbf6ef1..d6d37f6053 100644=0D --- a/EmulatorPkg/PlatformCI/PlatformBuild.py=0D +++ b/EmulatorPkg/PlatformCI/PlatformBuild.py=0D @@ -7,6 +7,7 @@=0D import os=0D import logging=0D import io=0D +import importlib=0D =0D from edk2toolext.environment import shell_environment=0D from edk2toolext.environment.uefi_build import UefiBuilder=0D @@ -40,6 +41,9 @@ class CommonPlatform():=0D =0D class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalS= ettingsManager):=0D =0D + def __init__(self):=0D + self.UseBuiltInBaseTools =3D None=0D +=0D def GetPackagesSupported(self):=0D ''' return iterable of edk2 packages supported by this build.=0D These should be edk2 workspace relative paths '''=0D @@ -100,7 +104,20 @@ class SettingsManager(UpdateSettingsManager, SetupSett= ingsManager, PrEvalSetting=0D =0D def GetActiveScopes(self):=0D ''' return tuple containing scopes that should be active for this = process '''=0D - return CommonPlatform.Scopes=0D + scopes =3D CommonPlatform.Scopes=0D +=0D + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX"=0D +=0D + if self.UseBuiltInBaseTools is None:=0D + if importlib.util.find_spec('edk2basetools') is not None:=0D + self.UseBuiltInBaseTools =3D True=0D + else:=0D + self.UseBuiltInBaseTools =3D False=0D +=0D + if self.UseBuiltInBaseTools is True:=0D + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',)=0D +=0D + return scopes=0D =0D def FilterPackagesToTest(self, changedFilesList: list, potentialPackag= esList: list) -> list:=0D ''' Filter other cases that this package should be built=0D @@ -135,6 +152,7 @@ class SettingsManager(UpdateSettingsManager, SetupSetti= ngsManager, PrEvalSetting=0D =0D class PlatformBuilder(UefiBuilder, BuildSettingsManager):=0D def __init__(self):=0D + self.UseBuiltInBaseTools =3D None=0D UefiBuilder.__init__(self)=0D =0D def AddCommandLineOptions(self, parserObj):=0D @@ -161,7 +179,22 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManage= r):=0D =0D def GetActiveScopes(self):=0D ''' return tuple containing scopes that should be active for this = process '''=0D - return CommonPlatform.Scopes=0D + scopes =3D CommonPlatform.Scopes=0D +=0D + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX"=0D +=0D + if self.UseBuiltInBaseTools is None:=0D + if importlib.util.find_spec('edk2basetools') is not None:=0D + self.UseBuiltInBaseTools =3D True=0D + logging.warning("Using Pip Tools based BaseTools")=0D + else:=0D + self.UseBuiltInBaseTools =3D False=0D + logging.warning("Falling back to using in-tree BaseTools")= =0D +=0D + if self.UseBuiltInBaseTools is True:=0D + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',)=0D +=0D + return scopes=0D =0D def GetName(self):=0D ''' Get the name of the repo, platform, or product being build '''= =0D -- =0D 2.38.0.windows.1=0D =0D