[edk2-devel] [Patch 0/4 V6] Enhance Incremental Build

Bob Feng posted 4 patches 4 years, 4 months ago
Failed in applying to current master (apply log)
BaseTools/Conf/build_rule.template            |  94 ++++---
BaseTools/Conf/tools_def.template             | 173 ++++++------
BaseTools/Source/Python/AutoGen/GenMake.py    |  83 ++----
.../Source/Python/AutoGen/IncludesAutoGen.py  | 255 ++++++++++++++++++
.../Source/Python/AutoGen/ModuleAutoGen.py    |  23 ++
BaseTools/Source/Python/Trim/Trim.py          | 115 ++++++--
BaseTools/Source/Python/build/build.py        |  63 ++++-
7 files changed, 588 insertions(+), 218 deletions(-)
create mode 100644 BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
[edk2-devel] [Patch 0/4 V6] Enhance Incremental Build
Posted by Bob Feng 4 years, 4 months ago
V6: Add notes for RVCT tool chain that it is not enabled incremental build feature
V5: Document how to enable or disable dependency file list generation
for a tool chain.
V4: Move .deps files to where corresponding .obj file locate
V3: Change CLANG9 to CLANGPDB according to commit 14672c34bd 
V2: Fixed a bug in patch 4/4.

Incremental build reduces the build time by only building
the module that need to update. Edk2 Build system is a Makefile
based build system. The incrememtal build ability is provided by
the Make program. But Edk2 build tool need to generate correct makefile
to have Make program do incremental build correctly.

The current solution in build tool to support incremental build is that build
tool find out the include file list for each source file of a module, and in module's
makefile, build tool add the include file list as the source file's dependency. 
In this way Make program can decide if it need to rebuild a source code by checking
its dependency. This solution has 2 shortcommings, one is the process of finding
include list is slow, the other is this method can't handle case that 
a MACRO in #include statement so the related source file is always built. 

This patch provides another method to support incremental build. That is to use
c preprocessor and trim tool to generate dependency files for the source file.
This method will save much time in AutoGen phase and handle MACRO in #include correctly.

For C files:
    1. MSVS.
        cl.exe has a build option /showIncludes to display include files on stdout. Build tool captures
        that messages and generate dependency files, .deps files.
    2. CLANG and GCC
        -MMD -MF build option are used to generate dependency files by preprocessor. Build tool updates the
       .deps files.

For ASL files:
    1. Trim find out all the included files, which are asl specific include format, and generate .trim.deps file.
    2. ASL PP use c preprocessor to find out all included files with #include format and generate a .deps file
    3. build tool updates the .deps file

For ASM files (.asm, .s or .nasm):
    1. Trim find out all the included files, which are asm specific include format, and generate .trim.deps file.
    2. ASM PP use c preprocessor to find out all included files with #include format and generate a deps file
    3. build tool updates the .deps file

Build tool add "include" instruction for those deps files in the Makefile.

This patch does not support RVCT tool chain for the BZ https://bugzilla.tianocore.org/show_bug.cgi?id=1750

Feng, Bob C (4):
  BaseTools: Add build option for dependency file generation
  BaseTools: Generate dependent files for ASL and ASM files
  BaseTools: Update build_rule.txt to generate dependent files.
  BaseTools: Enhance Basetool for incremental build

 BaseTools/Conf/build_rule.template            |  94 ++++---
 BaseTools/Conf/tools_def.template             | 173 ++++++------
 BaseTools/Source/Python/AutoGen/GenMake.py    |  83 ++----
 .../Source/Python/AutoGen/IncludesAutoGen.py  | 255 ++++++++++++++++++
 .../Source/Python/AutoGen/ModuleAutoGen.py    |  23 ++
 BaseTools/Source/Python/Trim/Trim.py          | 115 ++++++--
 BaseTools/Source/Python/build/build.py        |  63 ++++-
 7 files changed, 588 insertions(+), 218 deletions(-)
 create mode 100644 BaseTools/Source/Python/AutoGen/IncludesAutoGen.py

-- 
2.20.1.windows.1


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

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

Re: [edk2-devel] [Patch 0/4 V6] Enhance Incremental Build
Posted by Liming Gao 4 years, 4 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob Feng
> Sent: Friday, December 6, 2019 11:27 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [Patch 0/4 V6] Enhance Incremental Build
> 
> V6: Add notes for RVCT tool chain that it is not enabled incremental build feature
> V5: Document how to enable or disable dependency file list generation
> for a tool chain.
> V4: Move .deps files to where corresponding .obj file locate
> V3: Change CLANG9 to CLANGPDB according to commit 14672c34bd
> V2: Fixed a bug in patch 4/4.
> 
> Incremental build reduces the build time by only building
> the module that need to update. Edk2 Build system is a Makefile
> based build system. The incrememtal build ability is provided by
> the Make program. But Edk2 build tool need to generate correct makefile
> to have Make program do incremental build correctly.
> 
> The current solution in build tool to support incremental build is that build
> tool find out the include file list for each source file of a module, and in module's
> makefile, build tool add the include file list as the source file's dependency.
> In this way Make program can decide if it need to rebuild a source code by checking
> its dependency. This solution has 2 shortcommings, one is the process of finding
> include list is slow, the other is this method can't handle case that
> a MACRO in #include statement so the related source file is always built.
> 
> This patch provides another method to support incremental build. That is to use
> c preprocessor and trim tool to generate dependency files for the source file.
> This method will save much time in AutoGen phase and handle MACRO in #include correctly.
> 
> For C files:
>     1. MSVS.
>         cl.exe has a build option /showIncludes to display include files on stdout. Build tool captures
>         that messages and generate dependency files, .deps files.
>     2. CLANG and GCC
>         -MMD -MF build option are used to generate dependency files by preprocessor. Build tool updates the
>        .deps files.
> 
> For ASL files:
>     1. Trim find out all the included files, which are asl specific include format, and generate .trim.deps file.
>     2. ASL PP use c preprocessor to find out all included files with #include format and generate a .deps file
>     3. build tool updates the .deps file
> 
> For ASM files (.asm, .s or .nasm):
>     1. Trim find out all the included files, which are asm specific include format, and generate .trim.deps file.
>     2. ASM PP use c preprocessor to find out all included files with #include format and generate a deps file
>     3. build tool updates the .deps file
> 
> Build tool add "include" instruction for those deps files in the Makefile.
> 
> This patch does not support RVCT tool chain for the BZ https://bugzilla.tianocore.org/show_bug.cgi?id=1750
> 
> Feng, Bob C (4):
>   BaseTools: Add build option for dependency file generation
>   BaseTools: Generate dependent files for ASL and ASM files
>   BaseTools: Update build_rule.txt to generate dependent files.
>   BaseTools: Enhance Basetool for incremental build
> 
>  BaseTools/Conf/build_rule.template            |  94 ++++---
>  BaseTools/Conf/tools_def.template             | 173 ++++++------
>  BaseTools/Source/Python/AutoGen/GenMake.py    |  83 ++----
>  .../Source/Python/AutoGen/IncludesAutoGen.py  | 255 ++++++++++++++++++
>  .../Source/Python/AutoGen/ModuleAutoGen.py    |  23 ++
>  BaseTools/Source/Python/Trim/Trim.py          | 115 ++++++--
>  BaseTools/Source/Python/build/build.py        |  63 ++++-
>  7 files changed, 588 insertions(+), 218 deletions(-)
>  create mode 100644 BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> 
> --
> 2.20.1.windows.1
> 
> 
> 


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

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

Re: [edk2-devel] [Patch 0/4 V6] Enhance Incremental Build
Posted by Bob Feng 4 years, 4 months ago
Thanks, I'll push this patch set by today if there is no other comments.

Thanks,
Bob

-----Original Message-----
From: Gao, Liming 
Sent: Monday, December 9, 2019 7:35 AM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Subject: RE: [edk2-devel] [Patch 0/4 V6] Enhance Incremental Build

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

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob 
> Feng
> Sent: Friday, December 6, 2019 11:27 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [Patch 0/4 V6] Enhance Incremental Build
> 
> V6: Add notes for RVCT tool chain that it is not enabled incremental 
> build feature
> V5: Document how to enable or disable dependency file list generation 
> for a tool chain.
> V4: Move .deps files to where corresponding .obj file locate
> V3: Change CLANG9 to CLANGPDB according to commit 14672c34bd
> V2: Fixed a bug in patch 4/4.
> 
> Incremental build reduces the build time by only building the module 
> that need to update. Edk2 Build system is a Makefile based build 
> system. The incrememtal build ability is provided by the Make program. 
> But Edk2 build tool need to generate correct makefile to have Make 
> program do incremental build correctly.
> 
> The current solution in build tool to support incremental build is 
> that build tool find out the include file list for each source file of 
> a module, and in module's makefile, build tool add the include file list as the source file's dependency.
> In this way Make program can decide if it need to rebuild a source 
> code by checking its dependency. This solution has 2 shortcommings, 
> one is the process of finding include list is slow, the other is this 
> method can't handle case that a MACRO in #include statement so the related source file is always built.
> 
> This patch provides another method to support incremental build. That 
> is to use c preprocessor and trim tool to generate dependency files for the source file.
> This method will save much time in AutoGen phase and handle MACRO in #include correctly.
> 
> For C files:
>     1. MSVS.
>         cl.exe has a build option /showIncludes to display include files on stdout. Build tool captures
>         that messages and generate dependency files, .deps files.
>     2. CLANG and GCC
>         -MMD -MF build option are used to generate dependency files by preprocessor. Build tool updates the
>        .deps files.
> 
> For ASL files:
>     1. Trim find out all the included files, which are asl specific include format, and generate .trim.deps file.
>     2. ASL PP use c preprocessor to find out all included files with #include format and generate a .deps file
>     3. build tool updates the .deps file
> 
> For ASM files (.asm, .s or .nasm):
>     1. Trim find out all the included files, which are asm specific include format, and generate .trim.deps file.
>     2. ASM PP use c preprocessor to find out all included files with #include format and generate a deps file
>     3. build tool updates the .deps file
> 
> Build tool add "include" instruction for those deps files in the Makefile.
> 
> This patch does not support RVCT tool chain for the BZ 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1750
> 
> Feng, Bob C (4):
>   BaseTools: Add build option for dependency file generation
>   BaseTools: Generate dependent files for ASL and ASM files
>   BaseTools: Update build_rule.txt to generate dependent files.
>   BaseTools: Enhance Basetool for incremental build
> 
>  BaseTools/Conf/build_rule.template            |  94 ++++---
>  BaseTools/Conf/tools_def.template             | 173 ++++++------
>  BaseTools/Source/Python/AutoGen/GenMake.py    |  83 ++----
>  .../Source/Python/AutoGen/IncludesAutoGen.py  | 255 ++++++++++++++++++
>  .../Source/Python/AutoGen/ModuleAutoGen.py    |  23 ++
>  BaseTools/Source/Python/Trim/Trim.py          | 115 ++++++--
>  BaseTools/Source/Python/build/build.py        |  63 ++++-
>  7 files changed, 588 insertions(+), 218 deletions(-)  create mode 
> 100644 BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> 
> --
> 2.20.1.windows.1
> 
> 
> 


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

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

