From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.221.41; helo=mail-wr1-f41.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 C195D21962301 for ; Wed, 6 Feb 2019 15:08:28 -0800 (PST) Received: by mail-wr1-f41.google.com with SMTP id v16so7615439wrn.11 for ; Wed, 06 Feb 2019 15:08:28 -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:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mBm8DRlEU8al86QmxfqjkM3Ke8UuSl/Eil5zHaXTSR8=; b=CbXHMEREhQBR2/ECq5e2Y4H6kLNSreArYH2o4K99fkPdriGQJWx6jkzgRR42JNR87V uSbYy5eAonibfIhpT2o6cFfb5KhR2UlcGMGZBRkHKXcVhrIWwlCh+FlhK7kEpJBszuAy JMfX+2jRSBEi5C2TpFFlm1+ZxtPjbgWoV7kieTw/C4OLlFuuxy2ekDkgw5mtwn6By8Qk kQRXcYqd6Dxbmc4xTrkTdpy+KX7nLk0+pquT797W3qfan7mhyctO7TmtugNqaZkRmgpa cI4/+UYH0appqoJXHnYNfztW3MMEyDW1KgPqKEr49A1ZmsP8iso8T6wgN19ukfaakwnZ FwaQ== X-Gm-Message-State: AHQUAuYwS3wYhM3b5gW2w9GSniHxtubexQ0AhIgiaaqsQlnpZbiB/pUV HuCOWrxUqTKeXHvtvW86bQ4olA== X-Google-Smtp-Source: AHgI3IZw2PvZw43z8OUNrke1S+nLDm06jqG66zbgyE3Wid6kxttu1ydezC9Q/ZQCDt1UzTypEwolQA== X-Received: by 2002:a5d:5405:: with SMTP id g5mr10066931wrv.138.1549494507060; Wed, 06 Feb 2019 15:08:27 -0800 (PST) Received: from [192.168.1.103] (10.red-83-35-153.dynamicip.rima-tde.net. [83.35.153.10]) by smtp.gmail.com with ESMTPSA id w14sm1805381wrt.95.2019.02.06.15.08.26 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 15:08:26 -0800 (PST) To: "Carsey, Jaben" , Laszlo Ersek , "Kinney, Michael D" , "edk2-devel@lists.01.org" Cc: Leif Lindholm , Liming Gao References: <20190206120344.15681-1-philmd@redhat.com> <5e7b288c-32ad-124f-b9cd-1d916e6281af@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: <17ddf202-bb0c-ab98-f50c-b2bef9c17082@redhat.com> Date: Thu, 7 Feb 2019 00:08:25 +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: Subject: Re: [PATCH v2] BaseTools: Fix 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: Wed, 06 Feb 2019 23:08:29 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 2/6/19 10:11 PM, Carsey, Jaben wrote: > Reviewed-by: Jaben Carsey > > And pushed. Thanks! And I learned the hard way git config 'user.name' is obviously different than 'sendemail.from'... Liming asked me to not use non-ASCII character in commit message so I fixed my user.name, but forgot the sendemail.from, and now I see my lastname got mojibaked :S No worry, my bad. Regards, Phil. >> -----Original Message----- >> From: Laszlo Ersek [mailto:lersek@redhat.com] >> Sent: Wednesday, February 06, 2019 8:26 AM >> To: Philippe Mathieu-Daudé ; Kinney, Michael D >> ; edk2-devel@lists.01.org; Carsey, Jaben >> >> Cc: Leif Lindholm >> Subject: Re: [PATCH v2] BaseTools: Fix build failure when specifying multiple >> BUILDTARGET >> >> On 02/06/19 13:03, Philippe Mathieu-Daudé wrote: >>> With Python3, the dict.value() method returns an iterator. >>> If a dictionary is updated while an iterator on its keys is used, >>> a RuntimeError is generated. >>> Converting the iterator to a list() forces a copy of the mutable >>> keys in an immutable list which can be safely iterated. >>> >>> Commit f8d11e5a4aaa converted various uses but missed one: >>> When specifying multiple BUILDTARGET, the first target builds >>> successfully, but then the PGen.BuildDatabase._CACHE_ dictionary is >>> updated, and accessing the next target triggers a RuntimeError. >>> >>> Convert this iterator to an immutable list, to solve this build error: >>> >>> $ build -a IA32 -t GCC5 -b RELEASE -b NOOPT -p >> OvmfPkg/OvmfPkgIa32.dsc >>> [...] >>> Processing meta-data ... >>> build.py... >>> : error C0DE: Unknown fatal error when processing >> [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 >> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line >> 2387, in Main >>> MyBuild.Launch() >>> File >> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line >> 2141, in Launch >>> self._MultiThreadBuildPlatform() >>> File >> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line >> 1921, in _MultiThreadBuildPlatform >>> self.Progress >>> File "BaseTools/Source/Python/AutoGen/AutoGen.py", line 304, in >> __init__ >>> self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args, >> **kwargs) >>> File "BaseTools/Source/Python/AutoGen/AutoGen.py", line 477, in >> _InitWorker >>> for BuildData in PGen.BuildDatabase._CACHE_.values(): >>> RuntimeError: dictionary changed size during iteration >>> >>> Note: The culprit commit (f8d11e5a4aaa) can not be found with bisection. >>> In 9c2d68c0a299 the build tools default to the python version provided >>> by the ${PYTHON} environment variable, however the Python3 transition is >>> not functional before d943b0c339fe. f8d11e5a4aaa falls between the >>> previous two. >>> >>> Reported-by: Leif Lindholm >>> Fixes: f8d11e5a4aaa90bf63b4789f3993dd6d16c60787 >>> Contributed-under: TianoCore Contribution Agreement 1.1 >>> Signed-off-by: Philippe Mathieu-Daude >>> Tested-by: Leif Lindholm >>> Acked-by: Laszlo Ersek >>> --- >>> v2: >>> - fixed English errors (Laszlo) >>> - the paragraph about bisection not working is not relevant to >>> the fix, keep it as background info but move it after (Laszlo) >>> Signed-off-by: Philippe Mathieu-Daudé >>> --- >>> BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >> b/BaseTools/Source/Python/AutoGen/AutoGen.py >>> index a95d2c710e..12592a2a46 100644 >>> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py >>> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >>> @@ -474,7 +474,7 @@ 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 >>> if BuildData.MetaFile.Ext == '.inf': >>> >> >> Looks nice, thanks! My A-b stands. >> >> Laszlo