Bug 1424921 - Support Lint dependencies in bootstrap. r?Build
- Add node as a dependency on Linux and Mac
- Add python3 for Mac only (linux generally has it installed already).
MozReview-Commit-ID: EpNWFTI9UXc
--- a/python/mozboot/mozboot/archlinux.py
+++ b/python/mozboot/mozboot/archlinux.py
@@ -17,16 +17,18 @@ from mozboot.linux_common import StyloIn
class ArchlinuxBootstrapper(StyloInstall, BaseBootstrapper):
'''Archlinux experimental bootstrapper.'''
SYSTEM_PACKAGES = [
'autoconf2.13',
'base-devel',
'ccache',
'mercurial',
+ 'nodejs',
+ 'npm',
'python2',
'python2-setuptools',
'unzip',
'zip',
]
BROWSER_PACKAGES = [
'alsa-lib',
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -198,16 +198,17 @@ class Bootstrapper(object):
if sys.platform.startswith('linux'):
distro, version, dist_id = platform.linux_distribution()
if distro in ('CentOS', 'CentOS Linux', 'Fedora'):
cls = CentOSFedoraBootstrapper
args['distro'] = distro
elif distro in DEBIAN_DISTROS:
cls = DebianBootstrapper
+ args['distro'] = distro
elif distro == 'Gentoo Base System':
cls = GentooBootstrapper
elif os.path.exists('/etc/arch-release'):
# Even on archlinux, platform.linux_distribution() returns ['','','']
cls = ArchlinuxBootstrapper
else:
raise NotImplementedError('Bootstrap support for this Linux '
'distro not yet available.')
--- a/python/mozboot/mozboot/centosfedora.py
+++ b/python/mozboot/mozboot/centosfedora.py
@@ -18,16 +18,18 @@ class CentOSFedoraBootstrapper(StyloInst
self.version = version
self.dist_id = dist_id
self.group_packages = []
self.packages = [
'autoconf213',
'mercurial',
+ 'nodejs',
+ 'npm',
'which',
]
self.browser_group_packages = [
'GNOME Software Development',
]
self.browser_packages = [
--- a/python/mozboot/mozboot/debian.py
+++ b/python/mozboot/mozboot/debian.py
@@ -30,27 +30,33 @@ Choice:
class DebianBootstrapper(StyloInstall, BaseBootstrapper):
# These are common packages for all Debian-derived distros (such as
# Ubuntu).
COMMON_PACKAGES = [
'autoconf2.13',
'build-essential',
'ccache',
+ 'nodejs',
'python-dev',
'python-pip',
'python-setuptools',
'unzip',
'uuid',
'zip',
]
# Subclasses can add packages to this variable to have them installed.
DISTRO_PACKAGES = []
+ # Ubuntu and Debian don't often differ, but they do for npm.
+ DEBIAN_PACKAGES = [
+ 'npm'
+ ]
+
# These are common packages for building Firefox for Desktop
# (browser) for all Debian-derived distros (such as Ubuntu).
BROWSER_COMMON_PACKAGES = [
'libasound2-dev',
'libcurl4-openssl-dev',
'libdbus-1-dev',
'libdbus-glib-1-dev',
'libgconf2-dev',
@@ -74,23 +80,26 @@ class DebianBootstrapper(StyloInstall, B
'wget', # For downloading the Android SDK and NDK.
'libncurses5:i386', # See comments about i386 below.
'libstdc++6:i386',
]
# Subclasses can add packages to this variable to have them installed.
MOBILE_ANDROID_DISTRO_PACKAGES = []
- def __init__(self, version, dist_id, **kwargs):
+ def __init__(self, distro, version, dist_id, **kwargs):
BaseBootstrapper.__init__(self, **kwargs)
+ self.distro = distro
self.version = version
self.dist_id = dist_id
self.packages = self.COMMON_PACKAGES + self.DISTRO_PACKAGES
+ if self.distro == 'Debian' or self.distro == 'debian':
+ self.packages += self.DEBIAN_PACKAGES
self.browser_packages = self.BROWSER_COMMON_PACKAGES + self.BROWSER_DISTRO_PACKAGES
self.mobile_android_packages = self.MOBILE_ANDROID_COMMON_PACKAGES + \
self.MOBILE_ANDROID_DISTRO_PACKAGES
def install_system_packages(self):
self.apt_install(*self.packages)
def install_browser_packages(self):
--- a/python/mozboot/mozboot/freebsd.py
+++ b/python/mozboot/mozboot/freebsd.py
@@ -14,16 +14,17 @@ class FreeBSDBootstrapper(BaseBootstrapp
self.version = int(version.split('.')[0])
self.flavor = flavor.lower()
self.packages = [
'autoconf213',
'gmake',
'gtar',
'mercurial',
+ 'node',
'pkgconf',
'py%s%s-sqlite3' % sys.version_info[0:2],
'rust',
'watchman',
'zip',
]
self.browser_packages = [
--- a/python/mozboot/mozboot/gentoo.py
+++ b/python/mozboot/mozboot/gentoo.py
@@ -12,17 +12,17 @@ class GentooBootstrapper(StyloInstall, B
def __init__(self, version, dist_id, **kwargs):
BaseBootstrapper.__init__(self, **kwargs)
self.version = version
self.dist_id = dist_id
def install_system_packages(self):
self.run_as_root(['emerge', '--noreplace', '--quiet', 'dev-vcs/git',
- 'mercurial'])
+ 'mercurial', 'node'])
def install_browser_packages(self):
self.ensure_browser_packages()
def install_browser_artifact_mode_packages(self):
self.ensure_browser_packages(artifact_mode=True)
def install_mobile_android_packages(self):
--- a/python/mozboot/mozboot/openbsd.py
+++ b/python/mozboot/mozboot/openbsd.py
@@ -11,16 +11,17 @@ class OpenBSDBootstrapper(BaseBootstrapp
def __init__(self, version, **kwargs):
BaseBootstrapper.__init__(self, **kwargs)
self.packages = [
'mercurial',
'autoconf-2.13',
'gmake',
'gtar',
+ 'node-devel',
'rust',
'wget',
'unzip',
'zip',
]
self.browser_packages = [
'llvm',
--- a/python/mozboot/mozboot/osx.py
+++ b/python/mozboot/mozboot/osx.py
@@ -316,22 +316,24 @@ class OSXBootstrapper(BaseBootstrapper):
def ensure_homebrew_system_packages(self):
packages = [
# We need to install Python because Mercurial requires the Python
# development headers which are missing from OS X (at least on
# 10.8) and because the build system wants a version newer than
# what Apple ships.
'python',
+ 'python3',
'mercurial',
'git',
'autoconf@2.13',
'gnu-tar',
'watchman',
'terminal-notifier',
+ 'node',
]
self._ensure_homebrew_packages(packages)
def ensure_homebrew_browser_packages(self, artifact_mode=False):
# TODO: Figure out what not to install for artifact mode
packages = [
'llvm',
'yasm',
@@ -378,21 +380,23 @@ class OSXBootstrapper(BaseBootstrapper):
missing = [package for package in packages if package not in installed]
if missing:
print(PACKAGE_MANAGER_PACKAGES % ('MacPorts',))
self.run_as_root([self.port, '-v', 'install'] + missing)
def ensure_macports_system_packages(self):
packages = [
'python27',
+ 'python36',
'py27-gnureadline',
'mercurial',
'autoconf213',
'gnutar',
'watchman',
+ 'nodejs8'
]
self._ensure_macports_packages(packages)
self.run_as_root([self.port, 'select', '--set', 'python', 'python27'])
def ensure_macports_browser_packages(self, artifact_mode=False):
# TODO: Figure out what not to install for artifact mode
packages = [