Bug 1127565 - Bootstrap for openSUSE; r=gps
☠☠ backed out by 81cde2d265ab ☠ ☠
authorNicklas Boman <smurfd@gmail.com>
Fri, 12 Oct 2018 22:43:51 +0200
changeset 507273 0db8bd8fbcad34a43e4421db2f9f501ff4f22ffe
parent 507272 ebde69d647484994e4831edfc4e5f51dea6fb32c
child 507274 81cde2d265ab24055b77d12899e51f979cfc2043
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1127565
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1127565 - Bootstrap for openSUSE; r=gps
python/mozboot/mozboot/base.py
python/mozboot/mozboot/bootstrap.py
python/mozboot/mozboot/opensuse.py
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -63,17 +63,17 @@ this shell. Try creating a new shell and
 
 If this continues to fail and you are sure you have a modern Python on your
 system, ensure it is on the $PATH and try again. If that fails, you'll need to
 install Python manually and ensure the path with the python binary is listed in
 the $PATH environment variable.
 
 We recommend the following tools for installing Python:
 
-    pyenv   -- https://github.com/yyuu/pyenv)
+    pyenv   -- https://github.com/yyuu/pyenv
     pythonz -- https://github.com/saghul/pythonz
     official installers -- http://www.python.org/
 '''
 
 RUST_INSTALL_COMPLETE = '''
 Rust installation complete. You should now have rustc and cargo
 in %(cargo_bin)s
 
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -19,16 +19,17 @@ except ImportError:
         Error as ConfigParserError,
         RawConfigParser,
     )
 
 # Don't forgot to add new mozboot modules to the bootstrap download
 # list in bin/bootstrap.py!
 from mozboot.base import MODERN_RUST_VERSION
 from mozboot.centosfedora import CentOSFedoraBootstrapper
+from mozboot.opensuse import OpenSUSEBootstrapper
 from mozboot.debian import DebianBootstrapper
 from mozboot.freebsd import FreeBSDBootstrapper
 from mozboot.gentoo import GentooBootstrapper
 from mozboot.osx import OSXBootstrapper
 from mozboot.openbsd import OpenBSDBootstrapper
 from mozboot.archlinux import ArchlinuxBootstrapper
 from mozboot.windows import WindowsBootstrapper
 from mozboot.mozillabuild import MozillaBuildBootstrapper
@@ -256,16 +257,18 @@ class Bootstrapper(object):
             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
+            elif os.path.exists('/etc/SUSE-brand'):
+                cls = OpenSUSEBootstrapper
             else:
                 raise NotImplementedError('Bootstrap support for this Linux '
                                           'distro not yet available.')
 
             args['version'] = version
             args['dist_id'] = dist_id
 
         elif sys.platform.startswith('darwin'):
@@ -290,16 +293,17 @@ class Bootstrapper(object):
                 cls = MozillaBuildBootstrapper
             else:
                 cls = WindowsBootstrapper
 
         if cls is None:
             raise NotImplementedError('Bootstrap support is not yet available '
                                       'for your OS.')
 
+
         self.instance = cls(**args)
 
     def input_clone_dest(self, with_hg=True):
         repo_name = 'mozilla-unified'
         vcs = 'Mercurial'
         if not with_hg:
             repo_name = 'gecko'
             vcs = 'Git'
