[edk2-devel] [Patch] BaseTools: Remove invalid leading space before !INCLUDE in Makefile

Bob Feng posted 1 patch 4 years, 1 month ago
Failed in applying to current master (apply log)
.../Source/Python/AutoGen/IncludesAutoGen.py     | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
[edk2-devel] [Patch] BaseTools: Remove invalid leading space before !INCLUDE in Makefile
Posted by Bob Feng 4 years, 1 month ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2563

This patch is to fix a incremental build regression bug
which happen when using nmake. That's introduced by 818283de3f6d.

If there is white space before !INCLUDE instruction, nmake will not
process it. Source code's dependent header files are listed in
${deps_file} file, if it's not included successfully, nmake will
not detect the change of those header file.

This patch has been verified in Windows with VS2015 and Linux with GCC5.
The header file add/modify/delete can trig the incremental build with this fix.
There is no impact on the clean build.

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
---
V2: 
1. update the subject
2. remove the Reviewed-by and tested-by
 .../Source/Python/AutoGen/IncludesAutoGen.py     | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
index 0a6314266f..720d93395a 100644
--- a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
@@ -50,21 +50,21 @@ class IncludesAutoGen():
         MakePath = self.module_autogen.BuildOption.get('MAKE', {}).get('PATH')
         if not MakePath:
             EdkLogger.error("build", PARAMETER_MISSING, Message="No Make path available.")
         elif "nmake" in MakePath:
             _INCLUDE_DEPS_TEMPLATE = TemplateString('''
-        ${BEGIN}
-        !IF EXIST(${deps_file})
-        !INCLUDE ${deps_file}
-        !ENDIF
-        ${END}
+${BEGIN}
+!IF EXIST(${deps_file})
+!INCLUDE ${deps_file}
+!ENDIF
+${END}
                ''')
         else:
             _INCLUDE_DEPS_TEMPLATE = TemplateString('''
-        ${BEGIN}
-        -include ${deps_file}
-        ${END}
+${BEGIN}
+-include ${deps_file}
+${END}
                ''')
 
         try:
             deps_include_str = _INCLUDE_DEPS_TEMPLATE.Replace(deps_file)
         except Exception as e:
-- 
2.20.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55003): https://edk2.groups.io/g/devel/message/55003
Mute This Topic: https://groups.io/mt/71587619/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch] BaseTools: Remove invalid leading space before !INCLUDE in Makefile
Posted by Liming Gao 4 years, 1 month ago
Reviewed-by: Liming Gao <liming.gao@intel.com>
Tested-by: Liming Gao <liming.gao@intel.com

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob Feng
> Sent: Thursday, February 27, 2020 10:25 PM
> To: devel@edk2.groups.io
> Cc: Andrew Fish <afish@apple.com>; Laszlo Ersek <lersek@redhat.com>; Leif Lindholm <leif@nuviainc.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Pierre Gondois <pierre.gondois@arm.com>
> Subject: [edk2-devel] [Patch] BaseTools: Remove invalid leading space before !INCLUDE in Makefile
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2563
> 
> This patch is to fix a incremental build regression bug
> which happen when using nmake. That's introduced by 818283de3f6d.
> 
> If there is white space before !INCLUDE instruction, nmake will not
> process it. Source code's dependent header files are listed in
> ${deps_file} file, if it's not included successfully, nmake will
> not detect the change of those header file.
> 
> This patch has been verified in Windows with VS2015 and Linux with GCC5.
> The header file add/modify/delete can trig the incremental build with this fix.
> There is no impact on the clean build.
> 
> Cc: Andrew Fish <afish@apple.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Pierre Gondois <pierre.gondois@arm.com>
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Acked-by: Laszlo Ersek <lersek@redhat.com>
> ---
> V2:
> 1. update the subject
> 2. remove the Reviewed-by and tested-by
>  .../Source/Python/AutoGen/IncludesAutoGen.py     | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> index 0a6314266f..720d93395a 100644
> --- a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> @@ -50,21 +50,21 @@ class IncludesAutoGen():
>          MakePath = self.module_autogen.BuildOption.get('MAKE', {}).get('PATH')
>          if not MakePath:
>              EdkLogger.error("build", PARAMETER_MISSING, Message="No Make path available.")
>          elif "nmake" in MakePath:
>              _INCLUDE_DEPS_TEMPLATE = TemplateString('''
> -        ${BEGIN}
> -        !IF EXIST(${deps_file})
> -        !INCLUDE ${deps_file}
> -        !ENDIF
> -        ${END}
> +${BEGIN}
> +!IF EXIST(${deps_file})
> +!INCLUDE ${deps_file}
> +!ENDIF
> +${END}
>                 ''')
>          else:
>              _INCLUDE_DEPS_TEMPLATE = TemplateString('''
> -        ${BEGIN}
> -        -include ${deps_file}
> -        ${END}
> +${BEGIN}
> +-include ${deps_file}
> +${END}
>                 ''')
> 
>          try:
>              deps_include_str = _INCLUDE_DEPS_TEMPLATE.Replace(deps_file)
>          except Exception as e:
> --
> 2.20.1.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55016): https://edk2.groups.io/g/devel/message/55016
Mute This Topic: https://groups.io/mt/71587619/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch] BaseTools: Remove invalid leading space before !INCLUDE in Makefile
Posted by Bob Feng 4 years, 1 month ago
This patch was pushed.
https://github.com/tianocore/edk2/commit/2be4828af1c92a848af90429a9a0b44544c80553

