bootstrap: If the mold linker is available prefer it over gold
[metze/samba-autobuild/.git] / bootstrap / config.py
index b02ce4cf5666db148ff2a7dd75e2bc92c14a9c52..27e6d22d3f5cb1a08fb808053688cbc3e3867698 100644 (file)
@@ -20,6 +20,9 @@ Manage dependencies and bootstrap environments for Samba.
 
 Config file for packages and templates.
 
+Update the lists in this file to require new packages in the
+container images used in GitLab CI
+
 Author: Joe Guo <joeg@catalyst.net.nz>
 """
 import os
@@ -142,8 +145,8 @@ PKGS = [
     ('python3-pyasn1', 'python3-pyasn1'), # for krb5 tests
     ('python3-setproctitle', 'python3-setproctitle'),
 
-    ('', 'libsemanage-python'),
-    ('', 'policycoreutils-python'),
+    ('', 'python3-libsemanage'),
+    ('', 'python3-policycoreutils'),
 
     # perl
     ('libparse-yapp-perl', 'perl-Parse-Yapp'),
@@ -227,7 +230,7 @@ if [ ! -f /usr/bin/python3 ]; then
 fi
 """
 
-CENTOS8_YUM_BOOTSTRAP = r"""
+CENTOS8S_YUM_BOOTSTRAP = r"""
 #!/bin/bash
 {GENERATED_MARKER}
 set -xueo pipefail
@@ -237,10 +240,9 @@ yum install -y dnf-plugins-core
 yum install -y epel-release
 
 yum -v repolist all
-yum config-manager --set-enabled PowerTools -y || \
+yum config-manager --set-enabled powertools -y || \
     yum config-manager --set-enabled powertools -y
-yum config-manager --set-enabled Devel -y || \
-    yum config-manager --set-enabled devel -y
+
 yum update -y
 
 yum install -y \
@@ -352,6 +354,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh
 
 # if ld.gold exists, force link it to ld
 RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+# if ld.mold exists, force link it to ld (prefer mold over gold! ;-)
+RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD"
 
 # make test can not work with root, so we have to create a new user
 RUN useradd -m -U -s /bin/bash samba && \
@@ -396,15 +400,11 @@ DEB_DISTS = {
             'liburing-dev': '',   # not available
         }
     },
-    'ubuntu1604': {
-        'docker_image': 'ubuntu:16.04',
-        'vagrant_box': 'ubuntu/xenial64',
+    'debian11': {
+        'docker_image': 'debian:11',
+        'vagrant_box': 'debian/bullseye64',
         'replace': {
-            'python3-gpg': 'python3-gpgme',
-            'glusterfs-common': '',
-            'libcephfs-dev': '',
-            'liburing-dev': '',   # not available
-            'libtracker-sparql-2.0-dev': '', # not available
+            'language-pack-en': '',   # included in locales
         }
     },
     'ubuntu1804': {
@@ -455,48 +455,46 @@ RPM_DISTS = {
             'glusterfs-api-devel': '',
             'glusterfs-devel': '',
             'libcephfs-devel': '',
-            'gnutls-devel': 'compat-gnutls34-devel',
+            'gnutls-devel': 'compat-gnutls37-devel',
             'liburing-devel': '',   # not available
             'python3-setproctitle': 'python36-setproctitle',
             'tracker-devel': '', # do not install
         }
     },
-    'centos8': {
-        'docker_image': 'centos:8',
-        'vagrant_box': 'centos/8',
-        'bootstrap': CENTOS8_YUM_BOOTSTRAP,
+    'centos8s': {
+        'docker_image': 'quay.io/centos/centos:stream8',
+        'vagrant_box': 'centos/stream8',
+        'bootstrap': CENTOS8S_YUM_BOOTSTRAP,
         'replace': {
             'lsb-release': 'redhat-lsb',
             '@development-tools': '"@Development Tools"',  # add quotes
-            'libsemanage-python': 'python3-libsemanage',
             'lcov': '', # does not exist
             'perl-JSON-Parse': '', # does not exist?
             'perl-Test-Base': 'perl-Test-Simple',
             'perl-FindBin': '',
-            'policycoreutils-python': 'python3-policycoreutils',
             'liburing-devel': '', # not available yet, Add me back, once available!
         }
     },
-    'fedora33': {
-        'docker_image': 'fedora:33',
-        'vagrant_box': 'fedora/33-cloud-base',
+    'fedora34': {
+        'docker_image': 'fedora:34',
+        'vagrant_box': 'fedora/34-cloud-base',
         'bootstrap': DNF_BOOTSTRAP,
         'replace': {
             'lsb-release': 'redhat-lsb',
-            'libsemanage-python': 'python3-libsemanage',
-            'policycoreutils-python': 'python3-policycoreutils',
+            'perl-FindBin': '',
+            'python3-iso8601': 'python3-dateutil',
+            'libtracker-sparql-2.0-dev': '',  # only tracker 3.x is available
         }
     },
-    'fedora34': {
-        'docker_image': 'fedora:34',
-        'vagrant_box': 'fedora/34-cloud-base',
+    'fedora35': {
+        'docker_image': 'fedora:35',
+        'vagrant_box': 'fedora/35-cloud-base',
         'bootstrap': DNF_BOOTSTRAP,
         'replace': {
             'lsb-release': 'redhat-lsb',
-            'libsemanage-python': 'python3-libsemanage',
-            'policycoreutils-python': 'python3-policycoreutils',
             'perl-FindBin': '',
-            'libtracker-sparql-2.0-dev': '', # only tracker 3.x is available
+            'python3-iso8601': 'python3-dateutil',
+            'libtracker-sparql-2.0-dev': '',  # only tracker 3.x is available
         }
     },
     'opensuse151': {
@@ -513,7 +511,7 @@ RPM_DISTS = {
             'jansson-devel': 'libjansson-devel',
             'keyutils-libs-devel': 'keyutils-devel',
             'krb5-workstation': 'krb5-client',
-            'libsemanage-python': 'python2-semanage',
+            'python3-libsemanage': 'python2-semanage',
             'openldap-devel': 'openldap2-devel',
             'perl-Archive-Tar': 'perl-Archive-Tar-Wrapper',
             'perl-JSON-Parse': 'perl-JSON-XS',
@@ -544,7 +542,7 @@ RPM_DISTS = {
             'jansson-devel': 'libjansson-devel',
             'keyutils-libs-devel': 'keyutils-devel',
             'krb5-workstation': 'krb5-client',
-            'libsemanage-python': 'python2-semanage',
+            'python3-libsemanage': 'python2-semanage',
             'openldap-devel': 'openldap2-devel',
             'perl-Archive-Tar': 'perl-Archive-Tar-Wrapper',
             'perl-JSON-Parse': 'perl-JSON-XS',
@@ -552,6 +550,7 @@ RPM_DISTS = {
             'perl-interpreter': '',
             'perl-FindBin': '',
             'procps-ng': 'procps',
+            'python3-iso8601': 'python3-python-dateutil',
             'python3-dns': 'python3-dnspython',
             'python3-markdown': 'python3-Markdown',
             'quota-devel': '',