public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] BaseTools: output the intermediate library instance when error occurs
@ 2022-06-15  4:54 Ni, Ray
  2022-06-15 14:19 ` Bob Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Ni, Ray @ 2022-06-15  4:54 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen

When a module "Module" depends on a library instance "Lib1" which
depends on "Lib2" which depends on "Lib3" ... depends on "LibN",
but "LibN" doesn't support the type (e.g.: SEC) of the "Module", the
following error messages are printed by build tool:

<DSC path>(...): error 1001: Module by library instance [<LibN path>]
        consumed by [<Module path>]

But it's unclear to user how LibN is consumed by the Module.


With the patch, following errors are printed:

<DSC path>(...): error 1001: Module by library instance [<LibN path>]
        consumed by library instance [<Lib N-1 path>] which is
        consumed by module[<Module path>]

It doesn't print all the intermediate library instances between the
Module and LibN but at least the path of Lib N-1 can help users
to help how to fix the build errors.

I hope this patch can be a trigger point that a better solution could
be developed by tool experts to print all the library instances
between the Module and LibN.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
---
 BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
index 53027a0e30..9e506fc646 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
@@ -150,7 +150,9 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
                         EdkLogger.error("build", OPTION_MISSING,
                                         "Module type [%s] is not supported by library instance [%s]" \
                                         % (ModuleType, LibraryPath), File=FileName,
-                                        ExtraData="consumed by [%s]" % str(Module))
+                                        ExtraData="consumed by library instance [%s] which is consumed by module [%s]" \
+                                        % (str(M), str(Module))
+                                        )
                     else:
                         return []
 
-- 
2.35.1.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] BaseTools: output the intermediate library instance when error occurs
  2022-06-15  4:54 [PATCH] BaseTools: output the intermediate library instance when error occurs Ni, Ray
@ 2022-06-15 14:19 ` Bob Feng
  2022-06-15 22:54   ` [edk2-devel] " michael_chiu
  0 siblings, 1 reply; 3+ messages in thread
From: Bob Feng @ 2022-06-15 14:19 UTC (permalink / raw)
  To: Ni, Ray, devel@edk2.groups.io; +Cc: Gao, Liming, Chen, Christine

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Ni, Ray <ray.ni@intel.com> 
Sent: Wednesday, June 15, 2022 12:55 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [PATCH] BaseTools: output the intermediate library instance when error occurs

When a module "Module" depends on a library instance "Lib1" which depends on "Lib2" which depends on "Lib3" ... depends on "LibN", but "LibN" doesn't support the type (e.g.: SEC) of the "Module", the following error messages are printed by build tool:

<DSC path>(...): error 1001: Module by library instance [<LibN path>]
        consumed by [<Module path>]

But it's unclear to user how LibN is consumed by the Module.


With the patch, following errors are printed:

<DSC path>(...): error 1001: Module by library instance [<LibN path>]
        consumed by library instance [<Lib N-1 path>] which is
        consumed by module[<Module path>]

It doesn't print all the intermediate library instances between the Module and LibN but at least the path of Lib N-1 can help users to help how to fix the build errors.

I hope this patch can be a trigger point that a better solution could be developed by tool experts to print all the library instances between the Module and LibN.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
---
 BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
index 53027a0e30..9e506fc646 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
@@ -150,7 +150,9 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
                         EdkLogger.error("build", OPTION_MISSING,
                                         "Module type [%s] is not supported by library instance [%s]" \
                                         % (ModuleType, LibraryPath), File=FileName,
-                                        ExtraData="consumed by [%s]" % str(Module))
+                                        ExtraData="consumed by library instance [%s] which is consumed by module [%s]" \
+                                        % (str(M), str(Module))
+                                        )
                     else:
                         return []
 
--
2.35.1.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH] BaseTools: output the intermediate library instance when error occurs
  2022-06-15 14:19 ` Bob Feng
@ 2022-06-15 22:54   ` michael_chiu
  0 siblings, 0 replies; 3+ messages in thread
From: michael_chiu @ 2022-06-15 22:54 UTC (permalink / raw)
  To: devel@edk2.groups.io, bob.c.feng@intel.com
  Cc: Ni, Ray, Gao, Liming, Chen, Christine

Great, it’s useful, and helps , thanks for raising this kind of issue.

发自我的iPhone

> 在 2022年6月15日,22:19,Bob Feng <bob.c.feng@intel.com> 写道:
> 
> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
> 
> -----Original Message-----
> From: Ni, Ray <ray.ni@intel.com> 
> Sent: Wednesday, June 15, 2022 12:55 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
> Subject: [PATCH] BaseTools: output the intermediate library instance when error occurs
> 
> When a module "Module" depends on a library instance "Lib1" which depends on "Lib2" which depends on "Lib3" ... depends on "LibN", but "LibN" doesn't support the type (e.g.: SEC) of the "Module", the following error messages are printed by build tool:
> 
> <DSC path>(...): error 1001: Module by library instance [<LibN path>]
>        consumed by [<Module path>]
> 
> But it's unclear to user how LibN is consumed by the Module.
> 
> 
> With the patch, following errors are printed:
> 
> <DSC path>(...): error 1001: Module by library instance [<LibN path>]
>        consumed by library instance [<Lib N-1 path>] which is
>        consumed by module[<Module path>]
> 
> It doesn't print all the intermediate library instances between the Module and LibN but at least the path of Lib N-1 can help users to help how to fix the build errors.
> 
> I hope this patch can be a trigger point that a better solution could be developed by tool experts to print all the library instances between the Module and LibN.
> 
> Signed-off-by: Ray Ni <ray.ni@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> ---
> BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
> index 53027a0e30..9e506fc646 100644
> --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
> +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
> @@ -150,7 +150,9 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
>                         EdkLogger.error("build", OPTION_MISSING,
>                                         "Module type [%s] is not supported by library instance [%s]" \
>                                         % (ModuleType, LibraryPath), File=FileName,
> -                                        ExtraData="consumed by [%s]" % str(Module))
> +                                        ExtraData="consumed by library instance [%s] which is consumed by module [%s]" \
> +                                        % (str(M), str(Module))
> +                                        )
>                     else:
>                         return []
> 
> --
> 2.35.1.windows.2
> 
> 
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-15 22:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-15  4:54 [PATCH] BaseTools: output the intermediate library instance when error occurs Ni, Ray
2022-06-15 14:19 ` Bob Feng
2022-06-15 22:54   ` [edk2-devel] " michael_chiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox