From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::331; helo=mail-wm1-x331.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 CF192211C8332 for ; Mon, 4 Feb 2019 08:48:43 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id m22so631918wml.3 for ; Mon, 04 Feb 2019 08:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sAjSNWgnlqFmly63B7jk2ckjpkWtVOkoItM4XinXXE0=; b=Pj41Hb738n19177/bgrT36PG83cTxZwj0G+fZ41zORXNG4Qk6hcoAQUl5PiPIgSRi7 VzhH3Ofj/T/AG3i5heh7lgRbqQrQ1bVRGlwmKm6jsriqq/MZh+WJC91w4kRKLuOWlXLr jPzx0x3zv+aH32bb3zaV3cHuNfje7tWAFLm6w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=sAjSNWgnlqFmly63B7jk2ckjpkWtVOkoItM4XinXXE0=; b=AlgnyARwYcVSijiH5/xztMgghXBQG3HiHcBtAosf4NF/flhZ4gGwD9+tVbFeJdgZ8h BZZ0ycw+ClxeDD1bUJQaT2FwN+cqykt+LXny/rGnDNXkilbzTl9metUWZrmO2i4lR6II rRN+tEUxq1ZNC6ODSyfiOPUvq935kIaiXS1RR9yIo47wN2z7wHK7+H2XoDlZXtyM6zzU dq24Cy19+ZxVvpri3bqed6rtxZw3dpxIyKnCMql6QJ8hr4Vtkiwi4DuYI2s/sV5z62Dy ihj2CqK/Tuxij/IKLdbnFh7FNnr0RPBp0S9+D4J4WfKUvnuX0hi/zcYDzPc1HBnkZhUt sb0w== X-Gm-Message-State: AHQUAuYjGTdMZpba36z4d64UxSxpnenBxGWyraFQNF1FtXEGxPGEIIba HRRHfmKTNv4aeVcOVrHOsyKPAg== X-Google-Smtp-Source: AHgI3IYBWg3nERlVumFeqpJavgyC7oB/XwBLHaBf6YfH+6jA+AyTberwqfpsonAar8DmUpG4hteiQA== X-Received: by 2002:a1c:c2d4:: with SMTP id s203mr229339wmf.3.1549298921082; Mon, 04 Feb 2019 08:48:41 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id h62sm12187556wmf.11.2019.02.04.08.48.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Feb 2019 08:48:40 -0800 (PST) Date: Mon, 4 Feb 2019 16:48:38 +0000 From: Leif Lindholm To: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Cc: Liming Gao , Bob Feng , edk2-devel@lists.01.org Message-ID: <20190204164838.v5uwriipy4zjqo4i@bivouac.eciton.net> References: <20190204095805.goisffon477z5i3b@bivouac.eciton.net> <93ed2166-35be-9529-314d-234b1a95c93e@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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 16:48:44 -0000 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Feb 04, 2019 at 01:22:03PM +0100, Philippe Mathieu-Daudé wrote: > On 2/4/19 12:54 PM, Philippe Mathieu-Daudé 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) = IA32 > >> Build target = NOOPT > >> Toolchain = GCC5 > >> > >> Active Platform = /work/git/edk2/OvmfPkg/OvmfPkgIa32.dsc > >> Flash Image Definition = /work/git/edk2/OvmfPkg/OvmfPkgIa32.fdf > >> > >> Processing meta-data ... > >> > >> > >> build.py... > >> : error C0DE: Unknown fatal error when processing [/work/git/edk2/OvmfPkg/OvmfPkgIa32.dsc] > >> > >> (Please send email to edk2-devel@lists.01.org for help, attaching following call stack trace!) > >> > >> (Python 3.5.3 on linux) Traceback (most recent call last): > >> File "/work/git/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2387, in Main > >> MyBuild.Launch() > >> File "/work/git/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2141, in Launch > >> self._MultiThreadBuildPlatform() > >> File "/work/git/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 1921, in _MultiThreadBuildPlatform > >> self.Progress > >> File "/work/git/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", line 304, in __init__ > >> self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs) > >> File "/work/git/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", line 477, in _InitWorker > >> for BuildData in PGen.BuildDatabase._CACHE_.values(): > >> RuntimeError: dictionary changed size during iteration > > > > 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 :) I can confirm this change *appears* to fix the problem with both python3.5 and python2.7. So from my end: Tested-by: Leif Lindholm Thanks! > > -- >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 = 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 != Arch: > continue > --- >