Switch python configure to python 3
Categories
(Firefox Build System :: General, task)
Tracking
(firefox77 fixed)
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: glandium, Assigned: glandium)
References
Details
Attachments
(16 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Assignee | ||
Comment 1•5 years ago
|
||
This was cargo-culted from virtualenv_python2, but this is not
necessary: currently, the only way configure code will execute with
python 3 is if something uses the configure sandbox from python 3, not
configure. Only configure itself is meant to re-execute itself with
python, so we don't want python 3 to re-execute.
We'll be swapping virtualenv_python2 and virtualenv_python3 later, when
switching to python 3.
Assignee | ||
Comment 2•5 years ago
|
||
It was cargo-culted from virtualenv_python2, but is not necessary
because virtualenv_python3 is not going to re-execute python, which is
what the dependency is there to avoid.
Assignee | ||
Comment 3•5 years ago
|
||
This is yet another cargo-cult from virtualenv_python2, which is not
necessary because by the time we reach virtualenv_python3, the mozconfig
configure has been injected already.
Assignee | ||
Comment 4•5 years ago
|
||
Using @checking doesn't go well with the virtualenv creation, so print
the version information after the fact. And do so uniformely for python
2 and python 3.
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
Also remove unused import of itertools.ifilterfalse.
Assignee | ||
Comment 7•5 years ago
|
||
It's in both in python 2, but only in the former in python 3.
Assignee | ||
Comment 8•5 years ago
|
||
Assignee | ||
Comment 9•5 years ago
|
||
Assignee | ||
Comment 10•5 years ago
|
||
ConfigureSandbox._implied_options is a list of ReadOnlyNamespaces.
In python 3.5, ReadOnlyNamespaces end up with no guarantee in the order
of their dict. So when comparing
ReadOnlyNamespace(a=1, b=2)
and
ReadOnlyNamespace(a=3, b=4)
It's not guaranteed that the a's are compared before the b's.
In ConfigureSandbox._implied_options, some of those ReadOnlyNamespace
fields are SandboxDependsFunctions, which actually raise an error when
they're being compared, because we don't want that to happen in the
sandbox.
So when using python 3, configure would randomly fail when trying to
remove items from the ConfigureSandbox._implied_options list because
removing an item from a list scans the list to find the first element
that matches.
And ConfigureSandbox._implied_options needs to be ordered, which is why
it's currently a list.
There is actually something better we can do instead of removing by
value: we can actually remove by index, assuming we adjust for the
number of elements we already removed during the loop.
Assignee | ||
Comment 11•5 years ago
|
||
Assignee | ||
Comment 12•5 years ago
|
||
Python 3 doesn't like that.
Assignee | ||
Comment 13•5 years ago
|
||
Some things remain to iron out, but this is presumably green everywhere.
Comment 14•5 years ago
|
||
I appreciate the removal of unnecessary cargo-culted stuff.
Comment 15•5 years ago
|
||
The title of the bug and the contents of some of the patches seem to indicate we want this to block bug 1617748, so I made that change. (I have been testing the patch for bug 1617748 for WEEKS, and I'm a little concerned about why none of this stuff -- like the iteritems()
issues in configure
-- appeared in try pushes before.)
Comment 16•5 years ago
|
||
If I'm not understanding this correctly and it's unrelated to bug 1617748 though, feel free to set me straight though.
Assignee | ||
Comment 17•5 years ago
|
||
I think the problem in bug 1617748 is that switching mach build
and mach configure
themselves is almost a no-op, because they re-execute something else (respectively make -f client.mk
and make -f client.mk configure
), and that, in turn, returns to python2. However, mach build-backend
executes config.status with the python that is used to call it, so bug 1617748 is effectively switching running a python2-generated config.status with python3, but mach build-backend
is also not something that runs all the time.
This bug changes make -f client.mk configure
to end up using python3. You'll see the last patch also switches mach build-backend
as a consequence.
Assignee | ||
Updated•5 years ago
|
Comment 18•5 years ago
|
||
Assignee | ||
Comment 19•5 years ago
|
||
Assignee | ||
Comment 20•5 years ago
|
||
Many values we get out from configure are of types that look like
lists/tuples, that write_indented_repr will serialize as lists... but
only in python 2, because the alternative implementation for python 3
is not doing that. So sanitize first.
Assignee | ||
Comment 21•5 years ago
|
||
Updated•5 years ago
|
Comment 22•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/50d99e9fdae6
https://hg.mozilla.org/mozilla-central/rev/e075af33170e
https://hg.mozilla.org/mozilla-central/rev/7a25c7487ffa
https://hg.mozilla.org/mozilla-central/rev/06ef786c150d
https://hg.mozilla.org/mozilla-central/rev/31b7ae9a38da
https://hg.mozilla.org/mozilla-central/rev/77cb1d547938
https://hg.mozilla.org/mozilla-central/rev/6c0a9c89b833
https://hg.mozilla.org/mozilla-central/rev/592ef8e830ad
https://hg.mozilla.org/mozilla-central/rev/542f439cf528
Assignee | ||
Updated•5 years ago
|
Comment 23•5 years ago
|
||
Comment 24•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/46cc9d8517dd
https://hg.mozilla.org/mozilla-central/rev/d1913f539e6b
https://hg.mozilla.org/mozilla-central/rev/b8987765a42d
https://hg.mozilla.org/mozilla-central/rev/cb049a611bf7
https://hg.mozilla.org/mozilla-central/rev/832c792b08f4
https://hg.mozilla.org/mozilla-central/rev/d3eb1d4ffd63
https://hg.mozilla.org/mozilla-central/rev/407894bc5f9c
Updated•5 years ago
|
Description
•