Upgrade vendored virtualenv
Categories
(Firefox Build System :: General, task)
Tracking
(firefox-esr78 fixed, firefox83 fixed)
People
(Reporter: glandium, Assigned: hamzah18051)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr78+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr78+
|
Details | Review |
I was trying to reproduce an automation test run on a mac under catalina, and it failed running virtualenv with an error that looks like the ones mentioned in https://github.com/pypa/virtualenv/issues/1561, which suggests it's fixed in later versions of virtualenv.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
It failed on Mojave too, but not on High Sierra.
Comment 2•4 years ago
•
|
||
Yes, upgrading would be nice. For context, there are two copies of virtualenv in-tree. One used by mozharness, and then the typical one under third_party/python
. I'm not sure which copy of virtualenv you were using, but they are both below version 20. Bug 1408051 will get rid of the mozharness copy and should be landing soon (whether it sticks is another question).
So this should block on bug 1408051, though if it ends up being backed out due to virtualenv related issues, we could reverse the dependencies and fix this one first.
I won't have time to do this myself for awhile. I'll see if Hamzah is interested in taking this one after 1408051 is wrapped up.
p.s moving to Firefox Build System :: General as the virtualenv dependency is much broader than just testing.
Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 5•4 years ago
|
||
Just checking in because bug 1660183 is making this more important: what's the status of this work. The review suggests that we're blocked on removing pipenv
(bug 1659542, itself blocked on bug 1659539), but then we can proceed as planned with this. Is that correct?
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Yeah, you are correct, pipenv is blocking this.
Since virtualenv20 was one of the biggest refactors after virtualenv16 and was refactored into a full-fledged module. In venv16 there used to be virtualenv.py
which used to be executed everytime a virtualenv was to be created, but in venv20 it was broken down into several different files as earlier it was difficult to maintain, because of that we could no longer call virtualenv.py
and instead had to work on modifying the PYTHONPATH
So jezdez suggested that we use the venv zipapp file which is just a zip file that contains the total content of the virtualenv packages and script https://phabricator.services.mozilla.com/D84577#2640136.
So I think once we are done removing pipenv we can proceed with upgrading the virtualenv.
Comment 7•4 years ago
|
||
Okay, pipenv is gone, this work can continue.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 8•4 years ago
|
||
Reporter | ||
Comment 9•4 years ago
|
||
Newer versions of pip output something like:
certifi @ file:///builds/worker/workspace/build/tests/tools/wpt_third_party/certifi
rather than
certifi==2018.4.16
and the package_versions method doesn't know how to handle that.
Both old and new versions of pip, however, output the same thing for
pip list --format freeze
, which is equivalent to the old
pip freeze --all
output (which means we'll now list more packages,
essentially pip, setuptools and wheels).
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9dfb511b5dc3
https://hg.mozilla.org/mozilla-central/rev/91f4934e4063
Comment 12•4 years ago
|
||
Hi, may I know that whether this patch will be applied to ESR78 branch? If so, when will it happen? Thanks!
Comment 13•4 years ago
|
||
Sure, I'll nominate this patch and its dependencies for ESR uplift.
Heads up that there's a lot of dependencies (see the regressions
list!), so this might not land smoothly. Let's find out :)
Comment 14•4 years ago
|
||
Comment on attachment 9179169 [details]
Bug 1654457 - Update virtualenv to 20.0.31.
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Common platforms (e.g.: macOS Mojave) are unable to run some
./mach
commands. - User impact if declined: Harder for downstreams to perform builds on various platforms.
- Fix Landed on Version: 83
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Is a build patch, failures should be found in CI.
Application users are not affected. - String or UUID changes made by this patch:
Updated•4 years ago
|
Comment 15•4 years ago
|
||
@Mitchell, great. I am planning to upgrade our browser version from esr68 to esr 78 due to Mac Big Sur release, so I have to rebuild my code from scratch.
Here is another bug I have ever encountered when I try to build the source from scratch:
https://bugzilla.mozilla.org/show_bug.cgi?id=1674162
Since the code change is not that large, I merged it by hand in my local codebase, not sure whether it can be merged as well, that'll be good for other ESR users.
Updated•4 years ago
|
Comment 16•4 years ago
|
||
There's various conflicts along the way trying to graft this and dependencies to ESR78. Most of them are pretty trivial to rebase around, but I hit conflicts in bug 1670167 I wasn't sure how to deal with and feel it'd be better for someone who knows the build system better to handle them. Can you please try to create a rebased set of patches for uplift? If it makes it easier, we can graft them directly from a Try push rather than attaching various patches throughout all the different bugs.
Comment 17•4 years ago
|
||
I've got a stack of rebased patches on try here (tip is id 829aaf14f1c5
).
I'm running local Mac, Linux and Windows builds right now, I'll report the status in an hour or two.
A couple notes:
- I had to take some liberties with that last patch, just slorping the
if PY2
bit and losing the rest. - For my local macOS dev, I have a newer SDK, so I locally grafted this patch. I didn't include it in my
try
stack because theoretically it shouldn't be needed, since downstream can use an older SDK. - There's issues around
./mach bootstrap
and Big Sur that will be solved by this bug. However, this is workaroundable by not bootstrapping from the ESR78 checkout. - There's a lot of uplifted patches here. If this is an excessive amount, please let me know! I'm not sure the rules around this :)
Comment 18•4 years ago
|
||
Seems to be happy on my machines.
Should be good to go :RyanVM, let me know how it goes :)
Comment 19•4 years ago
|
||
https://hg.mozilla.org/try/rev/829aaf14f1c5 has a .orig file removal in it, can we clean up the patch stack to avoid introducing it in the first place?
Comment 20•4 years ago
•
|
||
Heh, thought I had properly hg absorb
'd the removal of that .orig
file, but I suppose not.
Thanks for the good eye Ryan!
Comment 21•4 years ago
|
||
Second try's the charm: a59f8db313ccb1a73b43a159b0d230da5da71388
should be a clean stack.
Comment 22•4 years ago
•
|
||
CI is angry.
Update: I've made some progress, but CI still wants to write to /usr/lib/python2.7/sitecustomize.py
. More work is needed.
Updated•4 years ago
|
Comment 23•4 years ago
|
||
Update: I set up the stack anew (tip is 80667ddf82858373813b073cf650db60b0e642fc
), and CI seems happy.
I've got successful local builds in Linux and Mac, and I'm expecting Windows to pass as well (running it locally overnight tonight).
The uplift stack I have here is the minimal stack so that this bug's patch is moved to ESR. If you're building locally with Big Sur, you may run into other issues fixed by other tickets:
Comment 24•4 years ago
|
||
Comment on attachment 9179169 [details]
Bug 1654457 - Update virtualenv to 20.0.31.
Needed to better support running mach on newer macOS releases. Approved for 78.8esr.
Comment 25•4 years ago
|
||
bugherder uplift |
Comment 26•4 years ago
|
||
Great to see it. I also found there was another fix which is also required by esr78:
https://bugzilla.mozilla.org/show_bug.cgi?id=1683929
Updated•4 years ago
|
Comment 27•4 years ago
|
||
Comment on attachment 9179170 [details]
Bug 1654457 - Use pip list --format freeze
instead of pip freeze
.
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Needed to be compatible with newer version of pip used after https://phabricator.services.mozilla.com/D83181
- User impact if declined: None
- Fix Landed on Version: 83
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): It's a build-only patch
- String or UUID changes made by this patch:
Updated•4 years ago
|
Comment 28•4 years ago
|
||
bugherder uplift |
Updated•2 years ago
|
Updated•2 years ago
|
Description
•