Bug 284088

Summary: [AutoInstall] don't mutate sys.path
Product: WebKit Reporter: Sam Sneddon [:gsnedders] <gsnedders>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 285094    
Bug Blocks:    

Sam Sneddon [:gsnedders]
Reported 2024-12-04 20:29:03 PST
There shouldn't be any need to mutate sys.path at all; this actually leads to a kinda weird interaction between where the AutoInstaller lives on sys.meta_path and where the AutoInstaller has added directories on sys.path. Our importlib.abc.MetaPathFinder.find_spec should just return a spec that suffices to load the module, and thus no sys.path modification should be necessary. We can probably even delegate most of the actual implementation to importlib.machinery.FileFinder. Note that if we stop mutating sys.path, we should _also_ make sure we also implement DistributionFinder.find_distributions so importlib.metadata can continue to find distribution metadata.
Attachments
Radar WebKit Bug Importer
Comment 1 2024-12-11 20:30:16 PST
Note You need to log in before you can comment on or make changes to this bug.