public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object
@ 2019-07-19  2:24 Bob Feng
  2019-07-19  5:10 ` Michael D Kinney
  2019-07-19  5:12 ` [edk2-devel] " Liming Gao
  0 siblings, 2 replies; 4+ messages in thread
From: Bob Feng @ 2019-07-19  2:24 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Michael D Kinney, Liming Gao

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

Create "Conf/.cache" folder as early as possible
so that the later code do need to check
if it exits and then create it.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
V2: Remove the ".cache" creation action in other place.
 BaseTools/Source/Python/Common/Misc.py | 7 +------
 BaseTools/Source/Python/build/build.py | 3 ++-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 9a63463913d0..27dbdace4252 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -244,17 +244,12 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace):
     if '.' in Filename:
         Filename = BaseName + Path.BaseName + Filename[Filename.rfind('.'):]
     else:
         Filename = BaseName + Path.BaseName
 
-    #
-    # If -N is specified on command line, cache is disabled
-    # The directory has to be created
-    #
     DbDir = os.path.split(GlobalData.gDatabasePath)[0]
-    if not os.path.exists(DbDir):
-        os.makedirs(DbDir)
+
     #
     # A temporary INF is copied to database path which must have write permission
     # The temporary will be removed at the end of build
     # In case of name conflict, the file name is
     # FILE_GUIDBaseName (0D1B936F-68F3-4589-AFCC-FB8B7AEBC836module.inf)
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index d6006b651f77..6bc528974db1 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -771,11 +771,12 @@ class Build():
             else:
                 # Get standard WORKSPACE/Conf use the absolute path to the WORKSPACE/Conf
                 ConfDirectoryPath = mws.join(self.WorkspaceDir, 'Conf')
         GlobalData.gConfDirectory = ConfDirectoryPath
         GlobalData.gDatabasePath = os.path.normpath(os.path.join(ConfDirectoryPath, GlobalData.gDatabasePath))
-
+        if not os.path.exists(os.path.join(GlobalData.gConfDirectory, '.cache')):
+            os.makedirs(os.path.join(GlobalData.gConfDirectory, '.cache'))
         self.Db = WorkspaceDatabase()
         self.BuildDatabase = self.Db.BuildObject
         self.Platform = None
         self.ToolChainFamily = None
         self.LoadFixAddress = 0
-- 
2.20.1.windows.1


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

* Re: [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object
  2019-07-19  2:24 [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object Bob Feng
@ 2019-07-19  5:10 ` Michael D Kinney
  2019-07-22  1:25   ` Bob Feng
  2019-07-19  5:12 ` [edk2-devel] " Liming Gao
  1 sibling, 1 reply; 4+ messages in thread
From: Michael D Kinney @ 2019-07-19  5:10 UTC (permalink / raw)
  To: Feng, Bob C, devel@edk2.groups.io, Kinney, Michael D; +Cc: Gao, Liming

Bob,

Thanks for the quick fix.  I have tested this change with
the Vlv2TbltDevicePkg updates that are under review that
include the use of a PREBUILD script.  It works when the
.cache dir is not present.

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

Mike

> -----Original Message-----
> From: Feng, Bob C
> Sent: Thursday, July 18, 2019 7:24 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Kinney, Michael
> D <michael.d.kinney@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> Subject: [Patch 1/1 V2] BaseTools: Create ".cache"
> folder when initialize Build object
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1986
> 
> Create "Conf/.cache" folder as early as possible so that
> the later code do need to check if it exits and then
> create it.
> 
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> ---
> V2: Remove the ".cache" creation action in other place.
>  BaseTools/Source/Python/Common/Misc.py | 7 +------
> BaseTools/Source/Python/build/build.py | 3 ++-
>  2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Misc.py
> b/BaseTools/Source/Python/Common/Misc.py
> index 9a63463913d0..27dbdace4252 100644
> --- a/BaseTools/Source/Python/Common/Misc.py
> +++ b/BaseTools/Source/Python/Common/Misc.py
> @@ -244,17 +244,12 @@ def ProcessDuplicatedInf(Path,
> BaseName, Workspace):
>      if '.' in Filename:
>          Filename = BaseName + Path.BaseName +
> Filename[Filename.rfind('.'):]
>      else:
>          Filename = BaseName + Path.BaseName
> 
> -    #
> -    # If -N is specified on command line, cache is
> disabled
> -    # The directory has to be created
> -    #
>      DbDir = os.path.split(GlobalData.gDatabasePath)[0]
> -    if not os.path.exists(DbDir):
> -        os.makedirs(DbDir)
> +
>      #
>      # A temporary INF is copied to database path which
> must have write permission
>      # The temporary will be removed at the end of build
>      # In case of name conflict, the file name is
>      # FILE_GUIDBaseName (0D1B936F-68F3-4589-AFCC-
> FB8B7AEBC836module.inf)
> diff --git a/BaseTools/Source/Python/build/build.py
> b/BaseTools/Source/Python/build/build.py
> index d6006b651f77..6bc528974db1 100644
> --- a/BaseTools/Source/Python/build/build.py
> +++ b/BaseTools/Source/Python/build/build.py
> @@ -771,11 +771,12 @@ class Build():
>              else:
>                  # Get standard WORKSPACE/Conf use the
> absolute path to the WORKSPACE/Conf
>                  ConfDirectoryPath =
> mws.join(self.WorkspaceDir, 'Conf')
>          GlobalData.gConfDirectory = ConfDirectoryPath
>          GlobalData.gDatabasePath =
> os.path.normpath(os.path.join(ConfDirectoryPath,
> GlobalData.gDatabasePath))
> -
> +        if not
> os.path.exists(os.path.join(GlobalData.gConfDirectory,
> '.cache')):
> +
> os.makedirs(os.path.join(GlobalData.gConfDirectory,
> + '.cache'))
>          self.Db = WorkspaceDatabase()
>          self.BuildDatabase = self.Db.BuildObject
>          self.Platform = None
>          self.ToolChainFamily = None
>          self.LoadFixAddress = 0
> --
> 2.20.1.windows.1


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

* Re: [edk2-devel] [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object
  2019-07-19  2:24 [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object Bob Feng
  2019-07-19  5:10 ` Michael D Kinney
@ 2019-07-19  5:12 ` Liming Gao
  1 sibling, 0 replies; 4+ messages in thread
From: Liming Gao @ 2019-07-19  5:12 UTC (permalink / raw)
  To: devel@edk2.groups.io, Feng, Bob C; +Cc: Kinney, Michael D

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

>-----Original Message-----
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Bob Feng
>Sent: Friday, July 19, 2019 10:24 AM
>To: devel@edk2.groups.io
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Kinney, Michael D
><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [edk2-devel] [Patch 1/1 V2] BaseTools: Create ".cache" folder when
>initialize Build object
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1986
>
>Create "Conf/.cache" folder as early as possible
>so that the later code do need to check
>if it exits and then create it.
>
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>Cc: Michael D Kinney <michael.d.kinney@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>---
>V2: Remove the ".cache" creation action in other place.
> BaseTools/Source/Python/Common/Misc.py | 7 +------
> BaseTools/Source/Python/build/build.py | 3 ++-
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Common/Misc.py
>b/BaseTools/Source/Python/Common/Misc.py
>index 9a63463913d0..27dbdace4252 100644
>--- a/BaseTools/Source/Python/Common/Misc.py
>+++ b/BaseTools/Source/Python/Common/Misc.py
>@@ -244,17 +244,12 @@ def ProcessDuplicatedInf(Path, BaseName,
>Workspace):
>     if '.' in Filename:
>         Filename = BaseName + Path.BaseName + Filename[Filename.rfind('.'):]
>     else:
>         Filename = BaseName + Path.BaseName
>
>-    #
>-    # If -N is specified on command line, cache is disabled
>-    # The directory has to be created
>-    #
>     DbDir = os.path.split(GlobalData.gDatabasePath)[0]
>-    if not os.path.exists(DbDir):
>-        os.makedirs(DbDir)
>+
>     #
>     # A temporary INF is copied to database path which must have write
>permission
>     # The temporary will be removed at the end of build
>     # In case of name conflict, the file name is
>     # FILE_GUIDBaseName (0D1B936F-68F3-4589-AFCC-
>FB8B7AEBC836module.inf)
>diff --git a/BaseTools/Source/Python/build/build.py
>b/BaseTools/Source/Python/build/build.py
>index d6006b651f77..6bc528974db1 100644
>--- a/BaseTools/Source/Python/build/build.py
>+++ b/BaseTools/Source/Python/build/build.py
>@@ -771,11 +771,12 @@ class Build():
>             else:
>                 # Get standard WORKSPACE/Conf use the absolute path to the
>WORKSPACE/Conf
>                 ConfDirectoryPath = mws.join(self.WorkspaceDir, 'Conf')
>         GlobalData.gConfDirectory = ConfDirectoryPath
>         GlobalData.gDatabasePath =
>os.path.normpath(os.path.join(ConfDirectoryPath,
>GlobalData.gDatabasePath))
>-
>+        if not os.path.exists(os.path.join(GlobalData.gConfDirectory, '.cache')):
>+            os.makedirs(os.path.join(GlobalData.gConfDirectory, '.cache'))
>         self.Db = WorkspaceDatabase()
>         self.BuildDatabase = self.Db.BuildObject
>         self.Platform = None
>         self.ToolChainFamily = None
>         self.LoadFixAddress = 0
>--
>2.20.1.windows.1
>
>
>


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

* Re: [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object
  2019-07-19  5:10 ` Michael D Kinney
@ 2019-07-22  1:25   ` Bob Feng
  0 siblings, 0 replies; 4+ messages in thread
From: Bob Feng @ 2019-07-22  1:25 UTC (permalink / raw)
  To: Kinney, Michael D, Gao, Liming, devel@edk2.groups.io

Pushed @ 5f89bcc4604ea9e439039d873e34a8c06b47c707

-----Original Message-----
From: Kinney, Michael D 
Sent: Friday, July 19, 2019 1:11 PM
To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Gao, Liming <liming.gao@intel.com>
Subject: RE: [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object

Bob,

Thanks for the quick fix.  I have tested this change with the Vlv2TbltDevicePkg updates that are under review that include the use of a PREBUILD script.  It works when the .cache dir is not present.

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

Mike

> -----Original Message-----
> From: Feng, Bob C
> Sent: Thursday, July 18, 2019 7:24 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Kinney, Michael D 
> <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [Patch 1/1 V2] BaseTools: Create ".cache"
> folder when initialize Build object
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1986
> 
> Create "Conf/.cache" folder as early as possible so that the later 
> code do need to check if it exits and then create it.
> 
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> ---
> V2: Remove the ".cache" creation action in other place.
>  BaseTools/Source/Python/Common/Misc.py | 7 +------ 
> BaseTools/Source/Python/build/build.py | 3 ++-
>  2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Misc.py
> b/BaseTools/Source/Python/Common/Misc.py
> index 9a63463913d0..27dbdace4252 100644
> --- a/BaseTools/Source/Python/Common/Misc.py
> +++ b/BaseTools/Source/Python/Common/Misc.py
> @@ -244,17 +244,12 @@ def ProcessDuplicatedInf(Path, BaseName, 
> Workspace):
>      if '.' in Filename:
>          Filename = BaseName + Path.BaseName + 
> Filename[Filename.rfind('.'):]
>      else:
>          Filename = BaseName + Path.BaseName
> 
> -    #
> -    # If -N is specified on command line, cache is
> disabled
> -    # The directory has to be created
> -    #
>      DbDir = os.path.split(GlobalData.gDatabasePath)[0]
> -    if not os.path.exists(DbDir):
> -        os.makedirs(DbDir)
> +
>      #
>      # A temporary INF is copied to database path which must have 
> write permission
>      # The temporary will be removed at the end of build
>      # In case of name conflict, the file name is
>      # FILE_GUIDBaseName (0D1B936F-68F3-4589-AFCC-
> FB8B7AEBC836module.inf)
> diff --git a/BaseTools/Source/Python/build/build.py
> b/BaseTools/Source/Python/build/build.py
> index d6006b651f77..6bc528974db1 100644
> --- a/BaseTools/Source/Python/build/build.py
> +++ b/BaseTools/Source/Python/build/build.py
> @@ -771,11 +771,12 @@ class Build():
>              else:
>                  # Get standard WORKSPACE/Conf use the absolute path 
> to the WORKSPACE/Conf
>                  ConfDirectoryPath =
> mws.join(self.WorkspaceDir, 'Conf')
>          GlobalData.gConfDirectory = ConfDirectoryPath
>          GlobalData.gDatabasePath =
> os.path.normpath(os.path.join(ConfDirectoryPath,
> GlobalData.gDatabasePath))
> -
> +        if not
> os.path.exists(os.path.join(GlobalData.gConfDirectory,
> '.cache')):
> +
> os.makedirs(os.path.join(GlobalData.gConfDirectory,
> + '.cache'))
>          self.Db = WorkspaceDatabase()
>          self.BuildDatabase = self.Db.BuildObject
>          self.Platform = None
>          self.ToolChainFamily = None
>          self.LoadFixAddress = 0
> --
> 2.20.1.windows.1


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

end of thread, other threads:[~2019-07-22  1:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-19  2:24 [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object Bob Feng
2019-07-19  5:10 ` Michael D Kinney
2019-07-22  1:25   ` Bob Feng
2019-07-19  5:12 ` [edk2-devel] " Liming Gao

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