Closed Bug 1647806 Opened 5 years ago Closed 5 years ago

Document Python 3 installation steps

Categories

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

enhancement

Tracking

(firefox80 fixed)

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: mhentges, Assigned: rstewart)

References

Details

(Keywords: in-triage)

Attachments

(1 file)

Write step-by-step quick start docs in-tree for installing python 3 for the following platforms:

  • Mac
  • Ubuntu/Debian
  • Arch Linux
  • (not including MozillaBuild because py3 is built-in)

Add a wiki space for other platforms. Add docs for the following platforms based on what is currently implemented in-tree:

  • CentOS
  • FreeBSD
  • Gentoo
  • OpenBSD
  • OpenSUSE
  • Solus Linux
  • Void Linux
  • Windows MinGW
Blocks: 1647792
Blocks: 1647802
No longer blocks: 1647792
Blocks: 1647814

Don't forget the part where Debian-based distros need a separate package for the distutils module we use somewhere in mach.

I wonder if bootstrap can still install that automatically, or if there'll be adverse effects. I'll investigate

Severity: -- → S3
Priority: -- → P3
Keywords: in-triage

Do you know which debian variant requires python3-distuils?
I've spun up a new virtual machine with Debian 10.4.0 (buster) and removed all python packages except for:

  • python3.7
  • python3.7-minimal

Then, despite not having python3-distutils, the following works:

$ python3.7
Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.version import LooseVersion
>>> LooseVersion('2.7.3')
LooseVersion ('2.7.3')
>>> [ctrl-D]
$ python3 .7./bootstrap.py
<snip, starts correctly and prompts for which version of Firefox I want to build (artifact mode, etc)>

I'm surprised that there's a separate python3-distutils package if import distutils still works. :glandium, is it just a specific debian version that's affected, or am I missing something?

Flags: needinfo?(mh+mozilla)

We've seen this on Ubuntu: see bug 1639624

Try import distutils.sysconfig.

Flags: needinfo?(mh+mozilla)

Ah, nice, import distutils.sysconfig fails unless python3-distutils is installed.
It's weird how part of distutils (e.g.: distutils.version.LooseVersion) is outside of python3-distutils, but others aren't. 🤷

bootstrap won't be able to install them for you forever (and it isn't really properly capable of installing it for you at this very moment), and installing Python 3 as well as Python 2 is increasingly non-trivial on arbitrary OS'es, so we need to document things properly here.

Specific guidance on how to use brew to install Python 2 on macOS is included here. I also go into more depth on the situation on Linux and explicitly point people to the existence of pyenv with basic usage information, which should fill in the gaps left by the OS package managers.

Also, update some documentation to prefer the python3 binary to the python binary (which is often Python 2), and fix some broken links.

Assignee: nobody → rstewart
Status: NEW → ASSIGNED

My take, pending code review, is that the existence of pyenv mostly negates the need for dedicated bespoke installation instructions for various Python versions on different Linux distributions/other weird operating systems. IMO if that turns out to not be true then we can address specific problems when they arise.

Pushed by rstewart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fc10632d1f03 Document Python installation steps r=firefox-source-docs-reviewers,sylvestre,froydnj
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: