Closed Bug 1606703 Opened 4 years ago Closed 4 years ago

configure/lint code must support Python 3

Categories

(Firefox Build System :: General, task)

task
Not set
normal

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: rstewart, Assigned: glandium)

References

Details

Attachments

(1 file)

The configure lint code (see lint.py and related files) doesn't support Python 3 and -- even worse -- is tied directly to the Python bytecode spec and lower-level modules like dis and inspect. Due to this it's difficult to port to Python 3 without breaking things or introducing bugs and it's especially difficult to make a version of this code that works properly under both Python 2 and 3, which is a part of the migration to Python 3. Due to how the code is structured, migrating python/mozbuild is blocked on this.

Luckily the actual build process doesn't seem to depend on these files, so instead of being ported they could be deleted, or the unit tests could be disabled until the Python 3 migration is complete (at which point we can update the lint to work under Python 3 at some point in the future).

Flags: needinfo?(mh+mozilla)

migrating python/mozbuild is blocked on this.

How so? Nothing imports the lint code under mozbuild.configure other than the lint tests, and those can happily be the last bits to stay in mozbuild/test/python2.ini.

Flags: needinfo?(mh+mozilla) → needinfo?(rstewart)

Sure they can, but we won't be able to close bug 1388447 or remove Python 2 support from mozbuild while these lint tests exist and are run in automation -- i.e. migrating python/mozbuild to Python 3 is blocked. We'll always be in the limbo between Py2 and Py3 while this is a thing. I agree there's no particular urgency, if that's what you're getting at.

Flags: needinfo?(rstewart) → needinfo?(mh+mozilla)

I thought you were saying it was blocking moving other mozbuild stuff. Thanks for the clarification. So this means we can just convert the code to python 3 once everything else is done, and avoid having to make it compatible to both python 2 and python 3, although I suspect it wouldn't be that hard.

Flags: needinfo?(mh+mozilla)

How far off is the rest of mozbuild?

We're getting there. We're maybe a third of the way there. I bet it'll be at least a month before we actually get to the point where we can start making ./mach build or ./mach configure or ./mach bootstrap run in Python 3.

Blocks: 1627163

Support for python 2 is completely dropped. It wouldn't be too much code
to support both python 2 and 3 but since configure is going to switch to
python 3 shortly after, it's not worth the effort.

Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/b7d4ff29805d
Switch python configure lint to python 3. r=rstewart
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: