Closed Bug 1569059 Opened 3 years ago Closed 2 years ago

[mach] Run 'mach bootstrap' with Python 3

Categories

(Firefox Build System :: Bootstrap Configuration, enhancement)

enhancement
Not set
normal

Tracking

(firefox74 fixed)

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: mars, Assigned: rstewart)

References

Details

Attachments

(2 files)

The mach script supports running commands in either Python 2 or Python 3, depending on whether the command has been made Python 3-compatible. Once the bootstrap.py script or the mach bootstrap command has been shown to work in Linux, OS X, and Windows, then we can edit the mach script and tell it to run mach bootstrap with Python 3 instead of Python 2.

This bug tracks the work to make the switch in the mach script itself and to track work that has to happen before the switch can be made. The work to port the bootstrappers for each of the OSes is covered in other bugs.

I just bumped on this issue when trying to checkout the mozilla-central in a system were the default python interpreter is python3. I've tested it on python2 and it also worked fine.

Just to be clear, this is the error I've fixed with this patch:

Would you like to clone to './mozilla-unified' instead?
  1. Yes
  2. No, let me enter another path
  3. No, stop cloning
Your choice: 1
Cloning Firefox Mercurial repository to ./mozilla-unified
Traceback (most recent call last):
  File "bootstrap.py", line 194, in <module>
    sys.exit(main(sys.argv))
  File "bootstrap.py", line 185, in main
    dasboot.bootstrap()
  File "/tmp/tmp87bye9py/mozboot/bootstrap.py", line 484, in bootstrap
  File "/tmp/tmp87bye9py/mozboot/bootstrap.py", line 605, in hg_clone_firefox
TypeError: a bytes-like object is required, not 'str'

Is this fixed? I am still getting this error with Python3

Cloning Firefox Mercurial repository to mozilla-unified
Traceback (most recent call last):
  File "bootstrap.py", line 194, in <module>
    sys.exit(main(sys.argv))
  File "bootstrap.py", line 185, in main
    dasboot.bootstrap()
  File "/tmp/tmp5oie306d/mozboot/bootstrap.py", line 497, in bootstrap
  File "/tmp/tmp5oie306d/mozboot/bootstrap.py", line 618, in hg_clone_firefox
TypeError: a bytes-like object is required, not 'str'

Mercurial version: 4.9.0
Python version: 3.7.5
OS: Fedora 31

Hi Karan, the fix for that error landed in the last 48 hours. See bug 1606955.

Depends on: 1524639, 1606955
Assignee: nobody → rstewart
Status: NEW → ASSIGNED
Pushed by nerli@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/3ebc1bfe6d20
Run 'mach bootstrap' with Python 3 r=firefox-build-system-reviewers,mshal,Callek
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Regressions: 1614146
You need to log in before you can comment on or make changes to this bug.