Thanks,
Bob

-----Original Message-----
From: Gao, Liming 
Sent: Thursday, February 27, 2020 10:57 PM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Cc: Andrew Fish <afish@apple.com>; Laszlo Ersek <lersek@redhat.com>; Leif Lindholm <leif@nuviainc.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Pierre Gondois <pierre.gondois@arm.com>
Subject: RE: [edk2-devel] [Patch] BaseTools: Remove invalid leading space before !INCLUDE in Makefile

Reviewed-by: Liming Gao <liming.gao@intel.com>
Tested-by: Liming Gao <liming.gao@intel.com

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob 
> Feng
> Sent: Thursday, February 27, 2020 10:25 PM
> To: devel@edk2.groups.io
> Cc: Andrew Fish <afish@apple.com>; Laszlo Ersek <lersek@redhat.com>; 
> Leif Lindholm <leif@nuviainc.com>; Kinney, Michael D 
> <michael.d.kinney@intel.com>; Pierre Gondois <pierre.gondois@arm.com>
> Subject: [edk2-devel] [Patch] BaseTools: Remove invalid leading space 
> before !INCLUDE in Makefile
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2563
> 
> This patch is to fix a incremental build regression bug which happen 
> when using nmake. That's introduced by 818283de3f6d.
> 
> If there is white space before !INCLUDE instruction, nmake will not 
> process it. Source code's dependent header files are listed in 
> ${deps_file} file, if it's not included successfully, nmake will not 
> detect the change of those header file.
> 
> This patch has been verified in Windows with VS2015 and Linux with GCC5.
> The header file add/modify/delete can trig the incremental build with this fix.
> There is no impact on the clean build.
> 
> Cc: Andrew Fish <afish@apple.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Pierre Gondois <pierre.gondois@arm.com>
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Acked-by: Laszlo Ersek <lersek@redhat.com>
> ---
> V2:
> 1. update the subject
> 2. remove the Reviewed-by and tested-by
>  .../Source/Python/AutoGen/IncludesAutoGen.py     | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py 
> b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> index 0a6314266f..720d93395a 100644
> --- a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> @@ -50,21 +50,21 @@ class IncludesAutoGen():
>          MakePath = self.module_autogen.BuildOption.get('MAKE', {}).get('PATH')
>          if not MakePath:
>              EdkLogger.error("build", PARAMETER_MISSING, Message="No Make path available.")
>          elif "nmake" in MakePath:
>              _INCLUDE_DEPS_TEMPLATE = TemplateString('''
> -        ${BEGIN}
> -        !IF EXIST(${deps_file})
> -        !INCLUDE ${deps_file}
> -        !ENDIF
> -        ${END}
> +${BEGIN}
> +!IF EXIST(${deps_file})
> +!INCLUDE ${deps_file}
> +!ENDIF
> +${END}
>                 ''')
>          else:
>              _INCLUDE_DEPS_TEMPLATE = TemplateString('''
> -        ${BEGIN}
> -        -include ${deps_file}
> -        ${END}
> +${BEGIN}
> +-include ${deps_file}
> +${END}
>                 ''')
> 
>          try:
>              deps_include_str = _INCLUDE_DEPS_TEMPLATE.Replace(deps_file)
>          except Exception as e:
> --
> 2.20.1.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55132): https://edk2.groups.io/g/devel/message/55132
Mute This Topic: https://groups.io/mt/71587619/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-