From nobody Mon Feb 9 04:09:15 2026 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+82704+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+82704+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1635264128; cv=none; d=zohomail.com; s=zohoarc; b=CU1rbyKPIGgIPTPRQvwdl7DeOyw70JbgSkb2fkHGfSTkY6bZRcAcfZLz9emD2nOmQDsrsvR1DX1rc3yisw3PtdXZnu95m7ctLU7yR88aPfsTDwViOfVjZhUfdxXCW6UoMu8yKoqiF7VeGBN3Dz76f19pLnnpC2jgqIAbfIqgirU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635264128; h=Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=MbsKvbECPjSyV1CXgUm5oLTa+fv8Tycio4aH7deT8Ow=; b=he2SyPIgXyaYoK//h/ir2Prm2oNHb8KqvOST+yjXEK90B4YrdGiPzPUQMiy4QHGYOfYg51UEHS1egKwPmitjpFtm6GEa+/VhzYN5GHuUXz/HTvf6d3+zXxC+QUmsZHBYt+lbdz/dGWT/9uwuZmBS/KLbOPZRNjHDpgLf2RRpCVc= 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+82704+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 1635264128279621.0965245560786; Tue, 26 Oct 2021 09:02:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id IqgVYY1788612xkTSgvkC3yo; Tue, 26 Oct 2021 09:02:06 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.14194.1635264125715517806 for ; Tue, 26 Oct 2021 09:02:05 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5829113D5; Tue, 26 Oct 2021 09:02:05 -0700 (PDT) X-Received: from e120189.arm.com (unknown [10.57.74.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 481153F70D; Tue, 26 Oct 2021 09:02:03 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io, Ard Biesheuvel , Leif Lindholm , Sean Brogan , Bret Barkelew , Michael D Kinney , Liming Gao , Sami Mujawar Subject: [edk2-devel] [PATCH edk2-platforms v4 3/6] .pytool/Plugin: Add CI plugins Date: Tue, 26 Oct 2021 17:01:38 +0100 Message-Id: <20211026160141.17400-4-Pierre.Gondois@arm.com> In-Reply-To: <20211026160141.17400-1-Pierre.Gondois@arm.com> References: <20211026160141.17400-1-Pierre.Gondois@arm.com> 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,pierre.gondois@arm.com X-Gm-Message-State: HjmbRl5wTqvMXo0O9t6uOtkkx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1635264126; bh=wmTdwFqKmU1qOLPoNUaVkjibC0m/jSvQBaZbAU+e+jw=; h=Date:From:Reply-To:Subject:To; b=ihY94Q4cou1OXZdEZs1ReOzhmcYPQSzZCj9ympteCHsnuIoADNIx1w21kkq+domZYhx SykGoIiZp8ps//dIAVsTz5rp9I6YVb3haiS7xVU6xKayihE8Bjh8gOEzoj9Z2qns0a9AM 9WE1GA1FViDEExQGehacuWu2IHf2scXHluU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1635264139433100015 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois To enable CI support of the tianocore/edk2-platforms repository, add a .pytool directory containing the following files: - .pytool/CISettings.py - .pytool/Readme.md These files are largely inspired from the same files available in the edk2 repository. The .pytool/Plugin/* files containing the CI tests to run are not copied. edk2-platforms will rely on the edk2basetools python package and on the edk2 python files, as edk2 is imported as a submodule of edk2-platforms. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3509 Change-Id: Ib6cf074a6eda79b522dbd55fca99c2402a5dc13c Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Sean Brogan Cc: Bret Barkelew Cc: Michael D Kinney Cc: Liming Gao Cc: Sami Mujawar Signed-off-by: Sami Mujawar Signed-off-by: Pierre Gondois --- Notes: v3: - Remove edk2-platforms's path from $PACKAGES_PATH. [Sean] - Replace Readme's content with a reference to the edk2 repository. [Sean] .pytool/CISettings.py | 184 ++++++++++++++++++++++++++++++++++++++++++ .pytool/Readme.md | 16 ++++ 2 files changed, 200 insertions(+) create mode 100644 .pytool/CISettings.py create mode 100644 .pytool/Readme.md diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py new file mode 100644 index 000000000000..551ec3954058 --- /dev/null +++ b/.pytool/CISettings.py @@ -0,0 +1,184 @@ +# @file +# +# Copyright (c) Microsoft Corporation. +# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All right= s reserved.
+# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## +import os +import logging +import edk2basetools + +from edk2toolext.environment import shell_environment +from edk2toolext.invocables.edk2_ci_build import CiBuildSettingsManager +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 GetHostInfo + + +class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSetting= sManager, PrEvalSettingsManager): + + def __init__(self): + self.ActualPackages =3D [] + self.ActualTargets =3D [] + self.ActualArchitectures =3D [] + self.ActualToolChainTag =3D "" + self.ActualScopes =3D None + + # ####################################################################= ################### # + # Extra CmdLine configuration = # + # ####################################################################= ################### # + + def AddCommandLineOptions(self, parserObj): + pass + def RetrieveCommandLineOptions(self, args): + pass + + # ####################################################################= ################### # + # Default Support for this Ci Build = # + # ####################################################################= ################### # + + def GetPackagesSupported(self): + ''' return iterable of edk2 packages supported by this build. + These should be edk2 workspace relative paths ''' + return ( + "JunoPkg", + "VExpressPkg" + ) + + def GetArchitecturesSupported(self): + ''' return iterable of edk2 architectures supported by this build = ''' + return ( + "IA32", + "X64", + "ARM", + "AARCH64", + "RISCV64") + + def GetTargetsSupported(self): + ''' return iterable of edk2 target tags supported by this build ''' + return ("DEBUG", "RELEASE", "NO-TARGET", "NOOPT") + + # ####################################################################= ################### # + # Verify and Save requested Ci Build Config = # + # ####################################################################= ################### # + + def SetPackages(self, list_of_requested_packages): + ''' Confirm the requested package list is valid and configure Sett= ingsManager + to build the requested packages. + + Raise UnsupportedException if a requested_package is not supported + ''' + unsupported =3D set(list_of_requested_packages) - \ + set(self.GetPackagesSupported()) + if(len(unsupported) > 0): + logging.critical( + "Unsupported Package Requested: " + " ".join(unsupported)) + raise Exception("Unsupported Package Requested: " + + " ".join(unsupported)) + self.ActualPackages =3D list_of_requested_packages + + def SetArchitectures(self, list_of_requested_architectures): + ''' Confirm the requests architecture list is valid and configure = SettingsManager + to run only the requested architectures. + + Raise Exception if a list_of_requested_architectures is not suppor= ted + ''' + unsupported =3D set(list_of_requested_architectures) - \ + set(self.GetArchitecturesSupported()) + if(len(unsupported) > 0): + logging.critical( + "Unsupported Architecture Requested: " + " ".join(unsuppor= ted)) + raise Exception( + "Unsupported Architecture Requested: " + " ".join(unsuppor= ted)) + self.ActualArchitectures =3D list_of_requested_architectures + + def SetTargets(self, list_of_requested_target): + ''' Confirm the request target list is valid and configure Setting= sManager + to run only the requested targets. + + Raise UnsupportedException if a requested_target is not supported + ''' + unsupported =3D set(list_of_requested_target) - \ + set(self.GetTargetsSupported()) + if(len(unsupported) > 0): + logging.critical( + "Unsupported Targets Requested: " + " ".join(unsupported)) + raise Exception("Unsupported Targets Requested: " + + " ".join(unsupported)) + self.ActualTargets =3D list_of_requested_target + + # ####################################################################= ################### # + # Actual Configuration for Ci Build = # + # ####################################################################= ################### # + + def GetActiveScopes(self): + ''' return tuple containing scopes that should be active for this = process ''' + if self.ActualScopes is None: + scopes =3D ("cibuild", "edk2-build", "host-based-test") + + self.ActualToolChainTag =3D shell_environment.GetBuildVars().G= etValue("TOOL_CHAIN_TAG", "") + + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX" + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',) + + if is_linux and self.ActualToolChainTag.upper().startswith("GC= C"): + if "AARCH64" in self.ActualArchitectures: + scopes +=3D ("gcc_aarch64_linux",) + if "ARM" in self.ActualArchitectures: + scopes +=3D ("gcc_arm_linux",) + if "RISCV64" in self.ActualArchitectures: + scopes +=3D ("gcc_riscv64_unknown",) + self.ActualScopes =3D scopes + return self.ActualScopes + + def GetRequiredSubmodules(self): + ''' return iterable containing RequiredSubmodule objects. + If no RequiredSubmodules return an empty iterable + ''' + rs =3D [] + rs.append(RequiredSubmodule( + "edk2", True)) + rs.append(RequiredSubmodule( + "Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi",= False)) + return rs + + def GetName(self): + return "Edk2-platforms" + + def GetDependencies(self): + return [ + ] + + def GetPackagesPath(self): + ''' Return a list of workspace relative paths that should be mappe= d as edk2 PackagesPath ''' + edk2_platforms_path =3D self.GetWorkspaceRoot() + return [ + os.path.join(edk2_platforms_path, "Platform", "ARM"), + os.path.join(edk2_platforms_path, "edk2") + ] + + def GetWorkspaceRoot(self): + ''' get WorkspacePath ''' + return os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + def FilterPackagesToTest(self, changedFilesList: list, potentialPackag= esList: list) -> list: + ''' Filter potential packages to test based on changed files. ''' + build_these_packages =3D [] + possible_packages =3D potentialPackagesList.copy() + for f in changedFilesList: + # split each part of path for comparison later + nodes =3D f.split("/") + + # python file change in .pytool folder causes building all + if f.endswith(".py") and ".pytool" in nodes: + build_these_packages =3D possible_packages + break + + # BaseTools files that might change the build + if "BaseTools" in nodes: + if os.path.splitext(f) not in [".txt", ".md"]: + build_these_packages =3D possible_packages + break + return build_these_packages diff --git a/.pytool/Readme.md b/.pytool/Readme.md new file mode 100644 index 000000000000..9e59b30043fc --- /dev/null +++ b/.pytool/Readme.md @@ -0,0 +1,16 @@ +# Edk2-platforms Continuous Integration + +## Basic Status + +| Package | Windows VS2019 (IA32/X64)| Ubuntu GCC (IA= 32/X64/ARM/AARCH64) | Known Issues | +| :---- | :----- | :---- = | :--- | +| Platfrom/ARM/JunoPkg | | :heavy_check_m= ark: | Spell checking in audit mode. CompilerCheck disabled = (need a PlatformCI). + +For more detailed status look at the test results of the latest CI run on = the +repo readme. + +## Readme + +As the content of the .pytool folder has been imported from the tianocore = repository at: +https://github.com/tianocore/edk2 +Please use the Readme.md that can be found there. --=20 2.17.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 (#82704): https://edk2.groups.io/g/devel/message/82704 Mute This Topic: https://groups.io/mt/86606567/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-