From 29a50d36fb4d89f0192417a15dc49efaafa96512 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 14 Nov 2024 14:33:06 -0600 Subject: [PATCH 1/7] Adjusted build host policy script to append all three runs to one promises.log Ticket: none Changelog: none (cherry picked from commit a4c677a2fedf9fbcfb5db279cebf32260212249b) --- ci/setup-cfengine-build-host.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/setup-cfengine-build-host.sh b/ci/setup-cfengine-build-host.sh index f686b3902..bd99d9ff9 100755 --- a/ci/setup-cfengine-build-host.sh +++ b/ci/setup-cfengine-build-host.sh @@ -111,9 +111,9 @@ policy="$(dirname "$0")"/cfengine-build-host-setup.cf chmod 600 "$policy" /var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee promises.log grep -i error: promises.log && exit 1 -/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee promises.log +/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee -a promises.log grep -i error: promises.log && exit 1 -/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee promises.log +/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee -a promises.log grep -i error: promises.log && exit 1 cleanup From 7f4cc39be55a2218a458a2ac326fa051bbe24724 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 14 Nov 2024 14:33:56 -0600 Subject: [PATCH 2/7] Adjusted build host policy a bit for centos_9 Ticket: none Changelog: none (cherry picked from commit 4a4decacebb093ea439c6237da3228bca89a8cd6) --- ci/cfengine-build-host-setup.cf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/cfengine-build-host-setup.cf b/ci/cfengine-build-host-setup.cf index 49d017c32..16d59dd89 100644 --- a/ci/cfengine-build-host-setup.cf +++ b/ci/cfengine-build-host-setup.cf @@ -232,7 +232,7 @@ bundle agent cfengine_build_host_setup comment => "even though rhel8/9 come with /bin/perl perl >= 5.8.8 is needed by cfbuild-lcov-1.16-1.noarch. So the package must be installed."; redhat_9.!have_python3_pip_package_installed.(yum_dnf_conf_ok):: "yum install -y python3-pip" contain => in_shell; - redhat_8|centos_8|redhat_9:: + redhat_8|centos_8|redhat_9|centos_9:: "sudo sed -ri 's/^%_enable_debug_packages/#\0/' /usr/lib/rpm/redhat/macros" contain => in_shell; # todo, need 2.7pip psycopg2-binary for ubuntu-20 as well? debian_11.!have_pip2:: From 17d6dc12d26584cb067c37e9ef44dd3f7e72382f Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 14 Nov 2024 14:43:59 -0600 Subject: [PATCH 3/7] Adjusted build-environment-check to align with centos-7, redhat-8 and redhat-9 rpm-build package is available on centos-7 but in rhel-8 and 9 it is an alias which results in only rpm-build-libs being installed. Ticket: ENT-12042 Changelog: none (cherry picked from commit 318b398410334018c85d0bcca0c10fdde93e82e4) --- build-scripts/build-environment-check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-scripts/build-environment-check b/build-scripts/build-environment-check index 923c5e85e..bf9f51f4d 100755 --- a/build-scripts/build-environment-check +++ b/build-scripts/build-environment-check @@ -17,7 +17,7 @@ case "$OS" in rhel|centos) - DEP_LIST="gcc-c++ ncurses ncurses-devel pkgconfig rpm-build pam-devel" + DEP_LIST="gcc-c++ ncurses ncurses-devel pkgconfig rpm-build-libs pam-devel" UNWANTED_DEPS="libtool-ltdl libtool-ltdl-devel" ;; debian|ubuntu) From c6c17dfda8bcb0b25bdb2011115a5106ba9d80ff Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 14 Nov 2024 17:08:00 -0600 Subject: [PATCH 4/7] Adjusted build host policy to disable debug packages only after rpm-build-libs is installed (redhat) Ticket: ENT-12042 Changelog: none (cherry picked from commit 2fcffd7ad0a4788f3a3f6de89b681c258cf7f18e) --- ci/cfengine-build-host-setup.cf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ci/cfengine-build-host-setup.cf b/ci/cfengine-build-host-setup.cf index 16d59dd89..49efe8671 100644 --- a/ci/cfengine-build-host-setup.cf +++ b/ci/cfengine-build-host-setup.cf @@ -61,7 +61,8 @@ bundle agent cfengine_build_host_setup "pam-devel"; "rsync"; "make"; - "rpm-build"; + "rpm-build-libs" handle => "rpm_build_libs_installed"; + "libtool-ltdl" package_policy => "delete"; (redhat|centos).(yum_dnf_conf_ok):: "expat-devel"; @@ -233,11 +234,8 @@ bundle agent cfengine_build_host_setup redhat_9.!have_python3_pip_package_installed.(yum_dnf_conf_ok):: "yum install -y python3-pip" contain => in_shell; redhat_8|centos_8|redhat_9|centos_9:: - "sudo sed -ri 's/^%_enable_debug_packages/#\0/' /usr/lib/rpm/redhat/macros" contain => in_shell; -# todo, need 2.7pip psycopg2-binary for ubuntu-20 as well? - debian_11.!have_pip2:: - "wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -O get-pip.py && python2 get-pip.py && pip install psycopg2-binary" - contain => in_shell; + "sudo sed -ri 's/^%_enable_debug_packages/#\0/' /usr/lib/rpm/redhat/macros" contain => in_shell, + depends_on => { "rpm_build_libs_installed" }; ubuntu_16.!have_i386_architecture:: # mingw build host "${paths.dpkg} --add-architecture i386"; From 460d4978d525abb7ed7959bea2b79bc47895ddc5 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Sun, 17 Nov 2024 06:11:21 -0600 Subject: [PATCH 5/7] Fixed build-environment-check for centos/redhat rpm-build(-libs) package requirement Ticket: none Changelog: none (cherry picked from commit 6b4bc72a8c6c4a0d6702bafd44768a903e577b74) --- build-scripts/build-environment-check | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build-scripts/build-environment-check b/build-scripts/build-environment-check index bf9f51f4d..833823fc8 100755 --- a/build-scripts/build-environment-check +++ b/build-scripts/build-environment-check @@ -17,7 +17,7 @@ case "$OS" in rhel|centos) - DEP_LIST="gcc-c++ ncurses ncurses-devel pkgconfig rpm-build-libs pam-devel" + DEP_LIST="gcc-c++ ncurses ncurses-devel pkgconfig pam-devel" UNWANTED_DEPS="libtool-ltdl libtool-ltdl-devel" ;; debian|ubuntu) @@ -32,10 +32,16 @@ case "$OS" in ;; esac + # Fakeroot is here: http://dl.atrpms.net/el5-$1/atrpms/stable/fakeroot-1.6.4-15.1.el5.$1.rpm # It is needed by the debian buildslaves for their packaging scripts case "$OS-$OS_VERSION" in - rhel-* | centos-* ) DEP_LIST="$DEP_LIST" ;; + rhel-6|centos-6) + DEP_LIST="$DEP_LIST rpm-build" + ;; + rhel-* | centos-* ) + DEP_LIST="$DEP_LIST rpm-build-libs" + ;; *) DEP_LIST="$DEP_LIST fakeroot" ;; esac From cc9e4e4f9078a582f78ec3a22aa40f7017a05c26 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Sun, 17 Nov 2024 05:59:11 -0600 Subject: [PATCH 6/7] Fix formatting in ci/cfengine-build-host-setup.cf Ticket: none Changelog: none (cherry picked from commit 96a4d3787a60f772c091f5a0e4071d0986afe071) --- ci/cfengine-build-host-setup.cf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/cfengine-build-host-setup.cf b/ci/cfengine-build-host-setup.cf index 49efe8671..68c3fd358 100644 --- a/ci/cfengine-build-host-setup.cf +++ b/ci/cfengine-build-host-setup.cf @@ -20,8 +20,8 @@ bundle agent cfengine_build_host_setup "shellcheck" comment => "not sure why only ubuntu-20 needed this."; debian.(!debian_12.!ubuntu_22):: "python" comment => "debian-12 has only python3"; - !(debian_9|ubuntu_16).(debian|ubuntu):: - "default-jre" comment => "on debian10+ and ubuntu18+ this will be jdk11, good enough for jenkins 2.426.1 https://www.jenkins.io/doc/book/platform-information/support-policy-java/index.html"; + !(debian_9|ubuntu_16).(debian|ubuntu):: + "default-jre" comment => "on debian10+ and ubuntu18+ this will be jdk11, good enough for jenkins 2.426.1 https://www.jenkins.io/doc/book/platform-information/support-policy-java/index.html"; debian|ubuntu:: "libltdl7" package_policy => "delete"; From 6fe45585a4cc8eedd2d10b7198e7055af9f156be Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Sun, 17 Nov 2024 05:59:23 -0600 Subject: [PATCH 7/7] Fixed build host policy for centos-6 and rpm-build install Ticket: None Changelog: None (cherry picked from commit 26a442f811bfcb6142f2e313aa86257ed2016d8a) --- ci/cfengine-build-host-setup.cf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ci/cfengine-build-host-setup.cf b/ci/cfengine-build-host-setup.cf index 68c3fd358..58edf566b 100644 --- a/ci/cfengine-build-host-setup.cf +++ b/ci/cfengine-build-host-setup.cf @@ -61,7 +61,6 @@ bundle agent cfengine_build_host_setup "pam-devel"; "rsync"; "make"; - "rpm-build-libs" handle => "rpm_build_libs_installed"; "libtool-ltdl" package_policy => "delete"; (redhat|centos).(yum_dnf_conf_ok):: @@ -73,7 +72,13 @@ bundle agent cfengine_build_host_setup "perl-Module-Load-Conditional"; "wget"; + !(redhat_6|centos_6).(yum_dnf_conf_ok):: + "rpm-build-libs" handle => "rpm_build_installed"; + "python3-psycopg2"; + (redhat_6|centos_6).(yum_dnf_conf_ok):: + "rpm-build" handle => "rpm_build_installed"; + "python-psycopg2" comment => "centos-6 provides python2 and psycopg2 for python2 as a package"; "perl-IO-Compress-Zlib" comment => "provides perl(IO::Uncompress::Gunzip) needed by lcov dependency package"; "perl-JSON"; # perl-Digest-MD5 and perl-Data-Dumper are included in perl for centos-6 @@ -88,7 +93,7 @@ bundle agent cfengine_build_host_setup (redhat_6|centos_6).(yum_dnf_conf_ok):: "python-psycopg2" comment => "centos-6 provides python2 and psycopg2 for python2 as a package"; - (redhat_7|centos_7).(yum_dnf_conf_ok):: + !(redhat_6|centos_6).(yum_dnf_conf_ok):: "python3-psycopg2"; # note that shellcheck, fakeroot and ccache require epel-release to be installed @@ -235,7 +240,7 @@ bundle agent cfengine_build_host_setup "yum install -y python3-pip" contain => in_shell; redhat_8|centos_8|redhat_9|centos_9:: "sudo sed -ri 's/^%_enable_debug_packages/#\0/' /usr/lib/rpm/redhat/macros" contain => in_shell, - depends_on => { "rpm_build_libs_installed" }; + depends_on => { "rpm_build_installed" }; ubuntu_16.!have_i386_architecture:: # mingw build host "${paths.dpkg} --add-architecture i386";