Bug 221266 - [webkitcorepy] Autoinstaller can fail on packages containing write protected files
Summary: [webkitcorepy] Autoinstaller can fail on packages containing write protected ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Don Olmstead
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-02 09:24 PST by Don Olmstead
Modified: 2021-02-02 15:11 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.98 KB, patch)
2021-02-02 12:04 PST, Don Olmstead
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Olmstead 2021-02-02 09:24:05 PST
This is kind of a fringe issue that I've had happen to me a few times. One of the packages, logilab.common, contains a write-protected file. Looks like if an autoinstall of a package fails the temp directory the tar is extracted to is still present. When the install is run again the tar can't be extracted because the write protected file is present and its being written to.

Traceback (most recent call last):
  File "C:\webkit\Tools\Scripts\webkitpy\test\main.py", line 321, in <module>
    sys.exit(main())
  File "C:\webkit\Tools\Scripts\webkitpy\test\main.py", line 76, in main
    return not tester.run()
  File "C:\webkit\Tools\Scripts\webkitpy\test\main.py", line 149, in run
    return self._run_tests(names)
  File "C:\webkit\Tools\Scripts\webkitpy\test\main.py", line 156, in _run_tests
    AutoInstall.install_everything()
  File "C:\webkit\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\autoinstall.py", line 512, in install_everything
    package.install()
  File "C:\webkit\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\autoinstall.py", line 241, in install
    archive.unpack(temp_location)
  File "C:\webkit\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\autoinstall.py", line 90, in unpack
    file.extractall(target)
  File "C:\Users\eolmstead\Documents\webkit-trunk\tools\python3\lib\tarfile.py", line 2034, in extractall
    self.extract(tarinfo, path, set_attrs=not tarinfo.isdir(),
  File "C:\Users\eolmstead\Documents\webkit-trunk\tools\python3\lib\tarfile.py", line 2075, in extract
    self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
  File "C:\Users\eolmstead\Documents\webkit-trunk\tools\python3\lib\tarfile.py", line 2147, in _extract_member
    self.makefile(tarinfo, targetpath)
  File "C:\Users\eolmstead\Documents\webkit-trunk\tools\python3\lib\tarfile.py", line 2188, in makefile
    with bltn_open(targetpath, "wb") as target:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\EOLMST~1\\AppData\\Local\\Temp\\2\\logilab.common\\logilab-common-1.8.1\\test\\data\\write_protected_file.txt'
Comment 1 Don Olmstead 2021-02-02 12:04:41 PST
Created attachment 419044 [details]
Patch
Comment 2 EWS 2021-02-02 15:10:56 PST
Committed r272240: <https://trac.webkit.org/changeset/272240>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 419044 [details].
Comment 3 Radar WebKit Bug Importer 2021-02-02 15:11:14 PST
<rdar://problem/73901124>