public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "gaoliming" <gaoliming@byosoft.com.cn>
To: "'Jiang, Guomin'" <guomin.jiang@intel.com>, <devel@edk2.groups.io>
Cc: "'Kinney, Michael D'" <michael.d.kinney@intel.com>,
	"'Liu, Zhiguang'" <zhiguang.liu@intel.com>
Subject: 回复: [edk2-devel] 回复: [PATCH v2 1/1] MdePkg/Include: Use DEBUG_FILE_PATH to specify debug file path.
Date: Thu, 21 Apr 2022 09:22:00 +0800	[thread overview]
Message-ID: <00a801d8551e$338e4010$9aaac030$@byosoft.com.cn> (raw)
In-Reply-To: <CH0PR11MB5564F5553DB4D9A2EB9FAE249DF59@CH0PR11MB5564.namprd11.prod.outlook.com>

Guomin:
  gEfiCallerBaseName is the module base name, not source file name. It can verify the build reproduce, but it can't provide the same functionality to _FILE_.  

Thanks
Liming
> -----邮件原件-----
> 发件人: Jiang, Guomin <guomin.jiang@intel.com>
> 发送时间: 2022年4月20日 16:58
> 收件人: Gao, Liming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
> 抄送: Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang
> <zhiguang.liu@intel.com>
> 主题: RE: [edk2-devel] 回复: [PATCH v2 1/1] MdePkg/Include: Use
> DEBUG_FILE_PATH to specify debug file path.
> 
> Hi Liming,
> 
> I just add ```-D DEBUG_FILE_PATH=gEfiCallerBaseName``` to BuildOptions
> 
> Thanks
> Guomin
> 
> > -----Original Message-----
> > From: gaoliming <gaoliming@byosoft.com.cn>
> > Sent: Sunday, April 17, 2022 11:21 AM
> > To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang
> > <zhiguang.liu@intel.com>
> > Subject: 回复: [edk2-devel] 回复: [PATCH v2 1/1] MdePkg/Include: Use
> > DEBUG_FILE_PATH to specify debug file path.
> >
> > Guomin:
> >   I understand the purpose. But, I don't see the complete solution to
> > configure DEBUG_FILE_PATH for every source file in order to meet with the
> > debug image reproducible builds. Have you verified this solution with the
> real
> > DEBUG_FILE_PATH for every source file? Or, you just set DEBUG_FILE_PATH
> > to the same value for the different source file?
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: Jiang, Guomin <guomin.jiang@intel.com>
> > > 发送时间: 2022年4月13日 13:43
> > > 收件人: devel@edk2.groups.io; Gao, Liming
> <gaoliming@byosoft.com.cn>
> > > 抄送: Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang
> > > <zhiguang.liu@intel.com>
> > > 主题: RE: [edk2-devel] 回复: [PATCH v2 1/1] MdePkg/Include: Use
> > > DEBUG_FILE_PATH to specify debug file path.
> > >
> > > Hi Liming,
> > >
> > > Below is the detail why need this change. If you only care usage.
> > > Please jump to "How to use it" directly.
> > >
> > > Why need:
> > > 1. Replication build is not new, you can refer
> > > https://reproducible-builds.org for detail 2. The benefit is that 1)
> > > make sure the same commit generate same binary so we can sure that it
> > > is not modified by anyone 2) store the binary in the repo without
> > > concern of different binary with same code.
> > >
> > > What's barrier in EDK2 implement?
> > > 1. Very depend on Toolchain(for example VS, GCC, CLANG). Different
> > > toolchain have different feature set and different toolchain version
> > > have different feature set.
> > > 2. Deploy new toolchain need big effort, include but not limit deploy
> > > it in CI CD system, update toolchain, size concern, feature change,
> > > etc
> > >
> > > What's the change:
> > > 1. The change want to address one issue that we encounter in
> > > replication
> > > build: the ASSERT in EDK2 will be different in different environment.
> > > For
> > > example: file path, back slash or forward slash, etc
> > >
> > > How to use it:
> > > 1. If you want to keep current ASSERT string format. No action is
> > > required and the change keep back compatible 2. If you want to
> > > customize the ASSERT string format. You can use additional tool to
> > > generate PATH and define macro in BuildOptions or tools_def.
> > >
> > > Note:
> > > 1. Replication build need many effort: 1) address the pdb path, 2)
> > > address the timestamp, etc 2. This change is not target for resolving
> > > all issue in replication build 3. I think it is a small step toward
> > > space even though it haven't fix every thing.
> > >
> > > Thank
> > > Guomin
> > >
> > > > -----Original Message-----
> > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > > gaoliming
> > > > Sent: Wednesday, April 13, 2022 9:03 AM
> > > > To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> > > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang
> > > > <zhiguang.liu@intel.com>
> > > > Subject: [edk2-devel] 回复: [PATCH v2 1/1] MdePkg/Include: Use
> > > > DEBUG_FILE_PATH to specify debug file path.
> > > >
> > > > Guomin:
> > > >   Can you introduce DEBUG_FILE_PATH usage? If the developer wants
> to
> > > > enable this feature, how configure DEBUG_FILE_PATH?
> > > >
> > > > Thanks
> > > > Liming
> > > > > -----邮件原件-----
> > > > > 发件人: Guomin Jiang <guomin.jiang@intel.com>
> > > > > 发送时间: 2022年4月12日 18:25
> > > > > 收件人: devel@edk2.groups.io
> > > > > 抄送: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> > > > > <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>
> > > > > 主题: [PATCH v2 1/1] MdePkg/Include: Use DEBUG_FILE_PATH to
> > specify
> > > > > debug file path.
> > > > >
> > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3840
> > > > >
> > > > > Use DEBUG_FILE_PATH to control ASSERT path
> > > > >
> > > > > Motivation and Goal:
> > > > > 1. Make replication build more easy and less toolchain dependency 2.
> > > > > Consume the ASSERT string easy for downstream 3. Make code more
> > > clear
> > > > >
> > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > > > Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> > > > > ---
> > > > >  MdePkg/Include/Library/DebugLib.h | 34
> > > > > +++++++++++++++++++++----------
> > > > >  1 file changed, 23 insertions(+), 11 deletions(-)
> > > > >
> > > > > diff --git a/MdePkg/Include/Library/DebugLib.h
> > > > > b/MdePkg/Include/Library/DebugLib.h
> > > > > index 8d3d08638d73..a76a268a00b6 100644
> > > > > --- a/MdePkg/Include/Library/DebugLib.h
> > > > > +++ b/MdePkg/Include/Library/DebugLib.h
> > > > > @@ -8,7 +8,7 @@
> > > > >    of size reduction when compiler optimization is disabled. If
> > > > > MDEPKG_NDEBUG is
> > > > >    defined, then debug and assert related macros wrapped by it are
> > > > > the NULL implementations.
> > > > >
> > > > > -Copyright (c) 2006 - 2020, Intel Corporation. All rights
> > > > > reserved.<BR>
> > > > > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > > > > +reserved.<BR>
> > > > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > >
> > > > >  **/
> > > > > @@ -85,6 +85,26 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > > #define DEBUG_LINE_NUMBER  __LINE__  #endif
> > > > >
> > > > > +//
> > > > > +// Source file path.
> > > > > +// Default is use the __FILE__ macro value provided by compiler.
> > > > > +The
> > > > > __FILE__
> > > > > +// mapping can be overriden by predefining DEBUG_FILE_PATH // //
> > > > > +Defining DEBUG_FILE_PATH to a fixed value is useful when
> > > > > +comparing
> > > > > builds
> > > > > +// across machine or configuration with different slash or path file.
> > > > > +//
> > > > > +#ifndef DEBUG_FILE_PATH
> > > > > +#define DEBUG_FILE_PATH  __FILE__ #endif
> > > > > +
> > > > > +//
> > > > > +// Use below override to keep CLANG specific behavior // #if
> > > > > +defined
> > > > > +(__clang__) && defined (__FILE_NAME__)
> > > > > +  #undef DEBUG_FILE_PATH
> > > > > +#define DEBUG_FILE_PATH  __FILE_NAME__ #endif
> > > > > +
> > > > >  /**
> > > > >    Macro that converts a Boolean expression to a Null-terminated
> > > > > ASCII string.
> > > > >
> > > > > @@ -337,17 +357,9 @@ UnitTestDebugAssert (
> > > > >    IN CONST CHAR8  *Description
> > > > >    );
> > > > >
> > > > > -  #if defined (__clang__) && defined (__FILE_NAME__) -#define
> > > > > _ASSERT(Expression)  UnitTestDebugAssert (__FILE_NAME__,
> > > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> > > > > -  #else
> > > > > -#define _ASSERT(Expression)  UnitTestDebugAssert (__FILE__,
> > > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> > > > > -  #endif
> > > > > +#define _ASSERT(Expression)  UnitTestDebugAssert
> > > (DEBUG_FILE_PATH,
> > > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> > > #else
> > > > > -  #if defined (__clang__) && defined (__FILE_NAME__) -#define
> > > > > _ASSERT(Expression)  DebugAssert (__FILE_NAME__,
> > > > DEBUG_LINE_NUMBER,
> > > > > DEBUG_EXPRESSION_STRING (Expression))
> > > > > -  #else
> > > > > -#define _ASSERT(Expression)  DebugAssert (__FILE__,
> > > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> > > > > -  #endif
> > > > > +#define _ASSERT(Expression)  DebugAssert (DEBUG_FILE_PATH,
> > > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> > > > #endif
> > > > >
> > > > >  /**
> > > > > --
> > > > > 2.35.1.windows.2
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > 
> > > >
> >
> >




  reply	other threads:[~2022-04-21  1:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 10:24 [PATCH v2 1/1] MdePkg/Include: Use DEBUG_FILE_PATH to specify debug file path Guomin Jiang
2022-04-13  1:02 ` 回复: " gaoliming
2022-04-13  5:42   ` [edk2-devel] " Guomin Jiang
2022-04-17  3:21     ` 回复: " gaoliming
2022-04-20  8:57       ` Guomin Jiang
2022-04-21  1:22         ` gaoliming [this message]
2022-05-13  9:14           ` Guomin Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00a801d8551e$338e4010$9aaac030$@byosoft.com.cn' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox