public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Christian Rodriguez" <christian.rodriguez@intel.com>
To: devel@edk2.groups.io
Cc: Bob Feng <bob.c.feng@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Yonghong Zhu <yonghong.zhu@intel.com>
Subject: [Patch V2 1/4] BaseTools: Fix corner-cases of --hash feature
Date: Thu,  4 Apr 2019 09:04:20 -0700	[thread overview]
Message-ID: <20190404160423.5268-2-christian.rodriguez@intel.com> (raw)
In-Reply-To: <20190404160423.5268-1-christian.rodriguez@intel.com>

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1680

Consider modules with .inc source files as Binary Modules
and do not Skip by hash.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Christian Rodriguez <christian.rodriguez@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 8c7c20a386..792bc99f54 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3923,8 +3923,13 @@ class ModuleAutoGen(AutoGen):
                     shutil.copy2(File, FileDir)
 
     def AttemptModuleCacheCopy(self):
+        # If library or Module is binary do not skip by hash
         if self.IsBinaryModule:
             return False
+        # .inc is contains binary information so do not skip by hash as well
+        for f_ext in self.SourceFileList:
+            if '.inc' in str(f_ext):
+                return False
         FileDir = path.join(GlobalData.gBinCacheSource, self.Arch, self.SourceDir, self.MetaFile.BaseName)
         HashFile = path.join(FileDir, self.Name + '.hash')
         if os.path.exists(HashFile):
@@ -4126,7 +4131,16 @@ class ModuleAutoGen(AutoGen):
 
     ## Decide whether we can skip the ModuleAutoGen process
     def CanSkipbyHash(self):
+        # If library or Module is binary do not skip by hash
+        if self.IsBinaryModule:
+            return False
+        # .inc is contains binary information so do not skip by hash as well
+        for f_ext in self.SourceFileList:
+            if '.inc' in str(f_ext):
+                return False
         if GlobalData.gUseHashCache:
+            # If there is a valid hash or function generated a valid hash; function will return False
+            # and the statement below will return True
             return not self.GenModuleHash()
         return False
 
-- 
2.19.1.windows.1


  reply	other threads:[~2019-04-04 16:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 16:04 [Patch V2 0/4] BaseTools: Fix corner-cases of --hash feature Christian Rodriguez
2019-04-04 16:04 ` Christian Rodriguez [this message]
2019-04-09  5:09   ` [Patch V2 1/4] " BobCF
2019-04-04 16:04 ` [Patch V2 2/4] " Christian Rodriguez
2019-04-09  5:09   ` BobCF
2019-04-04 16:04 ` [Patch V2 3/4] " Christian Rodriguez
2019-04-09  5:08   ` BobCF
2019-04-04 16:04 ` [Patch V2 4/4] " Christian Rodriguez
2019-04-09  5:09   ` [edk2-devel] " BobCF

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404160423.5268-2-christian.rodriguez@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox