From nobody Tue Feb 10 04:53:51 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+83806+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+83806+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1637157961; cv=none; d=zohomail.com; s=zohoarc; b=XI0EA4JrXuNdqTXD4qMITNHUJPrzyPaw9zhmCfg8eeBq+n2HY63mJkg78Zk0Xhs11ycWZGxmUi+9r5MN569MIHumi/OCwVnZeXmRvD3HVoZuO5PW1895Tu3I/VrcqPNgB4AyoZCVy95Po+WOzhGZUWWutl35Ww2P7vodFSCk6Y0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637157961; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=gie0TQg7MC9sQX4qv+vkYas7nAq4PJijj00mMKsmR6g=; b=aLAiUfUS9DFEMh0+U96AmR1V3O/P0i0HN05ki6PBCdFnvOwe6cfi7gpf/TT5Jytqwy7PONlU5VOSHHVvn1/yXnFLHqHg4/D0d3dZju4IOUbcqeXctcBRxMt+tolQq2wA3e7yzD6bjNCo5TDFiMP4NCk/5nVsoHzFkoWw5Hs4ymk= 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+83806+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 1637157961467860.6952579498783; Wed, 17 Nov 2021 06:06:01 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id v0ueYY1788612x7LCtgGKHg4; Wed, 17 Nov 2021 06:06:01 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.7416.1637157959595416531 for ; Wed, 17 Nov 2021 06:05:59 -0800 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 4473C11B3; Wed, 17 Nov 2021 06:05:59 -0800 (PST) X-Received: from e120189.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4D88E3F70D; Wed, 17 Nov 2021 06:05:57 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sean Brogan , Bret Barkelew , Michael D Kinney , Liming Gao , Sami Mujawar Subject: [edk2-devel] [PATCH edk2-platforms v6 3/6] .pytool/Plugin: Add CI plugins Date: Wed, 17 Nov 2021 14:05:25 +0000 Message-Id: <20211117140528.13600-4-Pierre.Gondois@arm.com> In-Reply-To: <20211117140528.13600-1-Pierre.Gondois@arm.com> References: <20211117140528.13600-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: OoPPIEojqRdMfQplBFL2t9jex1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1637157961; bh=ptoThf8ucWFxKz11dj/ph8TB6bDp6IJwX89FytcDPhE=; h=Cc:Date:From:Reply-To:Subject:To; b=Qd9qZY/e206h2isfRjZ9UgFWoRVvwksXy6eq/1WcmIenxM0FhYNxXAgwAj/0jg7whE/ RT+tHcowEymWNnDhwYew9TTXbA/95ZJ9trXYY6X4ZBWhgG6oltiTA3V3QsULuT2cWLyXa UfUSq84pG+E8H61XudfWmUsaGBRpC8vlPOc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1637157997266100013 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 Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Sean Brogan Cc: Bret Barkelew Cc: Michael D Kinney Cc: Liming Gao Cc: Sami Mujawar Co-authored-by: Sami Mujawar Signed-off-by: Pierre Gondois --- .pytool/CISettings.py | 186 ++++++++++++++++++++++++++++++++++++++++++ .pytool/Readme.md | 30 +++++++ 2 files changed, 216 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..6435c60a4bc5 --- /dev/null +++ b/.pytool/CISettings.py @@ -0,0 +1,186 @@ +# @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-platforms packages supported by this b= uild. + These should be edk2-platforms workspace relative paths ''' + return ( + "JunoPkg", + "VExpressPkg" + ) + + def GetArchitecturesSupported(self): + ''' return iterable of edk2-platforms architectures supported by t= his build ''' + return ( + "IA32", + "X64", + "ARM", + "AARCH64", + "RISCV64") + + def GetTargetsSupported(self): + ''' return iterable of edk2-platforms target tags supported by thi= s 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",) + + # If EDK2_REPO is not provided, download it. + if not shell_environment.GetBuildVars().GetValue("EDK2_REPO", = ""): + scopes +=3D ("edk2-repo",) + + 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( + "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-platforms PackagesPath ''' + packages =3D [] + + edk2_repo =3D shell_environment.GetBuildVars().GetValue("EDK2_REPO= ", "") + if not edk2_repo: + edk2_repo =3D os.path.join("edk2_extdep", "edk2") + packages.append(edk2_repo) + + packages.append(os.path.join("Platform", "ARM")) + return packages + + 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 + + return build_these_packages diff --git a/.pytool/Readme.md b/.pytool/Readme.md new file mode 100644 index 000000000000..b084ff642b2f --- /dev/null +++ b/.pytool/Readme.md @@ -0,0 +1,30 @@ +# 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. + +## edk2 dependency + +It is possible that the edk2-platforms repository relies on new modificati= ons +in the edk2 repository. The edk2-platforms CI fetches the edk2 repository +via the edk2_ext_dep.yaml. The edk2 repository is hence treated as an exte= rnal +dependency. +To use a custom edk2 repository: +- Place it inside the edk2-platforms folder +- Run the stuart_[update|build] commands with EDK2_REPO pointing to your + custom edk2 repository. +E.g.: +stuart_update -c .pytool/CISettings.py EDK2_REPO=3D./my_edk2_repo` +stuart_ci_build -c .pytool/CISettings.py EDK2_REPO=3D./my_edk2_repo` + +## 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 (#83806): https://edk2.groups.io/g/devel/message/83806 Mute This Topic: https://groups.io/mt/87119753/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-