From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.128.68; helo=mail-wm1-f68.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E2C7921B02822 for ; Mon, 4 Feb 2019 04:22:07 -0800 (PST) Received: by mail-wm1-f68.google.com with SMTP id z5so4992180wmf.0 for ; Mon, 04 Feb 2019 04:22:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:openpgp:message-id :date:user-agent:mime-version:in-reply-to; bh=jTKo4oSFQddhV6cZ876F8dWMUMXhKtnA/ix7AZ2sL7c=; b=tE+hviA4tCPthO4mQbx2yYD50pl3ubMbv5E4KSzElAhi/KrcuX/mCYth0rU9xabXVD GgVuwpPwfNFs8JxDnW4Mzx5zN4WY7L16m5XwGK2bBDZ65Uh3HvdI3TnW0FrDUkIiQEuj 0OREQC3srWeM/MzaGb0ogkVCZ87GU0LNUfthgcamCbvLLaeyTDvvl9stXlbXQD/EyZj3 L7g8H01zzd/qKg9OE9eIdhbxH1SDxTGuNHtLCKcdh9O92XOy0vVFKKAMbyqRzamKc8hj eSFaWFn/F0TJSrsSAi7w+2ic/7gqIUEpui7dJWoq9IsqkTDoKAg9Oy+/DGbgq3w9kjQx fsQw== X-Gm-Message-State: AHQUAuZbcLM/GRgbNFV99/5b1tEYb135vo0WH6YrPPc44Y7Z5/buGe2s NlCNZewlqkUtoOahEmEyZkAUCSxiHNY= X-Google-Smtp-Source: AHgI3IaOsDlhC70izKbs5zNYcGGM6PuM/MiDJyKsGpjv2oKbUt7wOEmLKvR7Wp7YRLtFnoqwcS1NGg== X-Received: by 2002:a7b:cd85:: with SMTP id y5mr12746717wmj.129.1549282925999; Mon, 04 Feb 2019 04:22:05 -0800 (PST) Received: from [192.168.1.33] (110.red-83-51-161.dynamicip.rima-tde.net. [83.51.161.110]) by smtp.gmail.com with ESMTPSA id n6sm10206599wmk.9.2019.02.04.04.22.04 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 04:22:05 -0800 (PST) From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= To: Liming Gao , Bob Feng , Leif Lindholm Cc: edk2-devel@lists.01.org References: <20190204095805.goisffon477z5i3b@bivouac.eciton.net> <93ed2166-35be-9529-314d-234b1a95c93e@redhat.com> Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: Date: Mon, 4 Feb 2019 13:22:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <93ed2166-35be-9529-314d-234b1a95c93e@redhat.com> Subject: Re: BaseTools: build failure when specifying multiple BUILDTARGET X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2019 12:22:08 -0000 X-Groupsio-MsgNum: 36274 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KF7OL9IrUCyu5c9fhqsjsntuw00I5J1sF" --KF7OL9IrUCyu5c9fhqsjsntuw00I5J1sF Content-Type: multipart/mixed; boundary="yBGXh4yiyHL6LbGPul8aL0p90NJFBSN6F"; protected-headers="v1" From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= To: Liming Gao , Bob Feng , Leif Lindholm Cc: edk2-devel@lists.01.org Message-ID: Subject: Re: [edk2] BaseTools: build failure when specifying multiple BUILDTARGET References: <20190204095805.goisffon477z5i3b@bivouac.eciton.net> <93ed2166-35be-9529-314d-234b1a95c93e@redhat.com> In-Reply-To: <93ed2166-35be-9529-314d-234b1a95c93e@redhat.com> --yBGXh4yiyHL6LbGPul8aL0p90NJFBSN6F Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2/4/19 12:54 PM, Philippe Mathieu-Daud=C3=A9 wrote: > On 2/4/19 10:58 AM, Leif Lindholm wrote: >> Hi Bob, Liming, >> >> With the latest BaseTools (current HEAD, 6c61ec4c62), building >> multiple targets from a single command line crashes. >> >> To reproduce: >> build -a IA32 -t GCC5 -b RELEASE -b NOOPT -p OvmfPkg/OvmfPkgIa32.dsc >> (I first built with -n32, but dropped that to see if it would make a >> difference - it does not.) >> >> The first target specified builds successfully. When starting on the >> second, the output is as below, and build exits. >> >> / >> Leif >> >> Architecture(s) =3D IA32 >> Build target =3D NOOPT >> Toolchain =3D GCC5 >> >> Active Platform =3D /work/git/edk2/OvmfPkg/OvmfPkgIa32.dsc >> Flash Image Definition =3D /work/git/edk2/OvmfPkg/OvmfPkgIa32.fdf >> >> Processing meta-data ... >> >> >> build.py... >> : error C0DE: Unknown fatal error when processing [/work/git/edk2/Ovm= fPkg/OvmfPkgIa32.dsc] >> >> (Please send email to edk2-devel@lists.01.org for help, attaching foll= owing call stack trace!) >> >> (Python 3.5.3 on linux) Traceback (most recent call last): >> File "/work/git/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Py= thon/build/build.py", line 2387, in Main >> MyBuild.Launch() >> File "/work/git/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Py= thon/build/build.py", line 2141, in Launch >> self._MultiThreadBuildPlatform() >> File "/work/git/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Py= thon/build/build.py", line 1921, in _MultiThreadBuildPlatform >> self.Progress >> File "/work/git/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", li= ne 304, in __init__ >> self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *ar= gs, **kwargs) >> File "/work/git/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", li= ne 477, in _InitWorker >> for BuildData in PGen.BuildDatabase._CACHE_.values(): >> RuntimeError: dictionary changed size during iteration >=20 > I believe the culprit is f8d11e5a4aaa. With Python3 the dict.value() method returns an iterator. Using list() to force a copy works for me. Since I'm not a Python expert (and less with joys of py2/py3 conversion), I'll start sharing a snippet rather than a formal patch :) -- >8 -- --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -475,5 +475,5 @@ class WorkspaceAutoGen(AutoGen): # generate the SourcePcdDict and BinaryPcdDict PGen =3D PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch) - for BuildData in PGen.BuildDatabase._CACHE_.values(): + for BuildData in list(PGen.BuildDatabase._CACHE_.values()): if BuildData.Arch !=3D Arch: continue --- --yBGXh4yiyHL6LbGPul8aL0p90NJFBSN6F-- --KF7OL9IrUCyu5c9fhqsjsntuw00I5J1sF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEicHnj2Ae6GyGdJXLoqP9bt6twN4FAlxYLmwACgkQoqP9bt6t wN4Wow//YIoB4pupsCsB+nwECnVHUWMnqRrW5wRC3i6H72+Sf2yfrIfrIvyb5KNA pTN/Z7PN6ItAiGT6qJAkub4jJYdkpbClLWssOIC9ELZH6EJ5z9WQ4musMTkvEeCB RLl7xv2Aer9D/zAVnAjv3rhIZTXaClkNLVNFZx8SChBTAcNSCY5Ne/f0N9qFYL3s GZabMWsm1yBuKtQngfe9MxB8EEztNQhDLP0ugvbML4377lVpOTSIxIcqjvOaNc8m MTvsMBTfErazTQf0e1LxjUHdRu7ljXlfpRcwuvyikIJ3cYUmuoocMEIit3T2WPah v39wYz2EsH2wNkWhUWIgiX52CnY70Sq/dCnXiyTCGOmMcE4rbVDXHvPkes+TNeoc YRpkXI55q1QWsYjClFGGfd+QmPs8sKQNYLlnrDfGEZbLSaQeVpgm/wN7C50KrVjb b9hJCpNA7sMDrt7J2RG/lE9uIhIfby9wpA3urJMH/akeuJ61gtnTELKRJ+++N0rg UEo2nTRJQUNcNhDN0iyhn5iD7jKsXSeUi/vXHs1BZKfcN2IMDU1PaboGrEr8Ig+U z8qM2xgvIzD0qsUoVTvEAXUvPkqnu2Px8TlGpLui0eLdsFzvaJmThEQkdk0yiVcM jp4VkG4AxrNElSQkz6AIwGHHDVH0EqVJ84awxw7+GmW2H37H560= =TatE -----END PGP SIGNATURE----- --KF7OL9IrUCyu5c9fhqsjsntuw00I5J1sF--