Closed Bug 1210157 Opened 5 years ago Closed 1 year ago

bootstrap.py raises syntax error on Python 3

Categories

(Firefox Build System :: Bootstrap Configuration, defect)

defect
Not set
normal

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: altblitz, Assigned: mars)

References

Details

Attachments

(8 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
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20150921073455

Steps to reproduce:

http://areweeveryoneyet.org/onramp/desktop-linux.html

'If you don’t have one yet, create a "src" directory for yourself under your home directory: cd ~ && mkdir src' - done.
'Next download the bootstrap.py script and save it in your src/ directory.' - done
'And finally, in your terminal: cd ~/src and start the bootstrapper like this:
python bootstrap.py' - failed

[foo@ba ~/src ] uname  -a
Linux inode 4.2.1-1-ARCH #1 SMP PREEMPT Tue Sep 22 06:57:07 CEST 2015 x86_64 GNU/Linux
[foo@ba ~/src ] python --version
Python 3.4.3




Actual results:

[foo@bar ~/src ] python bootstrap.py  
Could not load the bootstrap Python environment.
This should never happen. Consider filing a bug.
Missing parentheses in call to 'print' (archlinux.py, line 67)



Expected results:

'... follow the prompts.'
In Arch python bootstrap.py should be python2 bootstrap.py

Your version of Mercurial (3.5.1) is sufficiently modern.
Your version of Python (2.7.10) is new enough.

Your system should be ready to build Firefox for Desktop! If you have not already,
obtain a copy of the source code by running:
    hg clone https://hg.mozilla.org/mozilla-central
Or, if you prefer Git:
    git clone https://git.mozilla.org/integration/gecko-dev.git

python2 bootstrap.py  6.71s user 1.21s system 12% cpu 1:03.48 total
Yeah, this is a Python 3 compatibility problem. We need to make the bootstrapper Python 3 compatible as a lot of distros are shipping Python 3 by default now.

We should at least detect Python 3 and raise an actionable error until we have full Python 3 support.
Component: Mercurial: hg.mozilla.org → Build Config
Product: Developer Services → Core
QA Contact: hwine
Summary: Firefox Onramp: Could not load the bootstrap Python environment → bootstrap.py raises syntax error on Python 3
Version: Development/Staging → unspecified
Product: Core → Firefox Build System
Component: General → Bootstrap Configuration
(In reply to Gregory Szorc [:gps] from comment #2)
> Yeah, this is a Python 3 compatibility problem. We need to make the
> bootstrapper Python 3 compatible as a lot of distros are shipping Python 3
> by default now.
> 
> We should at least detect Python 3 and raise an actionable error until we
> have full Python 3 support.

This was done in bug 1257095.
Assignee: nobody → mars
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

mozboot calls out to 'mach artifact' to install dependencies on the host. Make
mozboot use the default interpreter for 'mach artifact' (Python 2 for now)
instead of using the interpreter that mozboot was called with.

This allows us to port the mozboot code to Python 3 without having to port
everything 'mach artifact' pulls in as well (which is a lot).

Make the mozboot base modules and Debian dev environment
bootstrap routines compatible with both Python 2.7 and Python 3.6+.

  • Remove Python 2.6 support from bootstrap.py and mozboot.
  • Mark minimum versions for bootstrap.py as Python 2.7 and Python 3.6+.
  • Make bootstrap.py support Python 3.
  • Make mozboot.base and mozboot.bootstrap support Python 3.
  • Make the Debian-based Linux distro bootstrap routines support
    Python 3.
  • Make "mach bootstrap" use the Python 3 interpreter.
  • Use unicode_literals in all mozboot modules.

Depends on D39080

Attachment #9080127 - Attachment description: Bug 1210157 - make mozboot call mach artifact with default python → Bug 1210157 - Make mozboot call mach artifact with default python