Re: [edk2-devel] [Patch 0/4 V6] Enhance Incremental Build
Posted by Bob Feng 4 years, 4 months ago
Pushed 13c5e34a ~ 0c3e8e99

Thanks,
Bob

-----Original Message-----
From: Gao, Liming 
Sent: Monday, December 9, 2019 7:35 AM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Subject: RE: [edk2-devel] [Patch 0/4 V6] Enhance Incremental Build

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

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob 
> Feng
> Sent: Friday, December 6, 2019 11:27 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [Patch 0/4 V6] Enhance Incremental Build
> 
> V6: Add notes for RVCT tool chain that it is not enabled incremental 
> build feature
> V5: Document how to enable or disable dependency file list generation 
> for a tool chain.
> V4: Move .deps files to where corresponding .obj file locate
> V3: Change CLANG9 to CLANGPDB according to commit 14672c34bd
> V2: Fixed a bug in patch 4/4.
> 
> Incremental build reduces the build time by only building the module 
> that need to update. Edk2 Build system is a Makefile based build 
> system. The incrememtal build ability is provided by the Make program. 
> But Edk2 build tool need to generate correct makefile to have Make 
> program do incremental build correctly.
> 
> The current solution in build tool to support incremental build is 
> that build tool find out the include file list for each source file of 
> a module, and in module's makefile, build tool add the include file list as the source file's dependency.
> In this way Make program can decide if it need to rebuild a source 
> code by checking its dependency. This solution has 2 shortcommings, 
> one is the process of finding include list is slow, the other is this 
> method can't handle case that a MACRO in #include statement so the related source file is always built.
> 
> This patch provides another method to support incremental build. That 
> is to use c preprocessor and trim tool to generate dependency files for the source file.
> This method will save much time in AutoGen phase and handle MACRO in #include correctly.
> 
> For C files:
>     1. MSVS.
>         cl.exe has a build option /showIncludes to display include files on stdout. Build tool captures
>         that messages and generate dependency files, .deps files.
>     2. CLANG and GCC
>         -MMD -MF build option are used to generate dependency files by preprocessor. Build tool updates the
>        .deps files.
> 
> For ASL files:
>     1. Trim find out all the included files, which are asl specific include format, and generate .trim.deps file.
>     2. ASL PP use c preprocessor to find out all included files with #include format and generate a .deps file
>     3. build tool updates the .deps file
> 
> For ASM files (.asm, .s or .nasm):
>     1. Trim find out all the included files, which are asm specific include format, and generate .trim.deps file.
>     2. ASM PP use c preprocessor to find out all included files with #include format and generate a deps file
>     3. build tool updates the .deps file
> 
> Build tool add "include" instruction for those deps files in the Makefile.
> 
> This patch does not support RVCT tool chain for the BZ 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1750
> 
> Feng, Bob C (4):
>   BaseTools: Add build option for dependency file generation
>   BaseTools: Generate dependent files for ASL and ASM files
>   BaseTools: Update build_rule.txt to generate dependent files.
>   BaseTools: Enhance Basetool for incremental build
> 
>  BaseTools/Conf/build_rule.template            |  94 ++++---
>  BaseTools/Conf/tools_def.template             | 173 ++++++------
>  BaseTools/Source/Python/AutoGen/GenMake.py    |  83 ++----
>  .../Source/Python/AutoGen/IncludesAutoGen.py  | 255 ++++++++++++++++++
>  .../Source/Python/AutoGen/ModuleAutoGen.py    |  23 ++
>  BaseTools/Source/Python/Trim/Trim.py          | 115 ++++++--
>  BaseTools/Source/Python/build/build.py        |  63 ++++-
>  7 files changed, 588 insertions(+), 218 deletions(-)  create mode 
> 100644 BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
> 
> --
> 2.20.1.windows.1
> 
> 
> 


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

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