From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web12.25381.1650165665503944625 for ; Sat, 16 Apr 2022 20:21:06 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([101.224.116.119]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Sun, 17 Apr 2022 11:21:01 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 101.224.116.119 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Jiang, Guomin'" , Cc: "'Kinney, Michael D'" , "'Liu, Zhiguang'" References: <20220412102434.923-1-guomin.jiang@intel.com> <000f01d84ed2$362c20f0$a28462d0$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0g5Zue5aSNOiBbUEFUQ0ggdjIgMS8xXSBNZGVQa2cvSW5jbHVkZTogVXNlIERFQlVHX0ZJTEVfUEFUSCB0byBzcGVjaWZ5IGRlYnVnIGZpbGUgcGF0aC4=?= Date: Sun, 17 Apr 2022 11:21:02 +0800 Message-ID: <000001d8520a$2afec580$80fc5080$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQG++iC50KcZh+n3c4wUxydpJ1aeEQHKemGhAorPkYWtA3Nx8A== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Guomin: I understand the purpose. But, I don't see the complete solution to confi= gure 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 DE= BUG_FILE_PATH for every source file? Or, you just set DEBUG_FILE_PATH to th= e same value for the different source file? Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Jiang, Guomin > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B44=E6=9C=8813=E6=97=A5 = 13:43 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; Gao, Liming > =E6=8A=84=E9=80=81: Kinney, Michael D ; Liu, = Zhiguang > > =E4=B8=BB=E9=A2=98: RE: [edk2-devel] =E5=9B=9E=E5=A4=8D: [PATCH v2 1/1] M= dePkg/Include: Use > DEBUG_FILE_PATH to specify debug file path. >=20 > Hi Liming, >=20 > Below is the detail why need this change. If you only care usage. Please = jump > to "How to use it" directly. >=20 > Why need: > 1. Replication build is not new, you can refer https://reproducible-build= s.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. >=20 > What's barrier in EDK2 implement? > 1. Very depend on Toolchain(for example VS, GCC, CLANG). Different toolch= ain > 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 >=20 > 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 >=20 > How to use it: > 1. If you want to keep current ASSERT string format. No action is require= d and > the change keep back compatible > 2. If you want to customize the ASSERT string format. You can use additio= nal > tool to generate PATH and define macro in BuildOptions or tools_def. >=20 > Note: > 1. Replication build need many effort: 1) address the pdb path, 2) addres= s 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 eve= ry thing. >=20 > Thank > Guomin >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of > > gaoliming > > Sent: Wednesday, April 13, 2022 9:03 AM > > To: Jiang, Guomin ; devel@edk2.groups.io > > Cc: Kinney, Michael D ; Liu, Zhiguang > > > > Subject: [edk2-devel] =E5=9B=9E=E5=A4=8D: [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 > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Guomin Jiang > > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B44=E6=9C=8812=E6=97= =A5 18:25 > > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > > > =E6=8A=84=E9=80=81: Michael D Kinney ; Li= ming Gao > > > ; Zhiguang Liu > > > =E4=B8=BB=E9=A2=98: [PATCH v2 1/1] MdePkg/Include: Use DEBUG_FILE_PAT= H to specify > > > debug file path. > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3840 > > > > > > 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 > > > Cc: Liming Gao > > > Cc: Zhiguang Liu > > > Signed-off-by: Guomin Jiang > > > --- > > > 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 th= e > > > NULL implementations. > > > > > > -Copyright (c) 2006 - 2020, Intel Corporation. All rights > > > reserved.
> > > +Copyright (c) 2006 - 2022, Intel Corporation. All rights > > > +reserved.
> > > 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 ASCI= I > > > 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 > > > > > > > > > > > >=20 > >