From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 5C7B7AC17D0 for ; Fri, 22 Mar 2024 19:19:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=OfsivnKLOrD5pJMiA/TTJsjZHcYnNi1AH/aDDA2A6LI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1711135171; v=1; b=KvZ5oyGBRchdABPaOxDlSjbH3P7iS6drCor4ZpJzoU6YFy8wm/z6MtANF2I5uu4UnZHY3d8Q PJaXexyUKAK+QYBsNmi/853KAA4cY2cgkwXug4vSgFWQP1jl+mQQNPZ90iWpv1KVU5MyT7c+aEJ Cj7+ni8k+Ofi8aqbc2dvZitX7zYrA4Den1nTGvtZQUTwTjPgxf5cPyxHkb7I+/N/2djSEdJaaW1 UIIvQoWLgJ0rdlEk7Z/1cEftiroMTC/t8iC+yHDto95MSt9X2W+eEvMxUmQja6mIdp9qpDXYt9R sv4xmA/xxB+1TlhmyzL8/I5Go+mq5Uzby0/9qX5N2KXQQ== X-Received: by 127.0.0.2 with SMTP id VeqRYY7687511xVj9RgoXjYW; Fri, 22 Mar 2024 12:19:31 -0700 X-Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mx.groups.io with SMTP id smtpd.web11.4126.1711135170482112910 for ; Fri, 22 Mar 2024 12:19:30 -0700 X-Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1dffa5e3f2dso15937285ad.2 for ; Fri, 22 Mar 2024 12:19:30 -0700 (PDT) X-Gm-Message-State: oFUT7Hmjva9P7aPHeR4cXxBtx7686176AA= X-Google-Smtp-Source: AGHT+IHUM5xgWB468Os2zcaPK9TmD2kH/Ztm2NaG6tePrdxR2k+wQPNi3+GrfH24F2WVIq78Gex5Hg== X-Received: by 2002:a17:903:2c5:b0:1e0:20b4:6bc8 with SMTP id s5-20020a17090302c500b001e020b46bc8mr856420plk.15.1711135169739; Fri, 22 Mar 2024 12:19:29 -0700 (PDT) X-Received: from localhost.localdomain ([4.155.48.118]) by smtp.gmail.com with ESMTPSA id g7-20020a170902f74700b001dd2bacf30asm81103plw.162.2024.03.22.12.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 12:19:29 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen Subject: [edk2-devel] [PATCH v2 1/2] BaseTools: Don't Recurse NULL Includes Not Linked to Module Date: Fri, 22 Mar 2024 12:19:14 -0700 Message-Id: <20240322191915.184-2-taylor.d.beebe@gmail.com> In-Reply-To: <20240322191915.184-1-taylor.d.beebe@gmail.com> References: <20240322191915.184-1-taylor.d.beebe@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 22 Mar 2024 12:19:30 -0700 Reply-To: devel@edk2.groups.io,taylor.d.beebe@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=KvZ5oyGB; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io When collecting the required library instances for modules and libraries, included libraries will be recursed to ensure the module is built with all the libraries directly linked to it and indirectly linked to it via included libraries. Using the following scenario as an example: [LibraryClasses.common.DXE_CORE] NULL|Path/To/Library1.inf // Includes DebugLib [LibraryClasses.common.DXE_DRIVER] NULL|Path/To/Library2.inf // Includes DebugLib [LibraryClasses.common.DXE_CORE, LibraryClasses.common.DXE_DRIVER] DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf [Components] MdeModulePkg/Core/Dxe/DxeMain.inf // Includes DebugLib The DXE_CORE NULL library will be assigned a fake library class like NULL1 and the DXE_DRIVER will be assigned NULL2. The recursion logic will see NULL1 as a directly linked and will add an instance of it to the list of libraries which need to be included in the module. When DebugLib is evaluated, the recursion logic will add the libraries DebugLib depends on to the queue which includes both NULL1 and NULL2. When NULL2 is unqueued, an instance of it will also be added to the list of libraries needed to build DxeMain which now means that both NULL1 and NULL2 have been linked. NULL includes outside of module overrides are not supported according to the spec, but we do it anyways so this seems like a case which should be fixed. This change updates the recursion logic to skip evaluating NULL libraries unless they are linked directly to the module/library being evaluated. Signed-off-by: Taylor Beebe Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen --- BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py index 9e506fc646..8bb6553c6f 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py @@ -123,6 +123,8 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha while len(LibraryConsumerList) > 0: M = LibraryConsumerList.pop() for LibraryClassName in M.LibraryClasses: + if LibraryClassName.startswith("NULL") and bool(M.LibraryClass): + continue if LibraryClassName not in LibraryInstance: # override library instance for this module LibraryPath = Platform.Modules[str(Module)].LibraryClasses.get(LibraryClassName,Platform.LibraryClasses[LibraryClassName, ModuleType]) -- 2.40.1.vfs.0.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117062): https://edk2.groups.io/g/devel/message/117062 Mute This Topic: https://groups.io/mt/105092034/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-