Convert 'mach taskgraph' to run with Python 3
Categories
(Firefox Build System :: Task Configuration, task)
Tracking
(firefox80 fixed)
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: KrisWright, Assigned: catlee)
References
Details
Attachments
(19 files, 1 obsolete file)
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 | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
mach taskgraph
still runs with python 2 [1]. We want to convert all mach
commands to python 3.
To do this, any dependencies of the command may need to be converted as well as the command itself.
Assignee | ||
Comment 4•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
In Py2, None compares as less than all strings and numbers.
In Py3, None isn't comparable with < to strings or numbers.
For unset variables, use "" as the value for the purposes of parsing manifest expressions.
Depends on D76133
Assignee | ||
Comment 6•5 years ago
|
||
In Py2 dictionaries are sort of orderable, but in Py3 they are not.
Here we explicitly sort on the test name.
Depends on D76134
Assignee | ||
Comment 7•5 years ago
|
||
With these patches applied, I do see some changes between tasks generated with py2 and py3. Most of the changes look like ordering differences in encoded json, which should be fine.
I do also see some changes to test_manifests
for some tasks though, which is an actual problem.
e.g.
test-android-em-7.0-x86_64/debug-geckoview-web-platform-tests-e10s-10 loses "/imagebitmap-renderingcontext" and adds "/accelerometer".
Comment 8•5 years ago
|
||
(Drive-by comment because this comment ended up in my bugmail: don't know to what extent this will help you, but if you're not doing sort_keys=True
when encoding json
in Python, you might want to consider doing so. It'll both make it easier for you to make sure there are no diffs when converting from 2 to 3, and help keep you sane once you're all-in on Python 3 where (at least on older Python 3's) dict ordering is super unpredictable. If you're already doing so or if this doesn't matter for you please ignore :) )
Assignee | ||
Comment 9•5 years ago
|
||
(In reply to Ricky Stewart from comment #8)
(Drive-by comment because this comment ended up in my bugmail: don't know to what extent this will help you, but if you're not doing
sort_keys=True
when encodingjson
in Python, you might want to consider doing so. It'll both make it easier for you to make sure there are no diffs when converting from 2 to 3, and help keep you sane once you're all-in on Python 3 where (at least on older Python 3's) dict ordering is super unpredictable. If you're already doing so or if this doesn't matter for you please ignore :) )
Great reminder, thanks. There are a bunch of places where we're encoding json into environment variables that aren't using sort_keys=True. I'll fix those up, since it will make future comparisons easier.
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 10•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
bugherder |
Assignee | ||
Updated•5 years ago
|
Comment 13•5 years ago
|
||
Why was this bug resolved? mach taskgraph
is still running with Python 2 today.
Updated•5 years ago
|
Comment 14•5 years ago
|
||
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
Comment 17•5 years ago
|
||
Comment 18•5 years ago
|
||
Comment 19•5 years ago
|
||
Comment 20•5 years ago
|
||
Comment 21•5 years ago
|
||
Comment 22•5 years ago
|
||
Comment 23•5 years ago
|
||
In any case, time.time
is preferable to time.clock
when time.monotonic
is
not available.
Comment 24•5 years ago
|
||
Comment 25•5 years ago
|
||
All the callers generate a fresh task id, so refactor that logic into the
function.
Comment 26•5 years ago
|
||
Comment 27•5 years ago
|
||
Comment 28•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 29•5 years ago
|
||
Comment 30•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fc13b7163dad
https://hg.mozilla.org/mozilla-central/rev/336a46acdb6c
https://hg.mozilla.org/mozilla-central/rev/2f5586dcfdf8
https://hg.mozilla.org/mozilla-central/rev/0d981c7058f6
https://hg.mozilla.org/mozilla-central/rev/8d0f64bb2238
https://hg.mozilla.org/mozilla-central/rev/27faa044aad8
https://hg.mozilla.org/mozilla-central/rev/8ea5e146c19d
https://hg.mozilla.org/mozilla-central/rev/44fbdf2391b7
https://hg.mozilla.org/mozilla-central/rev/8474867c8ba5
https://hg.mozilla.org/mozilla-central/rev/379f4af46834
https://hg.mozilla.org/mozilla-central/rev/fb44bf643588
https://hg.mozilla.org/mozilla-central/rev/6330322fb7f8
https://hg.mozilla.org/mozilla-central/rev/625d545ca409
https://hg.mozilla.org/mozilla-central/rev/7b1128e12c72
Comment 31•5 years ago
|
||
Comment 32•5 years ago
|
||
Updated•5 years ago
|
Comment 33•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9cbebb8e39f3
https://hg.mozilla.org/mozilla-central/rev/5ce5c63b496c
Description
•