Update our copy of the in-tree virtualenv to v16
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: ahal, Assigned: rstewart)
References
Details
Attachments
(1 file, 4 obsolete files)
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment 4•7 years ago
|
||
bugherder |
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Reporter | ||
Comment 7•7 years ago
|
||
Updated•7 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Comment 8•6 years ago
|
||
Reporter | ||
Comment 9•6 years ago
|
||
Depends on D49975
Reporter | ||
Comment 10•6 years ago
|
||
Depends on D49979
Reporter | ||
Comment 11•6 years ago
|
||
The last patch in the stack upgrade to 16.7.5 and also fixes the issue that caused the backout last year. Basically pip was refactored and the pip.req
module no longer existed. I had to re-write some of the logic in virtualenv.py
to get it working again.
I had been sitting on these patches for awhile because they haven't been properly tested. I'm uploading them now so A) I don't forget about them, and B) so other people don't try to re-solve the same issue. Probably won't have time to push them through right now though, so feel free to steal these patches and get them landed.
Reporter | ||
Comment 13•6 years ago
|
||
I discovered our vendored copy of pip-tools
is broken with pip >= 19
(which this change would update us to). So we need to update to at least pip-tools==3.3.1
first. Though updating to the latest pip-tools
causes problem with our current pip
. I found pip-tools==3.9.0
seemed to work.
Though I don't have a patch because ./mach vendor python
seems to update everything, not just the specified package. If someone wants to pick this up I'd be very happy to help!
Updated•6 years ago
|
Updated•6 years ago
|
Comment 14•6 years ago
•
|
||
I've been seeing an error when running mach with the upgraded virtualenv library.
~/w/firefox ./mach python-test xxx 835ms Wed 04 Dec 2019 10:38:15 AM EST
New python executable in /home/mars/work/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python2.7
Also creating executable in /home/mars/work/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python
Installing setuptools, pip, wheel...
done.
....
Processing ./third_party/python/virtualenv
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: /home/mars/work/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python2.7 /home/mars/work/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/init/local/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-lMM6io/overlay --no-warn-script-location --no-binary :none: --only-binary :none: --no-index -- 'setuptools >= 40.6.3' 'wheel >= 0.29.0'
cwd: None
ERROR: Could not find a version that satisfies the requirement setuptools>=40.6.3 (from versions: none)
ERROR: No matching distribution found for setuptools>=40.6.3
This is because updating the virtualenv package also updates the version of pip that is installed in our init/ virtualenv. Our current version of virtulaenv bundles pip 9.0.3 and installs it into into the virtualenv during venv creation. The upgraded virtualenv package bundles pip 19.3.1. Our code in mozbuild.virtualenv.VirtualenvManager.install_pip_package()
that installs packages into the init/ virtualenv after initial setup works differently on pip v19, causing the error I'm seeing above.
Our code installs packages with the --no-index
and --no-deps
flags. This is how we achieve build isolation. You can simulate this on a m-c checkout with the following command:
~/w/firefox obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/pip install --no-index --no-deps third_party/python/virtualenv 1179ms Tue 03 Dec 2019 10:38:24 PM EST
Processing ./third_party/python/virtualenv
Installing collected packages: virtualenv
Running setup.py install for virtualenv ... done
Successfully installed virtualenv-15.2.0
When we run mach python-test
the python-test command setup tries to install the virtualenv
package into the init/ venv (the virtualenv package is a pipenv dependency, and we use pipenv to run the python test suite). The virtualenv
package has a setup_requires
dependency on setuptools. Because our code calls pip install
with the --no-index
flag, pip fails to find the setuptools
package that is already present in the virtualenv and dies.
We can see this if we switch to the branch with the updated virtualenv. We can verify that the virtualenv is pre-populated with the correct dependencies:
~/w/firefox obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/pip list | grep setuptools 564ms Wed 04 Dec 2019 11:02:39 AM EST
setuptools 41.6.0
And simulate the package installation:
~/w/firefox obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/pip install --no-index --no-deps third_party/python/virtualenv
...
ERROR: No matching distribution found for setuptools>=40.6.3
We might be able to work around this using --no-index
--find-links
pointing at the third_party/python directory (example). Or we could add virtualenv to the build/virtualenv_packages.txt file so mozbuild.base.MozbuildObject.ensure_pipenv()
does not need to install it.
:ahal what do you think?
Assignee | ||
Comment 15•6 years ago
|
||
Updated•6 years ago
|
Reporter | ||
Comment 16•6 years ago
|
||
I circled back with :mars on IRC but just to update the bug. It seems like the root of some of the issues was the use of pipenv
to manage virtualenvs in our mach python-test
infra. I put up a patch in bug 1601445 that changes this assumption (removes pipenv
).
I'm not 100% sure if it unblocks this bug, but would be my preferred approach if it does. Though, that change itself causes some mozbuild
test failures. I'm also fine with playing around with --no-index
/ --find-links
if we can get something working with those however. Basically anything that can unblock us here gets a big +1 from me.
Comment 17•6 years ago
|
||
Updated•6 years ago
|
Comment 18•6 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Description
•