From nobody Sat May 18 20:15:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+95299+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95299+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1666054165; cv=none; d=zohomail.com; s=zohoarc; b=UGt84Bi6bnTLXvI23DzoJMvPAz0oBxoQKVOTmYpfTrgBCXTOVIq8CG91j9Ax9I4SFf45csiJ+kvOItXvoClJa/hp4Bo2yxAxFTTzUyBHyFUxqf6HfQYuLu2YKyP24mUVLFM5WMpJTacaAgKzPHJomrD3zpP7QOoRn5la4+lVf/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666054165; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=4evfzpx+6oZRzLbtvi8MkbYLnni7ZUD1Mk5EE6eMd0U=; b=ZlRjoYVmClcmStIsfX6uHb2GW8VW/REkL9ovK8/ZMLuXoLUlkZQLOv1RXVjYmHHGq+wObI9OWqvL4jKXuF9AN9wxaYqTzLmEAj40uIHvD5Lt/qQCwWBLYtO+0YXzsT4GKENHbEa5EnFVsh34BxI4IrYYnrxEax4m9cIvmXtrIno= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95299+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1666054165100118.02734052525682; Mon, 17 Oct 2022 17:49:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dmwKYY1788612xkz4BulTj4J; Mon, 17 Oct 2022 17:49:24 -0700 X-Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web08.655.1666030020985710693 for ; Mon, 17 Oct 2022 11:07:01 -0700 X-Received: by mail-pj1-f46.google.com with SMTP id 70so11676184pjo.4 for ; Mon, 17 Oct 2022 11:07:00 -0700 (PDT) X-Gm-Message-State: WEMVVwU7CZEfL2oCrZbBFhtxx1787277AA= X-Google-Smtp-Source: AMsMyM7FCUTDobtvDkaeMG/t2THZOi2nAB+zC6sT+lwzteLn/YHvvJdgqSZpy4Wph6FOnitnZ7djvw== X-Received: by 2002:a17:90b:4c02:b0:20a:7d26:149 with SMTP id na2-20020a17090b4c0200b0020a7d260149mr35512057pjb.134.1666030020041; Mon, 17 Oct 2022 11:07:00 -0700 (PDT) X-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.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 11:06:59 -0700 (PDT) From: Joey Vagedes To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann , Jiewen Yao , Jordan Justen Subject: [edk2-devel] [PATCH v1 1/3] ArmVirtPkg/PlatformCI: Dyn BaseTools Selection Date: Mon, 17 Oct 2022 11:06:33 -0700 Message-Id: <20221017180635.488-2-joey.vagedes@gmail.com> In-Reply-To: <20221017180635.488-1-joey.vagedes@gmail.com> References: <20221017180635.488-1-joey.vagedes@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,joey.vagedes@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1666054164; bh=YsuP2+s2m2qkfIDv7ikYxI2HGweUqxWHeeGSLlUjDcI=; h=Cc:Date:From:Reply-To:Subject:To; b=wPQOsgiKxddCEb/H/JAO/dOBR1hHhbCsLWuN7CCKO5F1De2AFIxblEyC9+mXqCd3HxJ FAKiR8pmkmFWyn7nJC1xRPXeTwBCe5gbU0X43VDl3GD52xgmqKE+cm3+XpwxjcP/04srf uNbIJQ0K+4W6OfraDDF+YW1WsndH2cbmrcI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1666054166114100001 Content-Type: text/plain; charset="utf-8" When using pytools to build ArmVirtPkg, add the ability to dynamically determine which BaseTools to build with. The Pypi BaseTools will be used if present, otherwise defaulting to the in-tree Basetools. Reference: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4085 CC: Ard Biesheuvel CC: Leif Lindholm CC: Sami Mujawar CC: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Signed-off-by: Joey Vagedes --- ArmVirtPkg/PlatformCI/PlatformBuild.py | 33 ++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/ArmVirtPkg/PlatformCI/PlatformBuild.py b/ArmVirtPkg/PlatformCI= /PlatformBuild.py index dff653e919..7ceca8145c 100644 --- a/ArmVirtPkg/PlatformCI/PlatformBuild.py +++ b/ArmVirtPkg/PlatformCI/PlatformBuild.py @@ -7,6 +7,7 @@ import os import logging import io +import importlib =20 from edk2toolext.environment import shell_environment from edk2toolext.environment.uefi_build import UefiBuilder @@ -40,6 +41,9 @@ class CommonPlatform(): =20 class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalS= ettingsManager): =20 + def __init__(self): + self.UseBuiltInBaseTools =3D None + def GetPackagesSupported(self): ''' return iterable of edk2 packages supported by this build. These should be edk2 workspace relative paths ''' @@ -105,7 +109,18 @@ class SettingsManager(UpdateSettingsManager, SetupSett= ingsManager, PrEvalSetting scopes =3D CommonPlatform.Scopes ActualToolChainTag =3D shell_environment.GetBuildVars().GetValue("= TOOL_CHAIN_TAG", "") =20 - if GetHostInfo().os.upper() =3D=3D "LINUX" and ActualToolChainTag.= upper().startswith("GCC"): + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" + + if self.UseBuiltInBaseTools is None: + if importlib.util.find_spec('edk2basetools') is not None: + self.UseBuiltInBaseTools =3D True + else: + self.UseBuiltInBaseTools =3D False + + if self.UseBuiltInBaseTools is True: + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',) + + if is_linux and ActualToolChainTag.upper().startswith("GCC"): if "AARCH64" in self.ActualArchitectures: scopes +=3D ("gcc_aarch64_linux",) if "ARM" in self.ActualArchitectures: @@ -149,6 +164,7 @@ class SettingsManager(UpdateSettingsManager, SetupSetti= ngsManager, PrEvalSetting =20 class PlatformBuilder(UefiBuilder, BuildSettingsManager): def __init__(self): + self.UseBuiltInBaseTools =3D None UefiBuilder.__init__(self) =20 def AddCommandLineOptions(self, parserObj): @@ -179,7 +195,20 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManage= r): ActualToolChainTag =3D shell_environment.GetBuildVars().GetValue("= TOOL_CHAIN_TAG", "") Arch =3D shell_environment.GetBuildVars().GetValue("TARGET_ARCH", = "") =20 - if GetHostInfo().os.upper() =3D=3D "LINUX" and ActualToolChainTag.= upper().startswith("GCC"): + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" + + if self.UseBuiltInBaseTools is None: + if importlib.util.find_spec('edk2basetools') is not None: + self.UseBuiltInBaseTools =3D True + logging.warning("Using Pip Tools based BaseTools") + else: + self.UseBuiltInBaseTools =3D False + logging.warning("Falling back to using in-tree BaseTools") + + if self.UseBuiltInBaseTools is True: + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',) + + if is_linux and ActualToolChainTag.upper().startswith("GCC"): if "AARCH64" =3D=3D Arch: scopes +=3D ("gcc_aarch64_linux",) elif "ARM" =3D=3D Arch: --=20 2.38.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95299): https://edk2.groups.io/g/devel/message/95299 Mute This Topic: https://groups.io/mt/94399353/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 18 20:15:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+95300+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95300+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1666054165; cv=none; d=zohomail.com; s=zohoarc; b=GW4QxX1ouXPKPm3Z+iLaY1c0BFTDnlJYF0wXvtvWs79+KJtkZ75ODd6x16HPVZuMslXARaLxU6weabdc3bFuMeuDYMSB60hxHTJWtBYYPckRwSL1PaYgY5GMBTYi81TTiILWBVB8Q2zVQSSz+zWmUtjwnHbWF5NqzkcJXZqHAl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666054165; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=QkgYDBZp3+EDVwMxet7WvLnQCa2ogfKk3pmBE5JAi5U=; b=lCniusaKvdBSW5Zp0pUHEX93IKSsqTLJs8W7ve3MUtS31uBbAtgAMeqX9dK8JQTuVGjNOMSb/SFjRHZzZMLsT8uhFyv6QRglmEzJ3zdd3UGyBfJown5+Envz4Nth9+J+7cwXEnCPyznjqbfuleVvnmsjAxJf//r+7qmAm5mDOFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95300+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1666054165454158.16246371554155; Mon, 17 Oct 2022 17:49:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jh4XYY1788612xwgRfjNuH1p; Mon, 17 Oct 2022 17:49:25 -0700 X-Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mx.groups.io with SMTP id smtpd.web12.647.1666030021957661476 for ; Mon, 17 Oct 2022 11:07:02 -0700 X-Received: by mail-pl1-f172.google.com with SMTP id c24so11492124pls.9 for ; Mon, 17 Oct 2022 11:07:01 -0700 (PDT) X-Gm-Message-State: HsF38h4UVYrj4XfJAO7rNek9x1787277AA= X-Google-Smtp-Source: AMsMyM6pyY3Wwtb+e3EGHG9ckVN5Zj8oPv+PlK0dheqB4EJw30TGAqfGeNMzX46+sV7E7PIpT0O8xQ== X-Received: by 2002:a17:90b:4b0e:b0:20d:213b:1083 with SMTP id lx14-20020a17090b4b0e00b0020d213b1083mr15428875pjb.208.1666030021105; Mon, 17 Oct 2022 11:07:01 -0700 (PDT) X-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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 11:07:00 -0700 (PDT) From: Joey Vagedes To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann Subject: [edk2-devel] [PATCH v1 2/3] OvmfPkg/PlatformCI: Dyn BaseTools Selection Date: Mon, 17 Oct 2022 11:06:34 -0700 Message-Id: <20221017180635.488-3-joey.vagedes@gmail.com> In-Reply-To: <20221017180635.488-1-joey.vagedes@gmail.com> References: <20221017180635.488-1-joey.vagedes@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,joey.vagedes@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1666054165; bh=qvCLHCAU3odZuxscoWDDepj7mvFt3yuYR8zM5hjtW6c=; h=Cc:Date:From:Reply-To:Subject:To; b=Z+gcBUBvAfY0OhdWk8Ys90p4PdianzJnCMQ+Fvxrt5VQeT0TL7EYO1gMZShOL8j+xAj n6GhFG5lAemzEdTPZ8SftQvc+5ufPwD5Bk0pEuGRaUhT2mb3Ok9b9iLGXxvwpb2laP1mn OM/bTaLF0sH7ilRN/gtw0IipYgLPY35nG3Q= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1666054166115100004 Content-Type: text/plain; charset="utf-8" When using pytools to build OvmfPkg, add the ability to dynamically determine which BaseTools to build with. The Pypi BaseTools will be used if present, otherwise defaulting to the in-tree Basetools. Reference: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4085 Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Signed-off-by: Joey Vagedes --- OvmfPkg/PlatformCI/PlatformBuildLib.py | 37 ++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/PlatformCI/PlatformBuildLib.py b/OvmfPkg/PlatformCI/Pl= atformBuildLib.py index bfef9849c7..d030216dff 100644 --- a/OvmfPkg/PlatformCI/PlatformBuildLib.py +++ b/OvmfPkg/PlatformCI/PlatformBuildLib.py @@ -7,6 +7,7 @@ import os import logging import io +import importlib =20 from edk2toolext.environment import shell_environment from edk2toolext.environment.uefi_build import UefiBuilder @@ -14,7 +15,7 @@ from edk2toolext.invocables.edk2_platform_build import Bu= ildSettingsManager from edk2toolext.invocables.edk2_setup import SetupSettingsManager, Requir= edSubmodule from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toollib.utility_functions import RunCmd +from edk2toollib.utility_functions import RunCmd, GetHostInfo =20 =20 # ####################################################################= ################### # @@ -22,6 +23,9 @@ from edk2toollib.utility_functions import RunCmd # ####################################################################= ################### # class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalS= ettingsManager): =20 + def __init__(self): + self.UseBuiltInBaseTools =3D None + def GetPackagesSupported(self): ''' return iterable of edk2 packages supported by this build. These should be edk2 workspace relative paths ''' @@ -81,7 +85,19 @@ class SettingsManager(UpdateSettingsManager, SetupSettin= gsManager, PrEvalSetting =20 def GetActiveScopes(self): ''' return tuple containing scopes that should be active for this = process ''' - return CommonPlatform.Scopes + + scopes =3D CommonPlatform.Scopes + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" + if self.UseBuiltInBaseTools is None: + if importlib.util.find_spec('edk2basetools') is not None: + self.UseBuiltInBaseTools =3D True + else: + self.UseBuiltInBaseTools =3D False + + if self.UseBuiltInBaseTools is True: + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',) + + return scopes =20 def FilterPackagesToTest(self, changedFilesList: list, potentialPackag= esList: list) -> list: ''' Filter other cases that this package should be built @@ -118,6 +134,7 @@ class SettingsManager(UpdateSettingsManager, SetupSetti= ngsManager, PrEvalSetting # ####################################################################= ################### # class PlatformBuilder( UefiBuilder, BuildSettingsManager): def __init__(self): + self.UseBuiltInBaseTools =3D None UefiBuilder.__init__(self) =20 def AddCommandLineOptions(self, parserObj): @@ -144,7 +161,21 @@ class PlatformBuilder( UefiBuilder, BuildSettingsManag= er): =20 def GetActiveScopes(self): ''' return tuple containing scopes that should be active for this = process ''' - return CommonPlatform.Scopes + + scopes =3D CommonPlatform.Scopes + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" + if self.UseBuiltInBaseTools is None: + if importlib.util.find_spec('edk2basetools') is not None: + self.UseBuiltInBaseTools =3D True + logging.warning("Using Pip Tools based BaseTools") + else: + self.UseBuiltInBaseTools =3D False + logging.warning("Falling back to using in-tree BaseTools") + + if self.UseBuiltInBaseTools is True: + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',) + + return scopes =20 def GetName(self): ''' Get the name of the repo, platform, or product being build ''' --=20 2.38.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95300): https://edk2.groups.io/g/devel/message/95300 Mute This Topic: https://groups.io/mt/94399354/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 18 20:15:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+95301+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95301+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1666054165; cv=none; d=zohomail.com; s=zohoarc; b=Tdp4Soubp8/Xh50ljq655jKvIxp8CNthC28Bz9oIBpooBlG6HGcL3FLAF1gWwNVz2cZMrCkM5721AEQhHhY1AfsKHm2WJt4SYhQGqqolQC5QFNRDFxrRaM+RnytSra6dD0BPG/0TBqXd2ywu5VImtSTu4+JybB+5PBENg+EwLZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666054165; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9N99gwQgH4vFG/JTQywBWy/OmXH3nVpebvRHaQ7Rf0I=; b=hghIGSWCjpAYttHRO9lTDVCLnOn37B+7IMpvcScqzYS6mKyOS/iUOa4a9rmxwop7/9Ml5MrDvWmJoTkrAEBj8mlKjJVTFePva3av+09dYMmaTc1T/ioWScpKr6yIqgFPUnV4TTzJtEWhcWpectN7wdZ2LU7x3Juiylj2jTYeh3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+95301+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1666054165814556.4125910323667; Mon, 17 Oct 2022 17:49:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id IIXMYY1788612xzdP0Uh8wdX; Mon, 17 Oct 2022 17:49:25 -0700 X-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 X-Received: by mail-pj1-f44.google.com with SMTP id o17-20020a17090aac1100b0020d98b0c0f4so13616864pjq.4 for ; Mon, 17 Oct 2022 11:07:03 -0700 (PDT) X-Gm-Message-State: nf19pJ4zr2yJZUjU5YqZVYjVx1787277AA= 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) X-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: [edk2-devel] [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> In-Reply-To: <20221017180635.488-1-joey.vagedes@gmail.com> References: <20221017180635.488-1-joey.vagedes@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,joey.vagedes@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1666054165; bh=tE5lQDSn96H8r0TPTYv65l2HDsI4Ziof4ZDCArWfo2c=; h=Cc:Date:From:Reply-To:Subject:To; b=F2T8pD0SvTLfiKK+zDot1yAPPyzc4hJWuKeMOwDMkpJjJi7iJXxTsM+QVCmaZk+W2bw p5qKBKJLpbJ95ef1q28BCnkC1edJ8ZlYh/yBkCih9ESdoxxAXTmaSDsasJbU0C4vXcJeg Ldi6RNf8QvgO3oT8WzpAo2gO1P2GL31oRDs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1666054166131100007 Content-Type: text/plain; charset="utf-8" When using pytools to build EmulatorPkg, add the ability to dynamically determine which BaseTools to build with. The Pypi BaseTools will be used if present, otherwise defaulting to the in-tree Basetools. Reference: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4085 Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Joey Vagedes --- EmulatorPkg/PlatformCI/PlatformBuild.py | 37 ++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/EmulatorPkg/PlatformCI/PlatformBuild.py b/EmulatorPkg/Platform= CI/PlatformBuild.py index 6defbf6ef1..d6d37f6053 100644 --- a/EmulatorPkg/PlatformCI/PlatformBuild.py +++ b/EmulatorPkg/PlatformCI/PlatformBuild.py @@ -7,6 +7,7 @@ import os import logging import io +import importlib =20 from edk2toolext.environment import shell_environment from edk2toolext.environment.uefi_build import UefiBuilder @@ -40,6 +41,9 @@ class CommonPlatform(): =20 class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalS= ettingsManager): =20 + def __init__(self): + self.UseBuiltInBaseTools =3D None + def GetPackagesSupported(self): ''' return iterable of edk2 packages supported by this build. These should be edk2 workspace relative paths ''' @@ -100,7 +104,20 @@ class SettingsManager(UpdateSettingsManager, SetupSett= ingsManager, PrEvalSetting =20 def GetActiveScopes(self): ''' return tuple containing scopes that should be active for this = process ''' - return CommonPlatform.Scopes + scopes =3D CommonPlatform.Scopes + + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" + + if self.UseBuiltInBaseTools is None: + if importlib.util.find_spec('edk2basetools') is not None: + self.UseBuiltInBaseTools =3D True + else: + self.UseBuiltInBaseTools =3D False + + if self.UseBuiltInBaseTools is True: + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',) + + return scopes =20 def FilterPackagesToTest(self, changedFilesList: list, potentialPackag= esList: list) -> list: ''' Filter other cases that this package should be built @@ -135,6 +152,7 @@ class SettingsManager(UpdateSettingsManager, SetupSetti= ngsManager, PrEvalSetting =20 class PlatformBuilder(UefiBuilder, BuildSettingsManager): def __init__(self): + self.UseBuiltInBaseTools =3D None UefiBuilder.__init__(self) =20 def AddCommandLineOptions(self, parserObj): @@ -161,7 +179,22 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManage= r): =20 def GetActiveScopes(self): ''' return tuple containing scopes that should be active for this = process ''' - return CommonPlatform.Scopes + scopes =3D CommonPlatform.Scopes + + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" + + if self.UseBuiltInBaseTools is None: + if importlib.util.find_spec('edk2basetools') is not None: + self.UseBuiltInBaseTools =3D True + logging.warning("Using Pip Tools based BaseTools") + else: + self.UseBuiltInBaseTools =3D False + logging.warning("Falling back to using in-tree BaseTools") + + if self.UseBuiltInBaseTools is True: + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',) + + return scopes =20 def GetName(self): ''' Get the name of the repo, platform, or product being build ''' --=20 2.38.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95301): https://edk2.groups.io/g/devel/message/95301 Mute This Topic: https://groups.io/mt/94399355/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-