From c12609dd9ed65b245cee2e8b379b1e1f15aadf6a Mon Sep 17 00:00:00 2001
From: Namrata Bhave <Namrata.Bhave@ibm.com>
Date: Tue, 11 Feb 2020 11:29:19 +0530
Subject: [PATCH] Review comments: Refactoring the duplicates

Have separated out the common dependencies on top.
---
 .travis.yml | 211 +++++++++++-----------------------------------------
 1 file changed, 44 insertions(+), 167 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 6b948b4ffc6..80d954018bf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,16 +40,6 @@ addons:
         key_url: 'http://keyserver.ubuntu.com/pks/lookup?search=0xF1656F24C74CD1D8&op=get'
     packages: &common-packages 
       # make sure these include all compilers and all build dependencies (see list above)
-      - gcc-6
-      - g++-6
-      - gcc-7
-      - g++-7
-      - gcc-8
-      - g++-8
-      - clang-6.0
-      - llvm-6.0-dev
-      - clang-7
-      - llvm-7-dev
       - bison
       - chrpath
       - cmake
@@ -93,48 +83,10 @@ matrix:
       compiler: gcc
       env:
         - DebPackages
-      addons:
+      addons: 
         apt:
-          packages: # make sure these match debian/control contents
-            - bison
-            - chrpath
-            - cmake
-            - debhelper
-            - dh-apparmor
-            - dpatch
-            - gdb
-            - libaio-dev
-            - libboost-dev
-            - libcurl3-dev
-            - libdbd-mysql
-            - libjudy-dev
-            - libncurses5-dev
-            - libpam0g-dev
-            - libpcre3-dev
-            - libreadline-gplv2-dev
-            - libstemmer-dev
-            - libssl-dev
-            - libnuma-dev
-            - libxml2-dev
-            - lsb-release
-            - perl
-            - po-debconf
-            - psmisc
-            - zlib1g-dev
-            - libcrack2-dev
-            - cracklib-runtime
-            - libjemalloc-dev
-            - libsnappy-dev
-            - liblzma-dev
-            - libzmq-dev
-            - libdistro-info-perl
-            - uuid-dev
-            - devscripts
-            - fakeroot
-            - dh-systemd
-            - libsystemd-dev
-            - libzstd-dev
-            - unixodbc-dev
+          sources: *add-sources
+          packages: [ *common-packages, debhelper, dh-apparmor, dpatch, po-debconf, libzmq-dev, libdistro-info-perl, devscripts, fakeroot, dh-systemd, libsystemd-dev, libzstd-dev, unixodbc-dev] # make sure these match debian/control contents
       script:
         - ${CC} --version ; ${CXX} --version
         - env DEB_BUILD_OPTIONS="parallel=4" debian/autobake-deb.sh;
@@ -144,198 +96,123 @@ matrix:
       compiler: gcc
       env:
         - DebPackages
-      addons:
+      addons: 
         apt:
