public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Remove the dependency on the build intermediate file
@ 2020-10-26 12:27 Bob Feng
  2020-11-02  1:32 ` 回复: " gaoliming
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Feng @ 2020-10-26 12:27 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Yuwei Chen

When generating compressed section, the build tool rely on the
build intermediate files, which were generated in last build, to
get the file list. This method will cause the incremental build to
generate incorrect build result. To reproduce this incremental build
error, you can do:
1. build Ovmf
2. change the module OvmfPkg\AcpiTables a source file Facp.aslc
name from Facp.aslc to Facpxxx.aslc.
3. change the Facp.aslc file name in [sources] section of AcpiTables.inf
4. incremental build Ovmf

you will see the in AcpiTables module Makefile, the corresponding
Facp.acpi file is not changed.

This patch is to make the build always get file list from the INF.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
---
 BaseTools/Source/Python/GenFds/Section.py | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/Python/GenFds/Section.py
index 2acb70f412..0382b2a759 100644
--- a/BaseTools/Source/Python/GenFds/Section.py
+++ b/BaseTools/Source/Python/GenFds/Section.py
@@ -139,25 +139,10 @@ class Section (SectionClassObject):
                 if File.Ext == Suffix:
                     FileList.append(File.Path)
 
         if (not IsMakefile and Suffix is not None and os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix is not None):
-            #
-            # Get Makefile path and time stamp
-            #
-            MakefileDir = FfsInf.EfiOutputPath[:-len('OUTPUT')]
-            Makefile = os.path.join(MakefileDir, 'Makefile')
-            if not os.path.exists(Makefile):
-                Makefile = os.path.join(MakefileDir, 'GNUmakefile')
-            if os.path.exists(Makefile):
-                # Update to search files with suffix in all sub-dirs.
-                Tuple = os.walk(FfsInf.EfiOutputPath)
-                for Dirpath, Dirnames, Filenames in Tuple:
-                    for F in Filenames:
-                        if os.path.splitext(F)[1] == Suffix:
-                            FullName = os.path.join(Dirpath, F)
-                            if os.path.getmtime(FullName) > os.path.getmtime(Makefile):
-                                FileList.append(FullName)
             if not FileList:
                 SuffixMap = FfsInf.GetFinalTargetSuffixMap()
                 if Suffix in SuffixMap:
                     FileList.extend(SuffixMap[Suffix])
 
-- 
2.20.1.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* 回复: [Patch] BaseTools: Remove the dependency on the build intermediate file
  2020-10-26 12:27 [Patch] BaseTools: Remove the dependency on the build intermediate file Bob Feng
@ 2020-11-02  1:32 ` gaoliming
  2020-11-02  9:57   ` Bob Feng
  0 siblings, 1 reply; 5+ messages in thread
From: gaoliming @ 2020-11-02  1:32 UTC (permalink / raw)
  To: 'Bob Feng', devel; +Cc: 'Yuwei Chen'

Bob:
  So, this incremental issue happens when the source file name is changed.
Is it only for *.aslc file, or also for other file, such as *.asl?

Thanks
Liming
> -----邮件原件-----
> 发件人: Bob Feng <bob.c.feng@intel.com>
> 发送时间: 2020年10月26日 20:28
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao <gaoliming@byosoft.com.cn>; Yuwei Chen
> <yuwei.chen@intel.com>
> 主题: [Patch] BaseTools: Remove the dependency on the build intermediate
> file
> 
> When generating compressed section, the build tool rely on the
> build intermediate files, which were generated in last build, to
> get the file list. This method will cause the incremental build to
> generate incorrect build result. To reproduce this incremental build
> error, you can do:
> 1. build Ovmf
> 2. change the module OvmfPkg\AcpiTables a source file Facp.aslc
> name from Facp.aslc to Facpxxx.aslc.
> 3. change the Facp.aslc file name in [sources] section of AcpiTables.inf
> 4. incremental build Ovmf
> 
> you will see the in AcpiTables module Makefile, the corresponding
> Facp.acpi file is not changed.
> 
> This patch is to make the build always get file list from the INF.
> 
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> ---
>  BaseTools/Source/Python/GenFds/Section.py | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/GenFds/Section.py
> b/BaseTools/Source/Python/GenFds/Section.py
> index 2acb70f412..0382b2a759 100644
> --- a/BaseTools/Source/Python/GenFds/Section.py
> +++ b/BaseTools/Source/Python/GenFds/Section.py
> @@ -139,25 +139,10 @@ class Section (SectionClassObject):
>                  if File.Ext == Suffix:
>                      FileList.append(File.Path)
> 
>          if (not IsMakefile and Suffix is not None and
> os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix is not
None):
> -            #
> -            # Get Makefile path and time stamp
> -            #
> -            MakefileDir = FfsInf.EfiOutputPath[:-len('OUTPUT')]
> -            Makefile = os.path.join(MakefileDir, 'Makefile')
> -            if not os.path.exists(Makefile):
> -                Makefile = os.path.join(MakefileDir, 'GNUmakefile')
> -            if os.path.exists(Makefile):
> -                # Update to search files with suffix in all sub-dirs.
> -                Tuple = os.walk(FfsInf.EfiOutputPath)
> -                for Dirpath, Dirnames, Filenames in Tuple:
> -                    for F in Filenames:
> -                        if os.path.splitext(F)[1] == Suffix:
> -                            FullName = os.path.join(Dirpath, F)
> -                            if os.path.getmtime(FullName) >
> os.path.getmtime(Makefile):
> -                                FileList.append(FullName)
>              if not FileList:
>                  SuffixMap = FfsInf.GetFinalTargetSuffixMap()
>                  if Suffix in SuffixMap:
>                      FileList.extend(SuffixMap[Suffix])
> 
> --
> 2.20.1.windows.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch] BaseTools: Remove the dependency on the build intermediate file
  2020-11-02  1:32 ` 回复: " gaoliming
@ 2020-11-02  9:57   ` Bob Feng
  2020-11-04  0:52     ` 回复: " gaoliming
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Feng @ 2020-11-02  9:57 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io; +Cc: Chen, Christine

Liming,

Yes, it's also for other source files for AcpiTable, like *.asl.

Thanks,
Bob

-----Original Message-----
From: gaoliming <gaoliming@byosoft.com.cn> 
Sent: Monday, November 2, 2020 9:33 AM
To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
Cc: Chen, Christine <yuwei.chen@intel.com>
Subject: 回复: [Patch] BaseTools: Remove the dependency on the build intermediate file

Bob:
  So, this incremental issue happens when the source file name is changed.
Is it only for *.aslc file, or also for other file, such as *.asl?

Thanks
Liming
> -----邮件原件-----
> 发件人: Bob Feng <bob.c.feng@intel.com>
> 发送时间: 2020年10月26日 20:28
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao <gaoliming@byosoft.com.cn>; Yuwei Chen 
> <yuwei.chen@intel.com>
> 主题: [Patch] BaseTools: Remove the dependency on the build intermediate 
> file
> 
> When generating compressed section, the build tool rely on the build 
> intermediate files, which were generated in last build, to get the 
> file list. This method will cause the incremental build to generate 
> incorrect build result. To reproduce this incremental build error, you 
> can do:
> 1. build Ovmf
> 2. change the module OvmfPkg\AcpiTables a source file Facp.aslc name 
> from Facp.aslc to Facpxxx.aslc.
> 3. change the Facp.aslc file name in [sources] section of 
> AcpiTables.inf 4. incremental build Ovmf
> 
> you will see the in AcpiTables module Makefile, the corresponding 
> Facp.acpi file is not changed.
> 
> This patch is to make the build always get file list from the INF.
> 
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> ---
>  BaseTools/Source/Python/GenFds/Section.py | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/GenFds/Section.py
> b/BaseTools/Source/Python/GenFds/Section.py
> index 2acb70f412..0382b2a759 100644
> --- a/BaseTools/Source/Python/GenFds/Section.py
> +++ b/BaseTools/Source/Python/GenFds/Section.py
> @@ -139,25 +139,10 @@ class Section (SectionClassObject):
>                  if File.Ext == Suffix:
>                      FileList.append(File.Path)
> 
>          if (not IsMakefile and Suffix is not None and
> os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix is not
None):
> -            #
> -            # Get Makefile path and time stamp
> -            #
> -            MakefileDir = FfsInf.EfiOutputPath[:-len('OUTPUT')]
> -            Makefile = os.path.join(MakefileDir, 'Makefile')
> -            if not os.path.exists(Makefile):
> -                Makefile = os.path.join(MakefileDir, 'GNUmakefile')
> -            if os.path.exists(Makefile):
> -                # Update to search files with suffix in all sub-dirs.
> -                Tuple = os.walk(FfsInf.EfiOutputPath)
> -                for Dirpath, Dirnames, Filenames in Tuple:
> -                    for F in Filenames:
> -                        if os.path.splitext(F)[1] == Suffix:
> -                            FullName = os.path.join(Dirpath, F)
> -                            if os.path.getmtime(FullName) >
> os.path.getmtime(Makefile):
> -                                FileList.append(FullName)
>              if not FileList:
>                  SuffixMap = FfsInf.GetFinalTargetSuffixMap()
>                  if Suffix in SuffixMap:
>                      FileList.extend(SuffixMap[Suffix])
> 
> --
> 2.20.1.windows.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* 回复: [Patch] BaseTools: Remove the dependency on the build intermediate file
  2020-11-02  9:57   ` Bob Feng
@ 2020-11-04  0:52     ` gaoliming
  2020-11-04 11:33       ` [edk2-devel] " Bob Feng
  0 siblings, 1 reply; 5+ messages in thread
From: gaoliming @ 2020-11-04  0:52 UTC (permalink / raw)
  To: 'Feng, Bob C', devel; +Cc: 'Chen, Christine'

Bob:
 I understand this change. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

Thanks
Liming
> -----邮件原件-----
> 发件人: Feng, Bob C <bob.c.feng@intel.com>
> 发送时间: 2020年11月2日 17:58
> 收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
> 抄送: Chen, Christine <yuwei.chen@intel.com>
> 主题: RE: [Patch] BaseTools: Remove the dependency on the build
> intermediate file
> 
> Liming,
> 
> Yes, it's also for other source files for AcpiTable, like *.asl.
> 
> Thanks,
> Bob
> 
> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Monday, November 2, 2020 9:33 AM
> To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
> Cc: Chen, Christine <yuwei.chen@intel.com>
> Subject: 回复: [Patch] BaseTools: Remove the dependency on the build
> intermediate file
> 
> Bob:
>   So, this incremental issue happens when the source file name is changed.
> Is it only for *.aslc file, or also for other file, such as *.asl?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: Bob Feng <bob.c.feng@intel.com>
> > 发送时间: 2020年10月26日 20:28
> > 收件人: devel@edk2.groups.io
> > 抄送: Liming Gao <gaoliming@byosoft.com.cn>; Yuwei Chen
> > <yuwei.chen@intel.com>
> > 主题: [Patch] BaseTools: Remove the dependency on the build
> intermediate
> > file
> >
> > When generating compressed section, the build tool rely on the build
> > intermediate files, which were generated in last build, to get the
> > file list. This method will cause the incremental build to generate
> > incorrect build result. To reproduce this incremental build error, you
> > can do:
> > 1. build Ovmf
> > 2. change the module OvmfPkg\AcpiTables a source file Facp.aslc name
> > from Facp.aslc to Facpxxx.aslc.
> > 3. change the Facp.aslc file name in [sources] section of
> > AcpiTables.inf 4. incremental build Ovmf
> >
> > you will see the in AcpiTables module Makefile, the corresponding
> > Facp.acpi file is not changed.
> >
> > This patch is to make the build always get file list from the INF.
> >
> > Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > ---
> >  BaseTools/Source/Python/GenFds/Section.py | 15 ---------------
> >  1 file changed, 15 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/GenFds/Section.py
> > b/BaseTools/Source/Python/GenFds/Section.py
> > index 2acb70f412..0382b2a759 100644
> > --- a/BaseTools/Source/Python/GenFds/Section.py
> > +++ b/BaseTools/Source/Python/GenFds/Section.py
> > @@ -139,25 +139,10 @@ class Section (SectionClassObject):
> >                  if File.Ext == Suffix:
> >                      FileList.append(File.Path)
> >
> >          if (not IsMakefile and Suffix is not None and
> > os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix is not
> None):
> > -            #
> > -            # Get Makefile path and time stamp
> > -            #
> > -            MakefileDir = FfsInf.EfiOutputPath[:-len('OUTPUT')]
> > -            Makefile = os.path.join(MakefileDir, 'Makefile')
> > -            if not os.path.exists(Makefile):
> > -                Makefile = os.path.join(MakefileDir, 'GNUmakefile')
> > -            if os.path.exists(Makefile):
> > -                # Update to search files with suffix in all sub-dirs.
> > -                Tuple = os.walk(FfsInf.EfiOutputPath)
> > -                for Dirpath, Dirnames, Filenames in Tuple:
> > -                    for F in Filenames:
> > -                        if os.path.splitext(F)[1] == Suffix:
> > -                            FullName = os.path.join(Dirpath, F)
> > -                            if os.path.getmtime(FullName) >
> > os.path.getmtime(Makefile):
> > -                                FileList.append(FullName)
> >              if not FileList:
> >                  SuffixMap = FfsInf.GetFinalTargetSuffixMap()
> >                  if Suffix in SuffixMap:
> >                      FileList.extend(SuffixMap[Suffix])
> >
> > --
> > 2.20.1.windows.1
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] 回复: [Patch] BaseTools: Remove the dependency on the build intermediate file
  2020-11-04  0:52     ` 回复: " gaoliming
@ 2020-11-04 11:33       ` Bob Feng
  0 siblings, 0 replies; 5+ messages in thread
From: Bob Feng @ 2020-11-04 11:33 UTC (permalink / raw)
  To: devel@edk2.groups.io, gaoliming@byosoft.com.cn; +Cc: Chen, Christine

Created PR https://github.com/tianocore/edk2/pull/1082


-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming
Sent: Wednesday, November 4, 2020 8:52 AM
To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
Cc: Chen, Christine <yuwei.chen@intel.com>
Subject: [edk2-devel] 回复: [Patch] BaseTools: Remove the dependency on the build intermediate file

Bob:
 I understand this change. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

Thanks
Liming
> -----邮件原件-----
> 发件人: Feng, Bob C <bob.c.feng@intel.com>
> 发送时间: 2020年11月2日 17:58
> 收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
> 抄送: Chen, Christine <yuwei.chen@intel.com>
> 主题: RE: [Patch] BaseTools: Remove the dependency on the build 
> intermediate file
> 
> Liming,
> 
> Yes, it's also for other source files for AcpiTable, like *.asl.
> 
> Thanks,
> Bob
> 
> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Monday, November 2, 2020 9:33 AM
> To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
> Cc: Chen, Christine <yuwei.chen@intel.com>
> Subject: 回复: [Patch] BaseTools: Remove the dependency on the build 
> intermediate file
> 
> Bob:
>   So, this incremental issue happens when the source file name is changed.
> Is it only for *.aslc file, or also for other file, such as *.asl?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: Bob Feng <bob.c.feng@intel.com>
> > 发送时间: 2020年10月26日 20:28
> > 收件人: devel@edk2.groups.io
> > 抄送: Liming Gao <gaoliming@byosoft.com.cn>; Yuwei Chen 
> > <yuwei.chen@intel.com>
> > 主题: [Patch] BaseTools: Remove the dependency on the build
> intermediate
> > file
> >
> > When generating compressed section, the build tool rely on the build 
> > intermediate files, which were generated in last build, to get the 
> > file list. This method will cause the incremental build to generate 
> > incorrect build result. To reproduce this incremental build error, 
> > you can do:
> > 1. build Ovmf
> > 2. change the module OvmfPkg\AcpiTables a source file Facp.aslc name 
> > from Facp.aslc to Facpxxx.aslc.
> > 3. change the Facp.aslc file name in [sources] section of 
> > AcpiTables.inf 4. incremental build Ovmf
> >
> > you will see the in AcpiTables module Makefile, the corresponding 
> > Facp.acpi file is not changed.
> >
> > This patch is to make the build always get file list from the INF.
> >
> > Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > ---
> >  BaseTools/Source/Python/GenFds/Section.py | 15 ---------------
> >  1 file changed, 15 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/GenFds/Section.py
> > b/BaseTools/Source/Python/GenFds/Section.py
> > index 2acb70f412..0382b2a759 100644
> > --- a/BaseTools/Source/Python/GenFds/Section.py
> > +++ b/BaseTools/Source/Python/GenFds/Section.py
> > @@ -139,25 +139,10 @@ class Section (SectionClassObject):
> >                  if File.Ext == Suffix:
> >                      FileList.append(File.Path)
> >
> >          if (not IsMakefile and Suffix is not None and
> > os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix is 
> > not
> None):
> > -            #
> > -            # Get Makefile path and time stamp
> > -            #
> > -            MakefileDir = FfsInf.EfiOutputPath[:-len('OUTPUT')]
> > -            Makefile = os.path.join(MakefileDir, 'Makefile')
> > -            if not os.path.exists(Makefile):
> > -                Makefile = os.path.join(MakefileDir, 'GNUmakefile')
> > -            if os.path.exists(Makefile):
> > -                # Update to search files with suffix in all sub-dirs.
> > -                Tuple = os.walk(FfsInf.EfiOutputPath)
> > -                for Dirpath, Dirnames, Filenames in Tuple:
> > -                    for F in Filenames:
> > -                        if os.path.splitext(F)[1] == Suffix:
> > -                            FullName = os.path.join(Dirpath, F)
> > -                            if os.path.getmtime(FullName) >
> > os.path.getmtime(Makefile):
> > -                                FileList.append(FullName)
> >              if not FileList:
> >                  SuffixMap = FfsInf.GetFinalTargetSuffixMap()
> >                  if Suffix in SuffixMap:
> >                      FileList.extend(SuffixMap[Suffix])
> >
> > --
> > 2.20.1.windows.1
> 
> 









^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-04 11:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-26 12:27 [Patch] BaseTools: Remove the dependency on the build intermediate file Bob Feng
2020-11-02  1:32 ` 回复: " gaoliming
2020-11-02  9:57   ` Bob Feng
2020-11-04  0:52     ` 回复: " gaoliming
2020-11-04 11:33       ` [edk2-devel] " Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox