From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: bob.c.feng@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Thu, 18 Jul 2019 19:24:24 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jul 2019 19:24:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,280,1559545200"; d="scan'208";a="319836702" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga004.jf.intel.com with ESMTP; 18 Jul 2019 19:24:22 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Bob Feng , Michael D Kinney , Liming Gao Subject: [Patch 1/1 V2] BaseTools: Create ".cache" folder when initialize Build object Date: Fri, 19 Jul 2019 10:24:10 +0800 Message-Id: <20190719022410.9752-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Michael D Kinney Cc: Liming Gao --- 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