Closed Bug 1743185 Opened 4 years ago Closed 4 years ago

Use "hg" with Python 3 instead of Python 2

Categories

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

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mhentges, Assigned: mhentges)

References

Details

Attachments

(2 files)

Mercurial 6.0 is the last release to support Python 2.

However, there's an outstanding bug with Mercurial and MSYS environments where the pager won't work (so, hg config ..., hg show ..., etc will just immediately exit without printing anything).

See Also: → 1739443
Priority: -- → P3

Ooh, Alex's recent findings on a ./mach show-log issue have uncovered the PYTHONLEGACYWINDOWSSTDIO environment variable, which works around this very problem.

The blocking "no output pager" bug is worked around by
using hg.exe instead of the text-based hg executable.

Work around this with an alias, and move Mercurial setup to Python 3.

Depends on D136414

Python 2 is no longer needed now that Mercurial is used with Python 3.

Depends on D136415

Assignee: nobody → mhentges
Status: NEW → ASSIGNED
Attachment #9259801 - Attachment description: WIP: Bug 1743185: Use Mercurial with Python 3 → Bug 1743185: Use Mercurial with Python 3
Attachment #9259802 - Attachment description: WIP: Bug 1743185: Remove Python 2 → Bug 1743185: Remove Python 2
Blocks: 1739443
See Also: 1739443
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

Note on that: Python 3.9 does not support Windows 7.
You probably don't care enough to revert to 3.8 (which would be very nice), but at least mention it on the Wiki page.

Theoretically it should work with https://github.com/nalexandru/api-ms-win-core-path-HACK but at least for me, mach bootstrap freezes at the "Please choose the version of Firefox you want to build" step and then crashes with

OSError: [WinError 8] Not enough memory resources are available to process this command

File "M:\x\mozilla-source\mozilla-release\python\mozboot\mozboot\mach_commands.py", line 43, in bootstrap
  bootstrapper.bootstrap(command_context.settings)
File "m:\x\mozilla-source\mozilla-release\python\mozboot\mozboot\bootstrap.py", line 273, in bootstrap
  prompt_choice = self.instance.prompt_int(
File "m:\x\mozilla-source\mozilla-release\python\mozboot\mozboot\base.py", line 567, in prompt_int
  choice = input(prompt)

And memory should not really be an issue, I have 5 GB of available RAM and there is no spike in usage at all.

This seems to be some issue with the input() command. If I change mozilla-release\python\mozboot\mozboot\base.py to not have the input, but instead just return what I would have selected, it runs fine.

Product: mozilla.org → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: