Bug 263392 - [AutoInstall] Wheel unpack deletes directory rather than just unpacking
Summary: [AutoInstall] Wheel unpack deletes directory rather than just unpacking
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-19 12:46 PDT by Sam Sneddon [:gsnedders]
Modified: 2023-10-19 12:46 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2023-10-19 12:46:19 PDT
Per https://packaging.python.org/en/latest/specifications/binary-distribution-format/#installing-a-wheel-distribution-1-0-py32-none-any-whl, we should just be unpacking the archive.

However, currently, for each file in the wheel, we:

    for directory in to_be_moved:
        shutil.rmtree(os.path.join(AutoInstall.directory, directory), ignore_errors=True)
        shutil.move(os.path.join(temp_location, directory), AutoInstall.directory)

(https://github.com/WebKit/WebKit/blob/723eb83c4fdb24e0d50c664452328dc6188ca7dd/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py#L400-L402)

This means that when we unpack autobahn (20.7.1), which contains:

gsnedders@gsnedders-marsha ~ % grep '^twisted' '/var/folders/qk/hmjj9_lx2cg3_4v3vx3y7y_w0000gn/T/autobahn-77395/autobahn-20.7.1.dist-info/RECORD'
twisted/plugins/autobahn_endpoints.py,sha256=6XClHTi8llFb6p6iKE3npCYGlNwJZwCcs3fSc2knE0c,6349
twisted/plugins/autobahn_twistd.py,sha256=9mccXpFlai3XpoYHAtxAynedzogaLb6XM7-Qb9IF5yQ,1566

…we end up deleting all of twisted, rather than just unpacking these files into the twisted package.

(This is the cause of some of the failures on bug 263119.)
Comment 1 Radar WebKit Bug Importer 2023-10-19 12:46:40 PDT
<rdar://problem/117220777>