Closed Bug 1643158 Opened 1 month ago Closed 1 month ago

`six` module imported by bootstrap.py not part of the python standard library

Categories

(Firefox Build System :: Bootstrap Configuration, defect, P3)

defect

Tracking

(firefox79 fixed)

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: moz, Assigned: mhentges)

Details

(Keywords: in-triage)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

On a fresh debian install I downloaded the bootstrap script, and executed it with the system python interpreter:

$ wget https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py
$ chmod +x bootstrap.py
$ python bootstrap.py
bootstrap.py 
Could not load the bootstrap Python environment.

This should never happen. Consider filing a bug.

No module named six



Actual results:

The bootstrap script quickly terminates with the above error. Re-running with `--debug` prints the following backtrace:

Traceback (most recent call last):
File "../../bootstrap.py", line 202, in <module>
sys.exit(main(sys.argv))
File "../../bootstrap.py", line 178, in main
options.repo_type)
File "../../bootstrap.py", line 143, in ensure_environment
from mozboot.bootstrap import Bootstrapper
File "/tmp/tmphZniGv/mozboot/bootstrap.py", line 45, in <module>

File "/tmp/tmphZniGv/mozboot/util.py", line 9, in <module>
ImportError: No module named six



Expected results:

The bootstrap script has a comment that states that the [bootstrap process itself shouldn't rely on any 3rd party modules](https://github.com/mozilla/gecko-dev/blob/c6e4f99f130fa56737e3f26b7bd99896dfac3480/python/mozboot/mozboot/bootstrap.py#L15-L28), but [b8108d6](https://github.com/mozilla/gecko-dev/commit/b8108d6064053a99b170b60162e02f3f5b5f72c0) introduced use of six to mozboot/utils.py

I'm happy to provide a patch here to enable a python2/3 friendly six-free utils.py. However, it's unclear to me as a newcomer whether installation should now require `six` to be installed or the introduction of the requirement on six supercedes that comment. If the latter, then I'm happy instead to update the documentation at https://firefox-source-docs.mozilla.org/setup/linux_build.htm

apologies for the formatting. Half of my description appears to be in a codeblock

Severity: -- → S3
Keywords: in-triage
Priority: -- → P3
Assignee: nobody → mhentges

bootstrap.py depends on mozboot/util.py, but bootstrap needs to run in a bare environment without six.

Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c7a9189fa220
remove mozboot/util.py dependency on six r=rstewart
Status: UNCONFIRMED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.