From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.906.1635802670411204424 for ; Mon, 01 Nov 2021 14:37:51 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: michael.d.kinney@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10155"; a="291964409" X-IronPort-AV: E=Sophos;i="5.87,200,1631602800"; d="scan'208";a="291964409" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 14:37:49 -0700 X-IronPort-AV: E=Sophos;i="5.87,200,1631602800"; d="scan'208";a="449113007" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.76.205]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 14:37:49 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Michael Kubacki , Jian J Wang , Maciej Rabeda , Jiaxin Wu , Siyuan Fu , Liming Gao , Leif Lindholm , Zhiguang Liu Subject: [Patch V2 0/7] Reproduce builds across source format changes Date: Mon, 1 Nov 2021 14:37:30 -0700 Message-Id: <20211101213737.586-1-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3688 New in V2 ------------ * Split MdePkg DebugLib class enhancements out into its own commit * Address ECC failures * Align macro continuation marks in same column This change is required to help verify that source code formatting changes such as the use of uncrustify and line ending corrections do not have any functional differences. Source format changes may add or remove line endings that change the source file line numbers of C statements or may change the use of spaces in C expressions used in an ASSERT() statements. These types of changes can impact the generated binaries when DEBUG() and ASSERT() macros are enabled. The following set of changes adds 2 defines that can be used to override the use of `__LINE__` in DEBUG() macros and the use of #Expression in ASSERT() macros. * Add DEBUG_LINE_NUMBER define to DebugLib.h that is by default mapped to `__LINE__`. A build can pre-define DEBUG_LINE_NUMBER to use a fixed value. * Add DEBUG_EXPRESSION_STRING(Expression) macros to DebugLib.h that is by default mapped to #Expression. A build can define DEBUG_EXPRESSION_STRING_VALUE to set all expression strings to a fixed string value. * Use DEBUG_LINE_NUMBER instead of `__LINE__`. * Use DEBUG_EXPRESSION_STRING instead of #Expression. Submodules that use `__LINE__` are not updated. These do not currently impact build reproducibility unless the debug features of those submodules are enabled. The one exception is the UnitTestFrameworkPkg cmocka submodule that uses `__LINE__`. This means that the binaries generated by host based unit tests that use cmocka features may not be identical across a source format change. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Michael Kubacki Cc: Jian J Wang Cc: Maciej Rabeda Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Liming Gao Cc: Leif Lindholm Cc: Zhiguang Liu Signed-off-by: Michael D Kinney Michael D Kinney (7): MdePkg/Include: Enhance DebugLib to support reproduce builds MdePkg: Reproduce builds across source format changes ArmPkg: Reproduce builds across source format changes MdeModulePkg: Reproduce builds across source format changes NetworkPkg: Reproduce builds across source format changes SecurityPkg: Reproduce builds across source format changes OvmfPkg: Reproduce builds across source format changes .../ProcessorSubClassDxe/ProcessorSubClass.c | 2 +- .../Type00/MiscBiosVendorFunction.c | 2 +- .../Type01/MiscSystemManufacturerFunction.c | 2 +- .../MiscBaseBoardManufacturerFunction.c | 2 +- .../Type03/MiscChassisManufacturerFunction.c | 2 +- ...MiscNumberOfInstallableLanguagesFunction.c | 2 +- .../Type32/MiscBootInformationFunction.c | 2 +- .../Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 2 +- .../UefiBootManagerLib/BmDriverHealth.c | 2 +- MdePkg/Include/Library/DebugLib.h | 43 +++++++++++++++-- MdePkg/Include/Library/UnitTestLib.h | 46 +++++++++---------- MdePkg/Library/BaseLib/SafeString.c | 2 +- NetworkPkg/Include/Library/NetLib.h | 8 ++-- NetworkPkg/Library/DxeNetLib/DxeNetLib.c | 2 +- OvmfPkg/Csm/LegacyBiosDxe/LegacyPci.c | 6 +-- .../PlatformBootManagerLib/BdsPlatform.c | 4 +- .../PlatformBootManagerLibBhyve/BdsPlatform.c | 2 +- .../PlatformBootManagerLibGrub/BdsPlatform.c | 4 +- .../Include/Library/TcgStorageCoreLib.h | 26 +++++------ 19 files changed, 98 insertions(+), 63 deletions(-) -- 2.32.0.windows.1