Bug 260997

Summary: AutoInstall.install_everything is unsafe
Product: WebKit Reporter: Sam Sneddon [:gsnedders] <gsnedders>
Component: Tools / TestsAssignee: Sam Sneddon [:gsnedders] <gsnedders>
Status: RESOLVED FIXED    
Severity: Normal CC: jbedard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 261004    

Description Sam Sneddon [:gsnedders] 2023-08-31 15:01:38 PDT
INTERNALERROR>   File "/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/libraries/resultsdbpy/.tox/py39/lib/python3.9/site-packages/webkitcorepy/autoinstall.py", line 642, in install_everything
INTERNALERROR>     for packages in cls.packages.values():
INTERNALERROR> RuntimeError: dictionary changed size during iteration

I believe this is caused by:

AutoInstall.register(Package('twisted', Version(21, 2, 0), pypi_name='Twisted', implicit_deps=[
    Package('incremental', Version(21, 3, 0)),
]))

…where the AutoInstaller will AutoInstall twisted, and then recurse into its implicit_deps, and it will then register incremental as it begins to install it—thus mutating the dict being iterated over.
Comment 1 Sam Sneddon [:gsnedders] 2023-08-31 18:01:58 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17317
Comment 2 EWS 2023-09-01 08:37:56 PDT
Committed 267552@main (d94691e07a31): <https://commits.webkit.org/267552@main>

Reviewed commits have been landed. Closing PR #17317 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-09-01 08:38:16 PDT
<rdar://problem/114822346>