new file mode 100644
--- /dev/null
+++ b/python/mozboot/mozboot/opensuse.py
@@ -0,0 +1,157 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from __future__ import absolute_import, print_function
+
+import os
+import sys
+import tempfile
+import subprocess
+import glob
+
+from mozboot.base import BaseBootstrapper
+from mozboot.linux_common import NodeInstall, StyloInstall
+
+
+class OpenSUSEBootstrapper(NodeInstall, StyloInstall, BaseBootstrapper):
+    '''openSUSE experimental bootstrapper.'''
+
+    SYSTEM_PACKAGES = [
+        'autoconf213',
+        'nodejs',
+        'npm',
+        'which',
+        'python-devel',
+        'rpmconf',
+        'libcurl-devel',
+    ]
+
+    BROWSER_PACKAGES = [
+        'alsa-devel',
+        'gcc-c++',
+        'python2-dbus-python',
+        'gtk3-devel',
+        'dbus-1-glib-devel',
+        'gconf2-devel',
+        'glibc-devel-static',
+        'libstdc++-devel',
+        'libXt-devel',
+        'libproxy-devel',
+        'libuuid-devel',
+        'yasm',
+        'gtk2-devel',
+        'clang-devel',
+        'patterns-gnome-devel_gnome',
+    ]
+
+    BROWSER_GROUP_PACKAGES = [
+        'devel_C_C++',
+        'devel_gnome',
+    ]
+
+    MOBILE_ANDROID_COMMON_PACKAGES = [
+        'java-1_8_0-openjdk',
+        'wget',
+    ]
+
+    def __init__(self, version, dist_id, **kwargs):
+        print('Using an experimental bootstrapper for openSUSE.')
+        BaseBootstrapper.__init__(self, **kwargs)
+
+    def install_system_packages(self):
+        self.zypper_install(*self.SYSTEM_PACKAGES)
+
+    def install_browser_packages(self):
+        self.ensure_browser_packages()
+
+    def install_browser_group_packages(self):
+        self.ensure_browser_group_packages()
+
+    def install_browser_artifact_mode_packages(self):
+        self.ensure_browser_packages(artifact_mode=True)
+
+    def install_mobile_android_packages(self):
+        self.ensure_mobile_android_packages()
+
+    def install_mobile_android_artifact_mode_packages(self):
+        self.ensure_mobile_android_packages(artifact_mode=True)
+
+    def ensure_browser_packages(self, artifact_mode=False):
+        # TODO: Figure out what not to install for artifact mode
+        #self.aur_install(*self.BROWSER_AUR_PACKAGES)
+        self.zypper_install(*self.BROWSER_PACKAGES)
+
+    def ensure_browser_group_packages(self, artifact_mode=False):
+        # TODO: Figure out what not to install for artifact mode
+        #self.aur_install(*self.BROWSER_AUR_PACKAGES)
+        self.zypper_patterninstall(*self.BROWSER_GROUP_PACKAGES)
+
+    def ensure_mobile_android_packages(self, artifact_mode=False):
+        # Multi-part process:
+        # 1. System packages.
+        # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages.
+
+        # 1. This is hard to believe, but the Android SDK binaries are 32-bit
+        # and that conflicts with 64-bit Arch installations out of the box.  The
+        # solution is to add the multilibs repository; unfortunately, this
+        # requires manual intervention.
+        try:
+            self.zypper_install(*self.MOBILE_ANDROID_COMMON_PACKAGES)
+        except Exception as e:
+            print('Failed to install all packages.  The Android developer '
+                  'toolchain requires 32 bit binaries be enabled')
+            raise e
+
+        # 2. Android pieces.
+        from mozboot import android
+        android.ensure_android('linux', artifact_mode=artifact_mode,
+                               no_interactive=self.no_interactive)
+
+    def suggest_mobile_android_mozconfig(self, artifact_mode=False):
+        from mozboot import android
+        android.suggest_mozconfig('linux', artifact_mode=artifact_mode)
+
+    def suggest_mobile_android_artifact_mode_mozconfig(self):
+        self.suggest_mobile_android_mozconfig(artifact_mode=True)
+
+    def _update_package_manager(self):
+        self.zypper_update
+
+    def upgrade_mercurial(self, current):
+        self.zypper_install('mercurial')
+
+    def upgrade_python(self, current):
+        self.zypper_install('python2')
+
+    def zypper_install(self, *packages):
+        command = ['zypper', 'install']
+        if self.no_interactive:
+            command.append('-n')
+
+        command.extend(packages)
+
+        self.run_as_root(command)
+
+    def zypper_update(self):
+        command = ['zypper', 'update']
+
+        self.run_as_root(command)
+
+    def zypper_update(self, *packages):
+        command = ['zypper', 'update']
+        if self.no_interactive:
+            command.append('-n')
+
+        command.extend(packages)
+
+        self.run_as_root(command)
+
+    def zypper_patterninstall(self, *packages):
+        command = ['zypper', 'install', '-t', 'pattern']
+        if self.no_interactive:
+            command.append('-y')
+
+        command.extend(packages)
+
+        self.run_as_root(command)