Bug 215067 - [webkitcorepy] Use setup.py for the autoinstaller
Summary: [webkitcorepy] Use setup.py for the autoinstaller
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: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-01 17:01 PDT by Jonathan Bedard
Modified: 2022-02-04 23:28 PST (History)
10 users (show)

See Also:


Attachments
Patch (6.19 KB, patch)
2020-08-01 17:15 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (7.00 KB, patch)
2020-08-03 08:28 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (10.42 KB, patch)
2020-08-03 09:15 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (10.39 KB, patch)
2020-08-03 09:57 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (10.40 KB, patch)
2020-08-03 10:36 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (10.37 KB, patch)
2020-08-04 10:34 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (3.46 KB, patch)
2020-08-04 17:22 PDT, Jonathan Bedard
jbedard: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2020-08-01 17:01:44 PDT
Previously, we were just moving the Python files directly. This wouldn't work if the library in question has C dependencies (the webkitpy autoinstaller had a similar issue). setup.py is the blessed way to install in a custom location.
Comment 1 Radar WebKit Bug Importer 2020-08-01 17:02:56 PDT
<rdar://problem/66432719>
Comment 2 Jonathan Bedard 2020-08-01 17:15:06 PDT
Created attachment 405799 [details]
Patch
Comment 3 Jonathan Bedard 2020-08-01 17:17:11 PDT
(In reply to Jonathan Bedard from comment #2)
> Created attachment 405799 [details]
> Patch

I've tested this with a few cryptography libraries that require compilation. So far, I haven't found a library where this approach does not work, assuming the libraries it depends on are also specified.
Comment 4 Aakash Jain 2020-08-03 05:23:15 PDT
This patch seems to break api tests on mac.

e.g.: https://ews-build.webkit.org/#/builders/3/builds/29658

subprocess.CalledProcessError: Command 
'['/usr/bin/python', 
'/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/libraries/autoinstalled/python-2/urllib3.tmp/urllib3-1.25.10/setup.py', 
'install', 
'--home=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/libraries/autoinstalled/python-2', 
'--root=/', 
'--single-version-externally-managed', 
'--install-lib=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/libraries/autoinstalled/python-2', 
'--install-scripts=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/libraries/autoinstalled/python-2', 
'--install-data=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/libraries/autoinstalled/python-2/data', 
'--install-headers=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/libraries/autoinstalled/python-2/headers', 
'--old-and-unmanageable']' 
returned non-zero exit status 1
Comment 5 Jonathan Bedard 2020-08-03 07:58:44 PDT
(In reply to Aakash Jain from comment #4)
> This patch seems to break api tests on mac.
> 
> e.g.: https://ews-build.webkit.org/#/builders/3/builds/29658
> 
> subprocess.CalledProcessError: Command 
> '['/usr/bin/python', 
> '/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/libraries/
> autoinstalled/python-2/urllib3.tmp/urllib3-1.25.10/setup.py', 
> 'install', 
> '--home=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/
> libraries/autoinstalled/python-2', 
> '--root=/', 
> '--single-version-externally-managed', 
> '--install-lib=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/
> libraries/autoinstalled/python-2', 
> '--install-scripts=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/
> Scripts/libraries/autoinstalled/python-2', 
> '--install-data=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/Scripts/
> libraries/autoinstalled/python-2/data', 
> '--install-headers=/Volumes/Data/worker/API-Tests-macOS-EWS/build/Tools/
> Scripts/libraries/autoinstalled/python-2/headers', 
> '--old-and-unmanageable']' 
> returned non-zero exit status 1

Going to increase logging....bit weird that it broke API tests on Mac and nothing else, would have expected this to be all or nothing.
Comment 6 Jonathan Bedard 2020-08-03 08:28:13 PDT
Created attachment 405831 [details]
Patch
Comment 7 Jonathan Bedard 2020-08-03 09:08:08 PDT
(In reply to Jonathan Bedard from comment #5)
> (In reply to Aakash Jain from comment #4)
> > ....
> 
> Going to increase logging....bit weird that it broke API tests on Mac and
> nothing else, would have expected this to be all or nothing.

Fun! we have an outdated version of setuptools on these bots....which, rather ironically, means we need to install setup tools before installing anything else.
Comment 8 Jonathan Bedard 2020-08-03 09:15:55 PDT
Created attachment 405834 [details]
Patch
Comment 9 Jonathan Bedard 2020-08-03 09:57:22 PDT
Created attachment 405845 [details]
Patch
Comment 10 Jonathan Bedard 2020-08-03 10:36:36 PDT
Created attachment 405850 [details]
Patch
Comment 11 Jonathan Bedard 2020-08-04 10:34:59 PDT
Created attachment 405928 [details]
Patch
Comment 12 Stephanie Lewis 2020-08-04 10:37:49 PDT
Talked over the patch with Jonathan and decided we should keep the egg info because it has a lot of dependencies which we can use to write an automatable dependency list
Comment 13 EWS 2020-08-04 12:06:51 PDT
Committed r265254: <https://trac.webkit.org/changeset/265254>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405928 [details].
Comment 14 Fujii Hironori 2020-08-04 15:58:40 PDT
WinCairo buildbot is failing since this change.

https://build.webkit.org/builders/WinCairo%2064-bit%20WKL%20Release%20%28Tests%29/builds/7779

No handlers could be found for logger "webkitcorepy"
Traceback (most recent call last):
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\webkitpy\layout_tests\run_webkit_tests.py", line 40, in <module>
    from webkitpy.layout_tests.controllers.manager import Manager
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py", line 60, in <module>
    from webkitpy.results.upload import Upload
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\webkitpy\results\upload.py", line 23, in <module>
    import webkitpy.thirdparty.autoinstalled.requests
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\webkitpy\thirdparty\autoinstalled\requests\__init__.py", line 43, in <module>
    import urllib3
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\autoinstall.py", line 405, in find_module
    cls.install(name)
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\autoinstall.py", line 390, in install
    return to_install.install()
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\autoinstall.py", line 185, in install
    AutoInstall.install('setuptools')
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\autoinstall.py", line 390, in install
    return to_install.install()
  File "C:\WebKit-BuildWorker\wincairo-wkl-release-tests\build\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\autoinstall.py", line 238, in install
    stderr=devnull,
  File "C:\tools\python\lib\subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\tools\\python\\python.exe', 'C:\\WebKit-BuildWorker\\wincairo-wkl-release-tests\\build\\Tools\\Scripts\\libraries\\autoinstalled\\python-2\\setuptools.tmp\\setuptools-41.0.1\\setup.py', 'install', '--home=C:\\WebKit-BuildWorker\\wincairo-wkl-release-tests\\build\\Tools\\Scripts\\libraries\\autoinstalled\\python-2', '--root=/', '--single-version-externally-managed', '--install-lib=C:\\WebKit-BuildWorker\\wincairo-wkl-release-tests\\build\\Tools\\Scripts\\libraries\\autoinstalled\\python-2', '--install-scripts=C:\\WebKit-BuildWorker\\wincairo-wkl-release-tests\\build\\Tools\\Scripts\\libraries\\autoinstalled\\python-2', '--install-data=C:\\WebKit-BuildWorker\\wincairo-wkl-release-tests\\build\\Tools\\Scripts\\libraries\\autoinstalled\\python-2\\data', '--install-headers=C:\\WebKit-BuildWorker\\wincairo-wkl-release-tests\\build\\Tools\\Scripts\\libraries\\autoinstalled\\python-2\\headers', '--old-and-unmanageable']' returned non-zero exit status 1
Comment 15 Jonathan Bedard 2020-08-04 17:22:00 PDT
Reopening to attach new patch.
Comment 16 Jonathan Bedard 2020-08-04 17:22:01 PDT
Created attachment 405964 [details]
Patch
Comment 17 Jonathan Bedard 2020-08-04 17:52:28 PDT
Comment on attachment 405964 [details]
Patch

Thanks to the Sony folks for finding the actual fix, this will not resolve the issue. Marking the patch as obsolete..
Comment 18 Fujii Hironori 2020-08-04 18:09:10 PDT
Filed another ticket to fix the WinCairo issue.
Bug 215152 – [webkitcorepy] REGRESSION(r265254): autoinstaller is failing to execute setup.py on win32 Python
Comment 19 Roy Reapor 2022-02-04 23:28:43 PST
rdar://88521722