platform.linux_distribution used by Firefox's bootstrap.py is removed in Python 3.8
Categories
(Firefox Build System :: Bootstrap Configuration, defect, P3)
Tracking
(firefox74 fixed)
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: ipickering2, Assigned: jaso35)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Steps to reproduce:
Attempt to run bootstrap.py as instructed by the Linux build preparation steps for Firefox (https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build/Linux_and_MacOS_build_preparation):
python bootstrap.py --vcs=git
Actual results:
$ python bootstrap.py --vcs=git /mnt/hibiki/build/gecko2 %
Traceback (most recent call last):
File "bootstrap.py", line 194, in <module>
sys.exit(main(sys.argv))
File "bootstrap.py", line 183, in main
dasboot = cls(choice=options.application_choice, no_interactive=options.no_interactive,
File "/tmp/tmp5lugvfon/mozboot/bootstrap.py", line 248, in init
AttributeError: module 'platform' has no attribute 'linux_distribution'
This is because platform.linux_distribution() was removed in Python 3.8.
Upstream Python issue: https://bugs.python.org/issue28167
Expected results:
The bootstrap should have proceeded without any Python errors.
Reporter | ||
Comment 1•4 years ago
|
||
The bootstrap will succeed if Python 2 is used instead of Python 3.
Comment 2•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 3•4 years ago
|
||
This should be analogous to bug 1212502.
Comment 4•4 years ago
•
|
||
We have this in openSUSE Bugzilla as a bug, and the only recommendation we had is to use distro
module from PyPI, and particularly its function distro.linux_distribution()
which deals with all the craziness of /etc/os-release
and its friends.
Assignee | ||
Comment 5•3 years ago
•
|
||
I am running into the same issue trying to bootstrap using python 3.8 on Arch Linux:
$ python bootstrap.py
Traceback (most recent call last):
File "bootstrap.py", line 193, in <module>
sys.exit(main(sys.argv))
File "bootstrap.py", line 182, in main
dasboot = cls(choice=options.application_choice, no_interactive=options.no_interactive,
File "/tmp/tmpiq90z5z0/mozboot/bootstrap.py", line 256, in __init__
AttributeError: module 'platform' has no attribute 'linux_distribution'
testing/mozbase/mozinfo also uses the distro
package so i think this might be a good solution. However platform.linux_distribution()
and distro.linux_distribution()
are not expected to be completely identical. This probably needs some testing.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
•
|
||
I tried my hand at this.
Since we cannot rely on any other packages to be present and don't want to contaminate the system environment, I'm bootstrapping into a virtual environment and install the distro
package there.
Afterwards the bootstrap script is recursively run again in the new environment using distro.linux_distribution(full_distribution_name=False) to check for the relevant distro ids.
Assignee | ||
Comment 7•3 years ago
|
||
Updated•3 years ago
|
Pushed by apavel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/34f53b4b2284 use distro package to provide platform information r=firefox-build-system-reviewers,mshal
Comment 9•3 years ago
|
||
bugherder |
Description
•