Closed Bug 1616584 Opened 7 months ago Closed 6 months ago

Run `mach mozregression` with Python 3

Categories

(Firefox Build System :: General, task, P3)

task

Tracking

(firefox76 fixed)

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: ahal, Assigned: wlach, Mentored)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

The mozregression module is Python 3 compatible and the mach wrapper around it is very thin. We should be able to enable it under Python 3 fairly easily.

To do so, remove "mozregression" from the whitelist in the root "mach" driver. Then run ./mach mozregression with various arguments to test that everything is working.

Attached file Error output

Hmm, making the necessary change and then running ./mach mozregression --help I get the attached error. The salient part seems to be:

Error running mach:

    ['mozregression', '--help']

The error occurred in mach itself. This is likely a bug in mach itself or a
fundamental problem with a loaded module.

You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

  File "/Users/wlach/src/mozilla-unified/third_party/python/configobj/configobj.py", line 1644
    except Exception, e:
                    ^
SyntaxError: invalid syntax

It does indeed look like our copy of configobj in third_party is very old, probably not supporting python 3. :ahal do you know why this hasn't been a problem so far? Can we just upgrade the files in the tree?

FWIW if I revert my change everything works fine.

Flags: needinfo?(ahal)

Yeah, we can just upgrade them. You could run mach vendor python configobj==5.0.6 to do so.

However it looks like this is literally the only use of configobj in all of m-c:
https://searchfox.org/mozilla-central/source/config/printconfigsetting.py#21

So maybe we should just remove it from m-c entirely and then we can install it at runtime when running mach mozregression (just like we install mozregression itself at runtime there). This is definitely follow-up fodder.

Also worth pointing out that even configobj==5.0.6 is from 2014, so maybe mozregression should try to go back to the stdlib configparser or something else too.

Flags: needinfo?(ahal)

(In reply to Andrew Halberstadt [:ahal] from comment #2)

Also worth pointing out that even configobj==5.0.6 is from 2014, so maybe mozregression should try to go back to the stdlib configparser or something else too.

Yeah I think that makes sense once we've moved mozregression to py3-only (currently it supports both py2 and py3 in parallel).

I'll do up a new bug to upgrade configobj. Thanks!

(In reply to William Lachance (:wlach) (use needinfo!) from comment #3)

(In reply to Andrew Halberstadt [:ahal] from comment #2)

I'll do up a new bug to upgrade configobj. Thanks!

Actually looking at it, just modifying printconfigsetting might be just as easy...

Depends on: 1623132
Assignee: nobody → wlachance

Works great now that bug 1623132 has landed.

Pushed by wlachance@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/02e75b2a2318
Run `mach mozregression` with Python 3 r=ahal
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.