From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.7230.1657285843960444360 for ; Fri, 08 Jul 2022 06:10:44 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=PBTcvH52; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: yuwei.chen@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657285843; x=1688821843; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=iNNlV0SUpG99x8KwTOmMA1xLrcs/wqAtKtPXiVnwoO4=; b=PBTcvH52CAaE5tf4BptNj8xgoi7Ss4AlFFzi/gXIGccQOm7ctyhfLEKf 6fovzukNQ4JaOQH03cff1vaQL8b079p/4CuNrj5BJpia+//SCdn0lRxvV n3BBgYtIoE5xDtMHIy6KTu/PFjfumdCBmzZ+GlD9aLQFAJSYASI9c0uIJ Tzmonswz/4RmQHG32917gk6GAEHRwNOg1Zu7xB/SoYKBL5Bulcc4nBKVi +F5gjOKuPUGqesA4IYU7EepWLd18IG2+3CiOGzf9w/rGg2BqNYPJ89uO5 UX3hgWHIh6kH+04uHg96MAS8/o8V49xV9f3/UZwIkWsxCov3ZLxPEgwAH A==; X-IronPort-AV: E=McAfee;i="6400,9594,10401"; a="284298759" X-IronPort-AV: E=Sophos;i="5.92,255,1650956400"; d="scan'208";a="284298759" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2022 06:10:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,255,1650956400"; d="scan'208";a="621210454" Received: from yuweipc.ccr.corp.intel.com ([10.239.158.38]) by orsmga008.jf.intel.com with ESMTP; 08 Jul 2022 06:10:42 -0700 From: "Yuwei Chen" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [PATCH 1/1] BaseTools: add '-p' for Linux 'cp' command. Date: Fri, 8 Jul 2022 21:10:00 +0800 Message-Id: <20220708131000.1072-1-yuwei.chen@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently BaseTools use 'cp' command for PcdValueInit and GenMake process, as the command can not keep the time info of the source file, which will cause incremental build issue in Linux system, thus the '-p' need be added to keep the source file's attributes in copy process. This patch fixes this issue. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/AutoGen/GenMake.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 92c7bf0cdad5..daec9c6d54b2 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -120,7 +120,7 @@ class BuildFile(object): }, POSIX_PLATFORM : { - "CP" : "cp -f", + "CP" : "cp -p -f", "MV" : "mv -f", "RM" : "rm -f", "MD" : "mkdir -p", diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index a599c5bb7688..e9f68384b429 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2932,7 +2932,7 @@ class DscBuildData(PlatformBuildClassObject): MakeApp = MakeApp + PcdMakefileEnd MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION) $(APPFILE) /y """) else: - MakeApp = MakeApp + AppTarget % ("""\tcp $(APPLICATION) $(APPFILE) """) + MakeApp = MakeApp + AppTarget % ("""\tcp -p $(APPLICATION) $(APPFILE) """) MakeApp = MakeApp + '\n' IncludeFileFullPaths = [] for includefile in IncludeFiles: @@ -2955,7 +2955,7 @@ class DscBuildData(PlatformBuildClassObject): else: PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon.c")) MakeApp = MakeApp + '%s/PcdValueCommon.c : %s\n' % (self.OutputPath, PcdValueCommonPath) - MakeApp = MakeApp + '\tcp -f %s %s/PcdValueCommon.c\n' % (PcdValueCommonPath, self.OutputPath) + MakeApp = MakeApp + '\tcp -p -f %s %s/PcdValueCommon.c\n' % (PcdValueCommonPath, self.OutputPath) MakeFileName = os.path.join(self.OutputPath, 'Makefile') MakeApp += "$(OBJECTS) : %s\n" % MakeFileName SaveFileOnChange(MakeFileName, MakeApp, False) -- 2.27.0.windows.1