public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] BaseTools: Catch the exception in build.py.
@ 2020-11-04  7:53 mliang2x
  2020-11-05  1:15 ` 回复: [edk2-devel] " fengyunhua
  0 siblings, 1 reply; 4+ messages in thread
From: mliang2x @ 2020-11-04  7:53 UTC (permalink / raw)
  To: devel; +Cc: Mingyue Liang, Bob Feng, Liming Gao, Yuwei Chen

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2988

In FDF file, if INF key word is wrongly written as INT,
build tool will report the execption. Build tool should
report the error message.

build.py In order to capture and handle the exception
of fdfparser, the user-defined exception class should
be imported.

Signed-off-by: Mingyue Liang <mingyuex.liang@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/build/build.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index 1ab1e60a64..49165ea355 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -62,6 +62,7 @@ from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo
 from GenFds.FdfParser import FdfParser
 from AutoGen.IncludesAutoGen import IncludesAutoGen
 from GenFds.GenFds import resetFdsGlobalVariable
+from GenFds.FdfParser import Warning
 
 ## standard targets of build command
 gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
-- 
2.28.0.windows.1


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

* 回复: [edk2-devel] [PATCH] BaseTools: Catch the exception in build.py.
  2020-11-04  7:53 [PATCH] BaseTools: Catch the exception in build.py mliang2x
@ 2020-11-05  1:15 ` fengyunhua
  2020-11-06  3:26   ` Bob Feng
  2022-02-15  6:01   ` [edk2-devel] 回复: " Mingyue Liang
  0 siblings, 2 replies; 4+ messages in thread
From: fengyunhua @ 2020-11-05  1:15 UTC (permalink / raw)
  To: devel, mingyuex.liang
  Cc: 'Bob Feng', 'Liming Gao', 'Yuwei Chen'

I tried this patch, modified OvmfPkgIa32.fdf
INF  OvmfPkg/Sec/SecMain.inf
===>
INM  OvmfPkg/Sec/SecMain.inf

the error message as below:

build.py...
c:\work\edk2\OvmfPkg\OvmfPkgIa32.fdf(118): error 3000: Invalid syntax/format
        expected [FD.] near line 110, column 22: TRUE

on my opinion, "expected [FD.]" is not correct

-----邮件原件-----
发件人: bounce+27952+66996+5049190+8953120@groups.io
<bounce+27952+66996+5049190+8953120@groups.io> 代表 mliang2x
发送时间: 2020年11月4日 15:53
收件人: devel@edk2.groups.io
抄送: Mingyue Liang <mingyuex.liang@intel.com>; Bob Feng
<bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Yuwei Chen
<yuwei.chen@intel.com>
主题: [edk2-devel] [PATCH] BaseTools: Catch the exception in build.py.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2988

In FDF file, if INF key word is wrongly written as INT,
build tool will report the execption. Build tool should
report the error message.

build.py In order to capture and handle the exception
of fdfparser, the user-defined exception class should
be imported.

Signed-off-by: Mingyue Liang <mingyuex.liang@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/build/build.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/BaseTools/Source/Python/build/build.py
b/BaseTools/Source/Python/build/build.py
index 1ab1e60a64..49165ea355 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -62,6 +62,7 @@ from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo,
PlatformInfo
 from GenFds.FdfParser import FdfParser
 from AutoGen.IncludesAutoGen import IncludesAutoGen
 from GenFds.GenFds import resetFdsGlobalVariable
+from GenFds.FdfParser import Warning
 
 ## standard targets of build command
 gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries',
'fds', 'clean', 'cleanall', 'cleanlib', 'run']
-- 
2.28.0.windows.1









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

* Re: [edk2-devel] [PATCH] BaseTools: Catch the exception in build.py.
  2020-11-05  1:15 ` 回复: [edk2-devel] " fengyunhua
@ 2020-11-06  3:26   ` Bob Feng
  2022-02-15  6:01   ` [edk2-devel] 回复: " Mingyue Liang
  1 sibling, 0 replies; 4+ messages in thread
From: Bob Feng @ 2020-11-06  3:26 UTC (permalink / raw)
  To: fengyunhua, devel@edk2.groups.io, Liang, MingyueX
  Cc: 'Liming Gao', Chen, Christine

Hi Yunhua,

This patch is just for Basetool to print out the pre-defined error message instead of printing out the call stack to user.
We can create another patch to enhance the error message content.

Thanks,
Bob

-----Original Message-----
From: fengyunhua <fengyunhua@byosoft.com.cn> 
Sent: Thursday, November 5, 2020 9:16 AM
To: devel@edk2.groups.io; Liang, MingyueX <mingyuex.liang@intel.com>
Cc: Feng, Bob C <bob.c.feng@intel.com>; 'Liming Gao' <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: 回复: [edk2-devel] [PATCH] BaseTools: Catch the exception in build.py.

I tried this patch, modified OvmfPkgIa32.fdf INF  OvmfPkg/Sec/SecMain.inf ===> INM  OvmfPkg/Sec/SecMain.inf

the error message as below:

build.py...
c:\work\edk2\OvmfPkg\OvmfPkgIa32.fdf(118): error 3000: Invalid syntax/format
        expected [FD.] near line 110, column 22: TRUE

on my opinion, "expected [FD.]" is not correct

-----邮件原件-----
发件人: bounce+27952+66996+5049190+8953120@groups.io
<bounce+27952+66996+5049190+8953120@groups.io> 代表 mliang2x
发送时间: 2020年11月4日 15:53
收件人: devel@edk2.groups.io
抄送: Mingyue Liang <mingyuex.liang@intel.com>; Bob Feng <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Yuwei Chen <yuwei.chen@intel.com>
主题: [edk2-devel] [PATCH] BaseTools: Catch the exception in build.py.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2988

In FDF file, if INF key word is wrongly written as INT, build tool will report the execption. Build tool should report the error message.

build.py In order to capture and handle the exception of fdfparser, the user-defined exception class should be imported.

Signed-off-by: Mingyue Liang <mingyuex.liang@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/build/build.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/BaseTools/Source/Python/build/build.py
b/BaseTools/Source/Python/build/build.py
index 1ab1e60a64..49165ea355 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -62,6 +62,7 @@ from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo  from GenFds.FdfParser import FdfParser  from AutoGen.IncludesAutoGen import IncludesAutoGen  from GenFds.GenFds import resetFdsGlobalVariable
+from GenFds.FdfParser import Warning
 
 ## standard targets of build command
 gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
--
2.28.0.windows.1









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

* Re: [edk2-devel] 回复: [edk2-devel] [PATCH] BaseTools: Catch the exception in build.py.
  2020-11-05  1:15 ` 回复: [edk2-devel] " fengyunhua
  2020-11-06  3:26   ` Bob Feng
@ 2022-02-15  6:01   ` Mingyue Liang
  1 sibling, 0 replies; 4+ messages in thread
From: Mingyue Liang @ 2022-02-15  6:01 UTC (permalink / raw)
  To: fengyunhua, devel

[-- Attachment #1: Type: text/plain, Size: 2377 bytes --]

Hi fengyunhua:
This patch is used to report error messages.
For the contents of the error messages you mentioned, please submit another bugzilla.

On Thu, Nov 5, 2020 at 09:15 AM, fengyunhua wrote:

> 
> I tried this patch, modified OvmfPkgIa32.fdf
> INF OvmfPkg/Sec/SecMain.inf
> ===>
> INM OvmfPkg/Sec/SecMain.inf
> 
> the error message as below:
> 
> build.py...
> c:\work\edk2\OvmfPkg\OvmfPkgIa32.fdf(118): error 3000: Invalid
> syntax/format
> expected [FD.] near line 110, column 22: TRUE
> 
> on my opinion, "expected [FD.]" is not correct
> 
> -----邮件原件-----
> 发件人: bounce+27952+66996+5049190+8953120@groups.io
> <bounce+27952+66996+5049190+8953120@groups.io> 代表 mliang2x
> 发送时间: 2020年11月4日 15:53
> 收件人: devel@edk2.groups.io
> 抄送: Mingyue Liang <mingyuex.liang@intel.com>; Bob Feng
> <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Yuwei Chen
> <yuwei.chen@intel.com>
> 主题: [edk2-devel] [PATCH] BaseTools: Catch the exception in build.py.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2988
> 
> In FDF file, if INF key word is wrongly written as INT,
> build tool will report the execption. Build tool should
> report the error message.
> 
> build.py In order to capture and handle the exception
> of fdfparser, the user-defined exception class should
> be imported.
> 
> Signed-off-by: Mingyue Liang <mingyuex.liang@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/build/build.py | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/BaseTools/Source/Python/build/build.py
> b/BaseTools/Source/Python/build/build.py
> index 1ab1e60a64..49165ea355 100755
> --- a/BaseTools/Source/Python/build/build.py
> +++ b/BaseTools/Source/Python/build/build.py
> @@ -62,6 +62,7 @@ from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo,
> PlatformInfo
> from GenFds.FdfParser import FdfParser
> from AutoGen.IncludesAutoGen import IncludesAutoGen
> from GenFds.GenFds import resetFdsGlobalVariable
> +from GenFds.FdfParser import Warning
> 
> ## standard targets of build command
> gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries',
> 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
> --
> 2.28.0.windows.1

[-- Attachment #2: Type: text/html, Size: 2725 bytes --]

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

end of thread, other threads:[~2022-02-15  6:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-04  7:53 [PATCH] BaseTools: Catch the exception in build.py mliang2x
2020-11-05  1:15 ` 回复: [edk2-devel] " fengyunhua
2020-11-06  3:26   ` Bob Feng
2022-02-15  6:01   ` [edk2-devel] 回复: " Mingyue Liang

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