-          packages: # make sure these match debian/control contents
-            - bison
-            - chrpath
-            - cmake
-            - debhelper
-            - dh-apparmor
-            - dpatch
-            - gdb
-            - libaio-dev
-            - libboost-dev
-            - libcurl3-dev
-            - libdbd-mysql
-            - libjudy-dev
-            - libncurses5-dev
-            - libpam0g-dev
-            - libpcre3-dev
-            - libreadline-gplv2-dev
-            - libstemmer-dev
-            - libssl-dev
-            - libnuma-dev
-            - libxml2-dev
-            - lsb-release
-            - perl
-            - po-debconf
-            - psmisc
-            - zlib1g-dev
-            - libcrack2-dev
-            - cracklib-runtime
-            - libjemalloc-dev
-            - libsnappy-dev
-            - galera-3
-            - liblzma-dev
-            - libzmq3-dev
-            - libdistro-info-perl
-            - uuid-dev
-            - devscripts
-            - fakeroot
-            - dh-systemd
-            - libsystemd-dev
-            - libzstd-dev
-            - unixodbc-dev
+          sources: *add-sources
+          packages: [ *common-packages, debhelper, dh-apparmor, dpatch, po-debconf, libzmq3-dev, libdistro-info-perl, devscripts, fakeroot, dh-systemd, libsystemd-dev, libzstd-dev, unixodbc-dev] # make sure these match debian/control contents
       script:
         - ${CC} --version ; ${CXX} --version
         - env DEB_BUILD_OPTIONS="parallel=4" debian/autobake-deb.sh;
     - os: linux     
       compiler: gcc
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
-      addons: 
+      addons: &gcc6_addons
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+          packages: [ *common-packages, gcc-6, g++-6, galera-4, libzmq-dev]
     - os: linux     
       compiler: gcc
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+      addons: *gcc6_addons
     - os: linux     
       compiler: gcc
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rpl
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+      addons: *gcc6_addons
     - os: linux     
       compiler: gcc
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption
-      addons: 
+      addons: &gcc7_addons
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+          packages: [ *common-packages, gcc-7, g++-7, galera-4, libzmq-dev]
     - os: linux     
       compiler: gcc
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rocksdb,versioning
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+      addons: *gcc7_addons
     - os: linux     
       compiler: gcc
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+      addons: *gcc7_addons
     - os: linux     
       compiler: gcc
       env: CC_VERSION=8 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
       addons: 
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+          packages: [ *common-packages, gcc-8, g++-8, galera-4, libzmq-dev]
     - os: linux     
       compiler: clang
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
-      addons: 
+      addons: &clang6_addons
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+          packages: [ *common-packages, clang-6.0, llvm-6.0-dev, galera-4, libzmq-dev]
     - os: linux     
       compiler: clang
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+      addons: *clang6_addons
     - os: linux     
       compiler: clang
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rpl
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+      addons: *clang6_addons
     - os: linux     
       compiler: clang
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption
-      addons: 
+      addons: &clang7_addons
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+          packages: [ *common-packages, clang-7, llvm-7-dev, galera-4, libzmq-dev]
     - os: linux     
       compiler: clang
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rocksdb,versioning
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+      addons: *clang7_addons
     - os: linux     
       compiler: clang
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-4, libzmq-dev]
+      addons: *clang7_addons 
   #s390x matrix
     - os: linux
       arch: s390x
       dist: bionic
       compiler: gcc
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
-      addons: 
+      addons: &gcc6_addons_s390x
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+          packages: [ *common-packages, gcc-6, g++-6, galera-3, libzmq3-dev]
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: gcc
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+      addons: *gcc6_addons_s390x
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: gcc
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rpl
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+      addons: *gcc6_addons_s390x
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: gcc
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption
-      addons: 
+      addons: &gcc7_addons_s390x
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+          packages: [ *common-packages, gcc-7, g++-7, galera-3, libzmq3-dev]
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: gcc
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rocksdb,versioning
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+      addons: *gcc7_addons_s390x
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: gcc
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+      addons: *gcc7_addons_s390x
     - os: linux
       arch: s390x
       dist: bionic	
@@ -344,43 +221,43 @@ matrix:
       addons: 
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+          packages: [ *common-packages, gcc-8, g++-8, galera-3, libzmq3-dev]
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: clang
       env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
-      addons: 
+      addons: &clang6_addons_s390x
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+          packages: [ *common-packages, clang-6.0, llvm-6.0-dev, galera-3, libzmq3-dev]
+    - os: linux
+      arch: s390x
+      dist: bionic	
+      compiler: clang
+      env: CC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rpl
+      addons: *clang6_addons_s390x
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: clang
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption
-      addons: 
+      addons: &clang7_addons_s390x
         apt:
           sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+          packages: [ *common-packages, clang-7, llvm-7-dev, galera-3, libzmq3-dev] 
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: clang
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rocksdb,versioning
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]
+      addons: *clang7_addons_s390x
     - os: linux
       arch: s390x
       dist: bionic	
       compiler: clang
       env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles
-      addons: 
-        apt:
-          sources: *add-sources
-          packages: [ *common-packages, galera-3, libzmq3-dev]  
+      addons: *clang7_addons_s390x
   # Until OSX becomes a bit more stable: MDEV-12435 MDEV-16213
   allow_failures:
     - os: osx