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.30250.1615166904799850856 for ; Sun, 07 Mar 2021 17:28:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=CsB/mqku; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: bob.c.feng@intel.com) IronPort-SDR: 7/SQ6sh58F3S3FOUIrD+sM5QW1ivNh1O6wHTpr1QiFpHz69nXkk3FBEUUOMfFlCleFVLD9MdC2 C2IYFQGEbbQg== X-IronPort-AV: E=McAfee;i="6000,8403,9916"; a="187306734" X-IronPort-AV: E=Sophos;i="5.81,231,1610438400"; d="scan'208";a="187306734" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2021 17:28:23 -0800 IronPort-SDR: vr0NzgCPT90qLg/8SEbi2bHz6oN0TiPl1WbKCjgA5Im8LllKKPIcUW8423AjKIqUwiqjgZyPZq aR+AO+XQe8YQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,231,1610438400"; d="scan'208";a="598667728" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga006.fm.intel.com with ESMTP; 07 Mar 2021 17:28:23 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sun, 7 Mar 2021 17:28:22 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sun, 7 Mar 2021 17:28:22 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Sun, 7 Mar 2021 17:28:22 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Sun, 7 Mar 2021 17:28:22 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=of0aMmDF+61XG8kZSg8qUyaOK8EKeOtD7f3GeYmU+V+FUzi9pi8GKWmNp/V5F2FsmvBL0PUNn4Zcw8of0q/lEsYzB6WaCldRCX7GC8JUBc8hc3PYnxzOUdc44ObDS80vcs0ONWKNcM5K1YzGYW/RAlXgh9tzwpVLH6ajkZIuphW2iGWATM0wk2B42AtOBa7MAocmRigIqoVrxiK6jRFXcPZXet27q4ybUF2tH3RwF1veGITgFiqgAgckxLUtoiVABy/ucZwnJamTfEwXLn9eC5wZtr1vLQiebLzHKXQVwOvOz+MAJYDmvvDDDLA/tFKnA7ewaG2iN78SRT1IF9mahQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WTG8gTCTFBZ260HQxtFY5mSLXUYT1FaNQBsJn2saPio=; b=O4i5LUc5CK2xuK/weQptU8v5/xi3bXuA7ke7JDa4YCBkd6fJbRMDTV+dWuM91hHZU6tIOEc7Gj5um7UUD6Ger/L/2HTuDJU2pkX4GmGwhbYgGDOILefkWAuZR4VH4c7HD8OLC1R4RLEd+zFpaiNU6L3J76hwzM9ccEzZaCmv4vPGBcuTKXCljgyVUU4ypa8s4s8QnhdBH5UxL6LGOhX2nT7RAQrY/cCODEE93hg4I3V+6Mr6YBwCsuxB5tF/5Bgxo1ZRseI5UOyMhSt3vFgUWlmiWsy8qgAbMirpgC0DB4S4ieB6HLE8yc2eAsHeF3bAokdnCodhN4W8ic/EnXK98A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WTG8gTCTFBZ260HQxtFY5mSLXUYT1FaNQBsJn2saPio=; b=CsB/mqkuxWNzMlJAbs4iP42hVgIF/VCyGxFbS885RU9sEIhXHG7u/CzoTuywK1JqiYm/uqrPdelr+U2LdoTqaSYJpOVDeDXGw4sW5wiw15ZjvUeFzzwJ3pRMd6zrFnE5bJgHpCj5STW5w2FXVtGAlSoe8YItY+lAcxONJFmpFUQ= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB3867.namprd11.prod.outlook.com (2603:10b6:5:4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Mon, 8 Mar 2021 01:28:21 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::845:55b:f6b3:aa0a]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::845:55b:f6b3:aa0a%6]) with mapi id 15.20.3890.038; Mon, 8 Mar 2021 01:28:21 +0000 From: "Bob Feng" To: "Shi, Steven" , "devel@edk2.groups.io" CC: Liming Gao Subject: Re: [PATCH] BaseTools: Fix build failure of "modules" option Thread-Topic: [PATCH] BaseTools: Fix build failure of "modules" option Thread-Index: AQHXDAW/L/Dnk0Xczk6LViRk5GUIaKp5XHzw Date: Mon, 8 Mar 2021 01:28:20 +0000 Message-ID: References: <20210226060718.378-1-steven.shi@intel.com> In-Reply-To: <20210226060718.378-1-steven.shi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: da4a2cf1-370c-4191-fd99-08d8e1d1759a x-ms-traffictypediagnostic: DM6PR11MB3867: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:466; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Th6AzW8n6bO+/mpa2RHe3NlNBDLQiXKPBDNRcyZM3E7yXWXdqzYTVSG2z6ALvtigzg+w5PMvpgVCTMlKi6jNlk6FdPtv3/e1qkZxHJeav/AOHUayIGpQ2HidsKsx/oUExr/4tf4ygrMyF5tME3RDbl1K8EJ7YuVWCVzEHhRDL+5csqdKzdFmCxl+pgos+hN970MFJqpVHfhkJsJFNvXaZQkqasaXATVn0Jn0K6IoW4gXmsQzzfK/0hj9s3V68E35Pi+oxFJir21QuSH7BDQgk46Ox5/WkDyZCTbtoYrFP1D1wMMFRLorM85mVhFAzrrTPli4/4/T9JnUq5Yc5BZZxxEWLKxBeIhUW72QAeE3wqNy83MEVw5Jr8p1xE7eJx+LXpMOY2IwAuiMvcoyfLOTAHkQ1KJxBvas6OjuxZfZVZFwfmM/z8pSXKYsMuta9ZOrtN/O441LAPYuN+BH3dAQ/35lxq/TTiuSXSjrjVcuAxW6vwHr5K6Np1HbgGjqcPGUk7CyRSxO+8jQCVb6JSJO05XLQcTl+5C0LgyUqS25KZQdqoYjYiYccWCazhc+bjcvXl8RsuOJml1KcsFTnFuOPxlaufybkMb07tQUjZm3y/s= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(136003)(366004)(376002)(346002)(39860400002)(83380400001)(110136005)(33656002)(316002)(55016002)(2906002)(9686003)(86362001)(8676002)(8936002)(966005)(66476007)(76116006)(26005)(66556008)(64756008)(5660300002)(66446008)(66946007)(52536014)(186003)(6506007)(478600001)(53546011)(7696005)(4326008)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Olpxyv6zpanuuDIeCEv1SWEDHBWMXV5/DgSxjUOH/pNcEiu0XW4QbyCcReN3?= =?us-ascii?Q?zl+RnFn+woyme2iEkoB/z3QafmDFrgUdaRE6ef0xJ0VNQ1RfbZ+NO0zgOYxz?= =?us-ascii?Q?FG11wgLmKrNA1bR4TptJvKJ2Oh1THhhfwmZZlGQ7+03IrdM0P9A0uIePJz3f?= =?us-ascii?Q?AOERU9PrVHrcC6do0lq8IoHzWkkJlZg90OFntno7KAZoarIIHa2uyjIZr9yx?= =?us-ascii?Q?wk6j1elqU1ZTc1Aobaz76e3Ykq8ynjf/CSmLERpp6csaE8XbyhiNyKURBDq4?= =?us-ascii?Q?cb8kYs+lLM3Ubx86nrzDgJRofW5scaEtj0v1vVUcI0DnjDUqBFbDJtC/nK2b?= =?us-ascii?Q?9RmkQegTscWUT6MXp+ApR4Mow5UXFzMnpaZubTsEqhZLw4Ub1kukVkQ9zrS1?= =?us-ascii?Q?0tMG9GgEZf10hlk2jk6kCE4HrhSfZa0Gvhb0uFFTv2ALDh7A9TiIZ+gWZxR4?= =?us-ascii?Q?Dd0i6Ea6E2ryNitGgBvee2ZaZl1TPYBqMZDLAu+0gOm/cbKZJRdgZjFQbg+a?= =?us-ascii?Q?QEqz3fD7b9BFNdOg3h50pyLoUxeAefAoAOT4aGDwRcMULL6T51x10yrGnsE6?= =?us-ascii?Q?1hr2t0NpaBncU+IbITTvCeCGzWkNBy3/A7hfxX2xe/umq/4ca6HXOKIGCchz?= =?us-ascii?Q?XTFIwbq29Hoc2WhQ2xy7G6k0zFLTFr58ITEJpU7PhTu6uKQyrfXROofBtcCy?= =?us-ascii?Q?E6FEeepIogrfXDX3xHaalGT5kVFuiRHo8eFrZBJTGVqwCwunEwVPUVUGKnTY?= =?us-ascii?Q?lvCJS6CRHQEBRZ/g3sf9IEiIVtZxMQ4WE4SYHL/HpxHATOMc84QrcTdqPb+p?= =?us-ascii?Q?rfczONCU9GhVbblfzOiVLQY2Y1MspUH22LmZXkpYM20QNN6Eitfwm0E/X90h?= =?us-ascii?Q?lx3X03Y/bsXMqMDiqO4bqIBu8Pu+XlpabYYaFv9qAaGiDWB2bWPz/gcdwMcY?= =?us-ascii?Q?sYC9vRPbg9ivHYtdLxGoY348PtMMPqkdh/pg3hy/KNtgHtoU9uhvcHyZKsFV?= =?us-ascii?Q?TIGsz1UfBYPw3HspB1KoURjCBI4aCsfyW2k/Tf8wbpfBOiuburRH+3V0cPOr?= =?us-ascii?Q?nbbgLzWUAD0ywZ+K5eQ46g/lTbD0cpk9g4+MoOWQbbNSEBxylyhwU3nFR2Ka?= =?us-ascii?Q?OyHp2eLNL6wfEWpegi26Qx1GyiakVGJEROLq8ztzMtCmAC4PxcAquSQpd/al?= =?us-ascii?Q?tH1ekAah1qI0EFHcUuvSu+AqwkOt/Wnj5hDh013S2zrzdGl5HGtGjyfd3OEZ?= =?us-ascii?Q?yinq5lAW1mms+BBIwTeCf3m28TQrwF/ubzlfdr3v+cUkb1+NZARxTJe9YBKg?= =?us-ascii?Q?FQuPJOCQ6SGXgA7ALfAYzps3?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: da4a2cf1-370c-4191-fd99-08d8e1d1759a X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2021 01:28:20.7762 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nR2NEtkVktoXVh1q5vZP9SwVCUDPxfDVyjRb4qdQBiAnd7j2cszTztVKrX4/13yqSwaon6UX9Uxh0tnOQlRCxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3867 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch looks good to me. Reviewed-by: Bob Feng -----Original Message----- From: Shi, Steven =20 Sent: Friday, February 26, 2021 2:07 PM To: devel@edk2.groups.io Cc: Shi, Steven ; Feng, Bob C ;= Liming Gao Subject: [PATCH] BaseTools: Fix build failure of "modules" option REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3238 The "modules" option in build command is to build all modules only but not = to generate the final FV image. The option doesn't work now and report make= file missing build failure. This patch fix this issue. Signed-off-by: Steven Shi Cc: Bob Feng Cc: Liming Gao --- BaseTools/Source/Python/build/build.py | 45 +++++++------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index c4cfe38ad9..810881c146 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -368,7 +368,7 @@ class ModuleMakeUnit(BuildUnit): def __init__(self, Obj, BuildCommand,Target): Dependency =3D [ModuleMakeUnit(La, BuildCommand,Target) for La in = Obj.LibraryAutoGenList] BuildUnit.__init__(self, Obj, BuildCommand, Target, Dependency, Ob= j.MakeFileDir) - if Target in [None, "", "all"]: + if Target in [None, "", "all", "modules"]: self.Target =3D "tbuild" =20 ## The smallest platform unit that can be built by nmake/make command in m= ulti-thread build mode @@ -868,14 +868,14 @@ class Build(): # CanSkipbyPreMakeCache and CreateCodeFile/CreateMakeF= ile. RetVal =3D PcdMa.SourceFileList # Force cache miss for PCD driver - if GlobalData.gUseHashCache and not GlobalData.gBinCac= heDest and self.Target in [None, "", "all"]: + if GlobalData.gUseHashCache and not GlobalData.gBinCac= heDest and self.Target in [None, "", "all", "modules"]: cqueue.put((PcdMa.MetaFile.Path, PcdMa.Arch, "PreM= akeCache", False)) =20 PcdMa.CreateCodeFile(False) PcdMa.CreateMakeFile(False,GenFfsList =3D DataPipe.Get= ("FfsCommand").get((PcdMa.MetaFile.Path, PcdMa.Arch),[])) PcdMa.CreateAsBuiltInf() # Force cache miss for PCD driver - if GlobalData.gBinCacheSource and self.Target in [None= , "", "all"]: + if GlobalData.gBinCacheSource and self.Target in [None= , "", "all", "modules"]: cqueue.put((PcdMa.MetaFile.Path, PcdMa.Arch, "Make= Cache", False)) =20 self.AutoGenMgr.join() @@ -1212,7 +1212,7 @@ class Build(): if FfsCommand is None: FfsCommand =3D {} # skip file generation for cleanxxx targets, run and fds target - if Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds']: + if Target not in ['cleanall', 'run', 'fds']: # for target which must generate AutoGen code and makefile mqueue =3D mp.Queue() for m in AutoGenObject.GetAllModuleInfo: @@ -1224,6 +1224,10 @@ class Build(): AutoGenObject.DataPipe.DataContainer =3D {"LibraryBuildDirecto= ryList":AutoGenObject.LibraryBuildDirectoryList} AutoGenObject.DataPipe.DataContainer =3D {"ModuleBuildDirector= yList":AutoGenObject.ModuleBuildDirectoryList} AutoGenObject.DataPipe.DataContainer =3D {"FdsCommandDict": Au= toGenObject.Workspace.GenFdsCommandDict} + # Fetch the MakeFileName. + self.MakeFileName =3D AutoGenObject.MakeFileName + if not self.MakeFileName: + self.MakeFileName =3D AutoGenObject.MakeFile self.Progress.Start("Generating makefile and code") data_pipe_file =3D os.path.join(AutoGenObject.BuildDir, "Globa= lVar_%s_%s.bin" % (str(AutoGenObject.Guid),AutoGenObject.Arch)) AutoGenObject.DataPipe.dump(data_pipe_file) @@ -1285,33 +1289,6 @@ class Build(): LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,L= ibAutoGen) return True =20 - # build module - if Target =3D=3D 'modules': - DirList =3D [] - for Lib in AutoGenObject.LibraryAutoGenList: - if not Lib.IsBinaryModule: - DirList.append((os.path.join(AutoGenObject.BuildDir, L= ib.BuildDir),Lib)) - for Lib, LibAutoGen in DirList: - NewBuildCommand =3D BuildCommand + ['-f', os.path.normpath= (os.path.join(Lib, self.MakeFileName)), 'pbuild'] - LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,L= ibAutoGen) - - DirList =3D [] - for ModuleAutoGen in AutoGenObject.ModuleAutoGenList: - if not ModuleAutoGen.IsBinaryModule: - DirList.append((os.path.join(AutoGenObject.BuildDir, M= oduleAutoGen.BuildDir),ModuleAutoGen)) - for Mod,ModAutoGen in DirList: - NewBuildCommand =3D BuildCommand + ['-f', os.path.normpath= (os.path.join(Mod, self.MakeFileName)), 'pbuild'] - LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,M= odAutoGen) - self.CreateAsBuiltInf() - if GlobalData.gBinCacheDest: - self.GenDestCache() - elif GlobalData.gUseHashCache and not GlobalData.gBinCacheSour= ce: - # Only for --hash - # Update PreMakeCacheChain files - self.GenLocalPreMakeCache() - self.BuildModules =3D [] - return True - # cleanlib if Target =3D=3D 'cleanlib': for Lib in AutoGenObject.LibraryBuildDirectoryList: @@ -1881,7 +1858,7 @@ class Build(): Ma.Workspace =3D Wa MaList.append(Ma) =20 - if GlobalData.gUseHashCache and not GlobalData= .gBinCacheDest and self.Target in [None, "", "all"]: + if GlobalData.gUseHashCache and not GlobalData= .gBinCacheDest and self.Target in [None, "", "all", "modules"]: if Ma.CanSkipbyPreMakeCache(): continue else: @@ -1907,7 +1884,7 @@ class Build(): if self.Target =3D=3D "genmake": return True =20 - if GlobalData.gBinCacheSource and self.Tar= get in [None, "", "all"]: + if GlobalData.gBinCacheSource and self.Tar= get in [None, "", "all", "modules"]: if Ma.CanSkipbyMakeCache(): continue else: @@ -2423,7 +2400,7 @@ class Build(): self.MakeCacheMiss =3D set() self.MakeCacheHit =3D set() if not self.ModuleFile: - if not self.SpawnMode or self.Target not in ["", "all"]: + if not self.SpawnMode or self.Target not in ["", "all", "modul= es"]: self.SpawnMode =3D False self._BuildPlatform() else: -- 2.28.0.windows.1