From 75d0aca6c0ab69b95169e7f8fb74b15e160df46f Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Tue, 16 Jun 2026 17:01:55 +0200 Subject: [PATCH] SRE-3722 cq: remove chroot-based RPM build pipeline (#17944) chroot-based RPMs build is no longer supported. Signed-off-by: Tomasz Gromadzki --- Jenkinsfile | 11 +- ci/parse_ci_envs.sh | 11 - ci/rpm/build.sh | 60 -- ci/rpm/build_success.sh | 36 +- ci/rpm/build_unsuccessful.sh | 43 -- utils/rpms/Makefile | 37 -- utils/rpms/archive.sh | 46 -- utils/rpms/packaging/Dockerfile.centos.7 | 56 -- utils/rpms/packaging/Dockerfile.coverity | 32 -- utils/rpms/packaging/Dockerfile.mockbuild | 78 --- utils/rpms/packaging/Dockerfile.ubuntu | 49 -- utils/rpms/packaging/Makefile_distro_vars.mk | 161 ------ utils/rpms/packaging/Makefile_packaging.mk | 516 ------------------ utils/rpms/packaging/ccache-stats.patch | 66 --- utils/rpms/packaging/debian_chrootbuild | 64 --- utils/rpms/packaging/rpm_chrootbuild | 166 ------ .../rpmlint--ignore-unused-rpmlintrc.patch | 41 -- 17 files changed, 7 insertions(+), 1466 deletions(-) delete mode 100755 ci/rpm/build.sh delete mode 100755 ci/rpm/build_unsuccessful.sh delete mode 100644 utils/rpms/Makefile delete mode 100755 utils/rpms/archive.sh delete mode 100644 utils/rpms/packaging/Dockerfile.centos.7 delete mode 100755 utils/rpms/packaging/Dockerfile.coverity delete mode 100644 utils/rpms/packaging/Dockerfile.mockbuild delete mode 100644 utils/rpms/packaging/Dockerfile.ubuntu delete mode 100644 utils/rpms/packaging/Makefile_distro_vars.mk delete mode 100644 utils/rpms/packaging/Makefile_packaging.mk delete mode 100644 utils/rpms/packaging/ccache-stats.patch delete mode 100755 utils/rpms/packaging/debian_chrootbuild delete mode 100755 utils/rpms/packaging/rpm_chrootbuild delete mode 100644 utils/rpms/packaging/rpmlint--ignore-unused-rpmlintrc.patch diff --git a/Jenkinsfile b/Jenkinsfile index 9c0232492e9..8ec051f8c86 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -83,7 +83,7 @@ Integer getuid() { } void fixup_rpmlintrc() { - if (env.SCONS_FAULTS_ARGS != 'BUILD_TYPE=dev') { + if (sconsArgs() != 'BUILD_TYPE=dev') { return } @@ -200,7 +200,6 @@ pipeline { TEST_RPMS = cachedCommitPragma(pragma: 'RPM-test', def_val: 'true') COVFN_DISABLED = cachedCommitPragma(pragma: 'Skip-fnbullseye', def_val: 'true') REPO_FILE_URL = repoFileUrl(env.REPO_FILE_URL) - SCONS_FAULTS_ARGS = sconsArgs() HTTPS_PROXY = '' PYTHON_VERSION = '3.11' } @@ -632,9 +631,11 @@ pipeline { script: './ci/rpm/build_deps.sh' job_step_update( sconsBuild(parallel_build: true, - scons_args: sconsFaultsArgs() + - ' PREFIX=/opt/daos TARGET_TYPE=release', - build_deps: 'yes')) + stash_files: 'ci/test_files_to_stash.txt', + build_deps: 'no', + stash_opt: true, + scons_args: sconsArgs() + + ' PREFIX=/opt/daos TARGET_TYPE=release')) sh label: 'Generate RPMs', script: './ci/rpm/gen_rpms.sh suse.lp156 "' + env.DAOS_RELVAL + '"' } diff --git a/ci/parse_ci_envs.sh b/ci/parse_ci_envs.sh index 2c382ada779..1043fc517b1 100755 --- a/ci/parse_ci_envs.sh +++ b/ci/parse_ci_envs.sh @@ -8,48 +8,38 @@ set -uex if [ -n "${STAGE_NAME:?}" ]; then case $STAGE_NAME in *CentOS\ 7*|*el7*|*centos7*) - : "${CHROOT_NAME:=centos+epel-7-x86_64}" : "${TARGET:=centos7}" : "${REPO_SPEC:=el-7}" ;; *CentOS\ 8*|*EL\ 8*|*el8*|*centos8*) - : "${CHROOT_NAME:=rocky+epel-8-x86_64}" : "${TARGET:=centos8}" : "${REPO_SPEC:=el-8}" ;; *CentOS\ 9*|*EL\ 9*|*el9*|*centos9*) - : "${CHROOT_NAME:=rocky+epel-9-x86_64}" : "${TARGET:=centos9}" : "${REPO_SPEC:=el-9}" ;; *Leap\ 15.6*|*leap15.6*|*opensuse15.6*|*sles15.6*) - : "${CHROOT_NAME:=opensuse-leap-15.5-x86_64}" : "${TARGET:=leap15.6}" ;; *Leap\ 15.5*|*leap15.5*|*opensuse15.5*|*sles15.5*) - : "${CHROOT_NAME:=opensuse-leap-15.5-x86_64}" : "${TARGET:=leap15.5}" ;; *Leap\ 15.4*|*leap15.4*|*opensuse15.4*|*sles15.4*) - : "${CHROOT_NAME:=opensuse-leap-15.4-x86_64}" : "${TARGET:=leap15.4}" ;; *Leap\ 15.3*|*leap15.3*|*opensuse15.3*|*sles15.3*) - : "${CHROOT_NAME:=opensuse-leap-15.3-x86_64}" : "${TARGET:=leap15.3}" ;; *Leap\ 15*|*leap15*|*opensuse15*|*sles15*) - : "${CHROOT_NAME:=opensuse-leap-15.5-x86_64}" : "${TARGET:=leap15}" : "${REPO_SPEC:=sl-15}" ;; *Ubuntu\ 20.04*|*ubuntu2004*) - : "${CHROOT_NAME:="not_applicable"}" : "${TARGET:=ubuntu20}" : "${REPO_SPEC:=ubuntu-20.04}" ;; *Ubuntu\ 22.04*|*ubuntu2204*) - : "${CHROOT_NAME:="not_applicable"}" : "${TARGET:=ubuntu22}" : "${REPO_SPEC:=ubuntu-22.04}" ;; @@ -60,5 +50,4 @@ if [ -n "${STAGE_NAME:?}" ]; then ;; esac fi -export CHROOT_NAME export TARGET diff --git a/ci/rpm/build.sh b/ci/rpm/build.sh deleted file mode 100755 index 19529a45992..00000000000 --- a/ci/rpm/build.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# Script for building RPMs in a chroot -# If the STAGE_NAME environment variable is present the script will -# attempt to parse it to determine what distribution to build for. -# -# For manual testing, you can set the environment variables CHROOT_NAME -# and TARGET can be set. -# -# Default is to build for CentOS 7. -# Fault injection will be enabled by default in CI unless a pragma has -# has disabled fault injection or this is a Release build -set -uex - -id -if [ "$(id -u)" = "0" ]; then - echo "Should not be run as root" - exit 1 -fi - -mydir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" -ci_envs="$mydir/../parse_ci_envs.sh" -if [ -e "${ci_envs}" ]; then - # shellcheck source=parse_ci_envs.sh disable=SC1091 - source "${ci_envs}" -fi - -: "${SCONS_FAULTS_ARGS:=BUILD_TYPE=dev}" -SCONS_ARGS="${SCONS_FAULTS_ARGS}" - -: "${CHROOT_NAME:='rocky+epel-8-x86_64'}" -: "${TARGET:='el8'}" -: "${REPO_SPEC:='el-8'}" - -: "${COVFN_DISABLED:=true}" -: "${JOB_REPOS:=}" -EXTERNAL_COMPILER_OPT="" - -if ! $COVFN_DISABLED && [[ $REPO_SPEC == el-* ]]; then - compiler_args="COMPILER=covc" - EXTERNAL_COMPILER_OPT=" --define \"compiler_args ${compiler_args}\"" -fi - -EXTERNAL_SCONS_OPT=" --define \"scons_args ${SCONS_ARGS}\"" -EXTERNAL_RPM_BUILD_OPTIONS="${EXTERNAL_SCONS_OPT}${EXTERNAL_COMPILER_OPT}" - -rm -rf "artifacts/${TARGET}/" -if ! mkdir -p "artifacts/${TARGET}/"; then - echo "Failed to create directory \"artifacts/${TARGET}/\"" - ls -ld . || true - pwd || true - exit 1 -fi - -# shellcheck disable=SC2086 -DEBEMAIL="$DAOS_EMAIL" DEBFULLNAME="$DAOS_FULLNAME" \ -TOPDIR=$PWD make CHROOT_NAME="${CHROOT_NAME}" ${JOB_REPOS} \ - EXTERNAL_RPM_BUILD_OPTIONS="${EXTERNAL_RPM_BUILD_OPTIONS}" \ - SCONS_ARGS="${SCONS_ARGS}" DISTRO_VERSION="${DISTRO_VERSION}" \ - -C utils/rpms chrootbuild diff --git a/ci/rpm/build_success.sh b/ci/rpm/build_success.sh index fa8e1828bd2..93e82ee72c6 100755 --- a/ci/rpm/build_success.sh +++ b/ci/rpm/build_success.sh @@ -11,53 +11,19 @@ if [ -e "${ci_envs}" ]; then source "${ci_envs}" fi -: "${CHROOT_NAME:=epel-7-x86_64}" -: "${TARGET:=centos7}" +: "${TARGET:=centos9}" artdir="${PWD}/artifacts/${TARGET}" rm -rf "$artdir" mkdir -p "$artdir" mkdir -p "$artdir/daos" -# ubuntu isn't complete since we don't have ubuntu stages -if [ -d /home/daos/pkgs/ ]; then - cp /home/daos/pkgs/*.deb "${artdir}" - pushd "$artdir" - dpkg-scanpackages . /dev/null | \ - gzip -9c > Packages.gz - popd - - exit 0 -elif [ -d /var/cache/pbuilder/ ]; then - mockroot=/var/cache/pbuilder/ - (if cd "$mockroot/result/"; then - cp ./*{.buildinfo,.changes,.deb,.dsc,.xz} "$artdir" - fi) - cp utils/rpms/_topdir/BUILD/*.orig.tar.* "$artdir" - pushd "$artdir" - dpkg-scanpackages . /dev/null | \ - gzip -9c > Packages.gz - popd - - exit 0 -fi - if [ -d /home/daos/rpms/ ]; then if [ -d /home/daos/rpms/deps ]; then mkdir -p "$artdir/deps" cp /home/daos/rpms/deps/*.rpm "${artdir}/deps" fi cp /home/daos/rpms/daos/*.rpm "${artdir}/daos" -else - mockroot="/var/lib/mock/${CHROOT_NAME}" - cat "$mockroot"/result/{root,build}.log 2>/dev/null || true - - if srpms="$(ls _topdir/SRPMS/*)"; then - cp -af "$srpms" "$artdir" - fi - (if cd "$mockroot/result/"; then - cp -r . "$artdir" - fi) fi createrepo "$artdir" diff --git a/ci/rpm/build_unsuccessful.sh b/ci/rpm/build_unsuccessful.sh deleted file mode 100755 index 04cf1e13655..00000000000 --- a/ci/rpm/build_unsuccessful.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Script to be run on unsuccessful RPM build - -set -uex - -mydir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" -ci_envs="$mydir/../parse_ci_envs.sh" -if [ -e "${ci_envs}" ]; then - # shellcheck source=parse_ci_envs.sh - source "${ci_envs}" -fi - -: "${CHROOT_NAME:=epel-7-x86_64}" -: "${TARGET:=centos7}" - -artdir="${PWD}/artifacts/${TARGET}" - -if [ -d /var/cache/pbuilder/ ]; then - mockroot=/var/cache/pbuilder/ - (if cd "$mockroot/result/"; then - cp -r . "$artdir" - fi) - exit 0 -fi - -rpm -q mock -mock --debug-config - -mockroot="/var/lib/mock/$CHROOT_NAME" -cat "$mockroot"/result/{root,build}.log 2>/dev/null || true - -if srpms="$(ls _topdir/SRPMS/*)"; then - cp -af "$srpms" "$artdir" -fi -(if cd "$mockroot/result/"; then - cp -r . "$artdir" -fi) - -if ls "$mockroot"/root/builddir/build/BUILD/daos-*/config.log; then - mv "$mockroot"/root/builddir/build/BUILD/daos-*/config.log \ - "${artdir}"/config.log-rpm -fi diff --git a/utils/rpms/Makefile b/utils/rpms/Makefile deleted file mode 100644 index bfb11d54456..00000000000 --- a/utils/rpms/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -NAME := daos -SRC_EXT := gz -SOURCE = $(NAME)-$(VERSION).tar.$(SRC_EXT) -TOPDIR := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))/../..) - -#https://github.com/rpm-software-management/mock/issues/384 -MOCK_OPTIONS += --disablerepo=sclo* - -DEBUG := $(shell set -x; id >&2; pwd >&2; ls -ld . ../.. >&2; git status >&2) -GIT_SHORT := $(shell git rev-parse --short=8 HEAD) -GIT_NUM_COMMITS := $(shell git rev-list HEAD --count) -ON_TAG := $(shell if git diff-index --name-only HEAD^ | grep -q TAG; then \ - echo "true"; else echo "false"; fi) -TOPDIR := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))/../..) - -PACKAGING_CHECK_DIR := ../../../rpm/packaging/ - -ifeq ($(ON_TAG),false) -BUILD_DEFINES := --define "relval .$(GIT_NUM_COMMITS).g$(GIT_SHORT)" -endif - -RPM_BUILD_OPTIONS := $(BUILD_DEFINES) $(BUILD_FLAGS) - -dist: $(SOURCES) - -include packaging/Makefile_packaging.mk - -PACKAGING_CHECK_DIR ?= ../../../rpm/packaging - -$(NAME)-$(VERSION).tar.gz: $(shell git ls-files :/:) - echo Creating $@ - echo $(basename $@) - cd ../../ && utils/rpms/archive.sh utils/rpms "$(NAME)" "$(VERSION)" tar - rm -f $@ - gzip $(basename $@) - -tarball: $(NAME)-$(VERSION).tar.gz diff --git a/utils/rpms/archive.sh b/utils/rpms/archive.sh deleted file mode 100755 index 3808094143f..00000000000 --- a/utils/rpms/archive.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# Usage: archive.sh -# -# Create an archive of the HEAD commit of a local Git repository, including -# submodules. -# -# - Must run at the root of the Git repository. -# - Must have all submodules recursively initialized and updated. -# - Whitespaces are prohibited in any of the parameters. -# -# For example, -# -# archive.sh /a/b/c daos 1.2.3 tar -# -# produces /a/b/c/daos-1.2.3.tar. -# - -set -e - -dir=$1 -name=$2 -version=$3 -ext=$4 - -# Use a temporary directory for all intermediate files. -unset tmp -trap 'if [ -n "${tmp}" ]; then rm -rf "${tmp}"; fi' EXIT -tmp=$(mktemp -d) - -file_extless="${name}-${version}" -file="${file_extless}.${ext}" -sm_file_prefix="${file_extless}-submodule" - -# Create an archive, which doesn't include any submodule. -git archive --prefix "${name}-${version}/" -o "${tmp}/${file}" HEAD - -# Add all submodules to the archive. -# shellcheck disable=SC2086,SC2016 -git submodule --quiet foreach --recursive \ - 'tarfile='${tmp}/${sm_file_prefix}'-${name//\//}.'${ext}' && \ - git archive --prefix '${name}-${version}'/$displaypath/ -o ${tarfile} $sha1 && \ - tar -Af '"${tmp}/${file}"' ${tarfile}' - -# Publish the archive. -mv "${tmp}/${file}" "${dir}/${file}" diff --git a/utils/rpms/packaging/Dockerfile.centos.7 b/utils/rpms/packaging/Dockerfile.centos.7 deleted file mode 100644 index 189ea1e4c61..00000000000 --- a/utils/rpms/packaging/Dockerfile.centos.7 +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright 2018-2022, Intel Corporation -# -# 'recipe' for Docker to build an RPM -# - -# Pull base image -FROM centos:centos7 -LABEL maintainer="daos@daos.groups.io" - -# Use local repo server if present -ARG REPO_FILE_URL -RUN set -e; \ - if [ -n "$REPO_FILE_URL" ]; then \ - cd /etc/yum.repos.d/ && \ - curl -k -f -o daos_ci-centos7-artifactory.repo.tmp \ - "$REPO_FILE_URL"daos_ci-centos7-artifactory.repo && \ - for file in *.repo; do \ - true > $file; \ - done; \ - mv daos_ci-centos7-artifactory.repo{.tmp,}; \ - fi; \ - yum -y install dnf; \ - yum clean all; \ - dnf --disablerepo \*epel\* -y install epel-release \ - dnf-plugins-core; \ - if [ -n "$REPO_FILE_URL" ]; then \ - dnf -y --quiet config-manager --disable epel; \ - fi; \ - dnf -y update epel-release; \ - dnf -y clean all - -# use same UID as host and default value of 1000 if not specified -ARG UID=1000 - -# Update distribution -#Nothing to do for CentOS - -# Install basic tools -RUN dnf install -y epel-release -RUN dnf install -y mock make rpm-build curl createrepo rpmlint redhat-lsb-core \ - git python-srpm-macros dnf && dnf -y clean all - -# Add build user (to keep rpmbuild happy) -ENV USER build -ENV PASSWD build -RUN useradd -u $UID -ms /bin/bash $USER -RUN echo "$USER:$PASSWD" | chpasswd -# add the user to the mock group so it can run mock -RUN usermod -a -G mock $USER - -# mock in Docker needs to use the old-chroot option -RUN grep use_nspawn /etc/mock/site-defaults.cfg || \ - echo "config_opts['use_nspawn'] = False" >> /etc/mock/site-defaults.cfg - -RUN chmod g+w /etc/mock/default.cfg diff --git a/utils/rpms/packaging/Dockerfile.coverity b/utils/rpms/packaging/Dockerfile.coverity deleted file mode 100755 index 3ba809bfdc6..00000000000 --- a/utils/rpms/packaging/Dockerfile.coverity +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright 2018-2020, Intel Corporation -# -# 'recipe' for Docker to build for a Coverity scan. -# - -# Pull base image -FROM fedora:latest -LABEL maintainer="daos-stack " - -# use same UID as host and default value of 1000 if not specified -ARG UID=1000 - -# Install basic tools -RUN dnf -y install mock make rpm-build curl createrepo rpmlint redhat-lsb-core \ - git python-srpm-macros rpmdevtools -RUN dnf -y makecache && dnf -y install gcc - -# Add build user (to keep rpmbuild happy) -ENV USER build -ENV PASSWD build -RUN useradd -u $UID -ms /bin/bash $USER -RUN echo "$USER:$PASSWD" | chpasswd -# add the user to the mock group so it can run mock -RUN usermod -a -G mock $USER - -# mock in Docker needs to use the old-chroot option -RUN grep use_nspawn || \ - echo "config_opts['use_nspawn'] = False" >> /etc/mock/site-defaults.cfg - -RUN chmod g+w /etc/mock/* - diff --git a/utils/rpms/packaging/Dockerfile.mockbuild b/utils/rpms/packaging/Dockerfile.mockbuild deleted file mode 100644 index 96621daabc3..00000000000 --- a/utils/rpms/packaging/Dockerfile.mockbuild +++ /dev/null @@ -1,78 +0,0 @@ -# -# Copyright 2018-2024 Intel Corporation -# Copyright 2025 Hewlett Packard Enterprise Development LP -# -# 'recipe' for Docker to build an RPM -# - -# Pull base image -ARG FVERSION=latest -FROM fedora:$FVERSION -# Needed for later use of FVERSION -ARG FVERSION -LABEL maintainer="daos@daos.groups.io" - -# Use local repo server if present -ARG REPO_FILE_URL -ARG DAOS_LAB_CA_FILE_URL -# script to install OS updates basic tools and daos dependencies -# COPY ./utils/scripts/install-fedora.sh /tmp/install.sh -# script to setup local repo if available -COPY ./utils/scripts/helpers/repo-helper-fedora.sh /tmp/repo-helper.sh - -RUN chmod +x /tmp/repo-helper.sh && \ - /tmp/repo-helper.sh && \ - rm -f /tmp/repo-helper.sh - -# Install basic tools -# The unset commands are currently needed for the combination of running -# with a local repository, yet needing a proxy to reach outside repositories. -# This needs to be moved to a shell script like above in the future to -# properly only remove the proxy variables only when they need to be removed -RUN dnf -y install mock make \ - rpm-build createrepo rpmlint git \ - python-srpm-macros rpmdevtools && \ - dnf -y clean all - -# use same UID as host and default value of 1000 if not specified -ARG UID=1000 - -# Add build user (to keep rpmbuild happy) -ENV USER build -ENV PASSWD build -RUN useradd -u $UID -ms /bin/bash $USER -RUN echo "$USER:$PASSWD" | chpasswd -# add the user to the mock group so it can run mock -RUN usermod -a -G mock $USER -RUN mkdir -p /var/cache/mock && chown $USER:root /var/cache/mock - -ARG CB0 -RUN dnf -y upgrade && \ - dnf clean all - -# Monkey-patch rpmlint until a new release is made with -# https://github.com/rpm-software-management/rpmlint/pull/795 in it -# But make sure to patch after dnf upgrade so that an upgraded rpmlint -# RPM doesn't wipe out our patch -# Ditto for the patch to zero and display ccache stats -# https://github.com/rpm-software-management/mock/pull/1299 -ARG PACKAGINGDIR=./utils/rpms/packaging -COPY ${PACKAGINGDIR}/*.patch ./ -RUN (cd $(python3 -c 'import site; print(site.getsitepackages()[-1])') && \ - if ! grep -e --ignore-unused-rpmlintrc rpmlint/cli.py; then \ - if ! patch -p1 < $OLDPWD/rpmlint--ignore-unused-rpmlintrc.patch; then \ - exit 1; \ - fi; \ - rm -f rpmlint/__pycache__/{cli,lint}.*.pyc; \ - fi; \ - if ! grep _ccachePostBuildHook mockbuild/plugins/ccache.py; then \ - if ! patch -p3 < $OLDPWD/ccache-stats.patch; then \ - exit 1; \ - fi; \ - rm -f mockbuild/plugins/__pycache__/ccache.*.pyc; \ - fi); \ - rm -f rpmlint--ignore-unused-rpmlintrc.patch ccache-stats.patch - -# show the release that was built -ARG CACHEBUST -RUN cat /etc/os-release diff --git a/utils/rpms/packaging/Dockerfile.ubuntu b/utils/rpms/packaging/Dockerfile.ubuntu deleted file mode 100644 index 2cac9040e74..00000000000 --- a/utils/rpms/packaging/Dockerfile.ubuntu +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright 2019-2021, Intel Corporation -# Copyright 2025-2026 Hewlett Packard Enterprise Development LP -# -# 'recipe' for Docker to build an Debian package -# -# Pull base image -ARG BASE_DISTRO=ubuntu:20.04 -FROM $BASE_DISTRO -LABEL org.opencontainers.image.authors="daos@daos.groups.io" -# Needed for later use of BASE_DISTRO -ARG BASE_DISTRO - -ARG REPO_FILE_URL -ARG DAOS_LAB_CA_FILE_URL -# script to setup local repo if available -COPY ./utils/scripts/helpers/repo-helper-ubuntu.sh /tmp/repo-helper.sh - -RUN chmod +x /tmp/repo-helper.sh && \ - /tmp/repo-helper.sh \ - rm -f /tmp/repo-helper.sh - -# Install basic tools -ARG PYTHON_VERSION=3 -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - autoconf bash ca-certificates curl debhelper dh-make \ - dpkg-dev dh-python doxygen gcc git git-buildpackage \ - javahelper locales make patch pbuilder pkg-config \ - python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-distro \ - python${PYTHON_VERSION}-distutils rpm scons wget \ - cmake valgrind rpmdevtools - -# use same UID as host and default value of 1000 if not specified -ARG UID 1000 - -# Add build user (to keep chrootbuild happy) -ENV USER=build -RUN useradd -u $UID -ms /bin/bash $USER - -# need to run the build command as root, as it needs to chroot -RUN if ! grep "^#includedir /etc/sudoers.d" /etc/sudoers; then \ - echo "#includedir /etc/sudoers.d" >> /etc/sudoers; \ - fi; \ - echo "Defaults env_keep += \"DPKG_GENSYMBOLS_CHECK_LEVEL\"" > /etc/sudoers.d/build; \ - echo "build ALL=(ALL) NOPASSWD: /usr/bin/tee /root/.pbuilderrc" >> /etc/sudoers.d/build; \ - echo "build ALL=(ALL) NOPASSWD: /usr/sbin/pbuilder" >> /etc/sudoers.d/build; \ - chmod 0440 /etc/sudoers.d/build; \ - visudo -c; \ - sudo -l -U build diff --git a/utils/rpms/packaging/Makefile_distro_vars.mk b/utils/rpms/packaging/Makefile_distro_vars.mk deleted file mode 100644 index 79ae211e895..00000000000 --- a/utils/rpms/packaging/Makefile_distro_vars.mk +++ /dev/null @@ -1,161 +0,0 @@ -DOT := . - -DOCKER := docker - -# Find out what we are -ID_LIKE := $(shell . /etc/os-release; echo $$ID_LIKE) -# Of course that does not work for SLES-12 -ID := $(shell . /etc/os-release; echo $$ID) -VERSION_ID := $(shell . /etc/os-release; echo $$VERSION_ID) -VERSION_CODENAME := $(shell . /etc/os-release; echo $$VERSION_CODENAME) - -ifeq ($(ID_LIKE),debian) -SPECTOOL := spectool -UBUNTU_VERS := $(shell . /etc/os-release; echo $$VERSION) -DISTRO_ID_OPT := --distribution $(VERSION_CODENAME) -DISTRO_ID := ubuntu$(VERSION_ID) -VERSION_ID_STR := $(subst $(DOT),_,$(VERSION_ID)) -DISTRO_BASE := UBUNTU_$(VERSION_ID_STR) -endif -ifeq ($(ID),fedora) -DOCKER := podman -SPECTOOL := spectool -# a Fedora-based mock builder -# derive the the values of: -# VERSION_ID (i.e. 7) -# DISTRO_ID (i.e. el7) -# DISTRO_BASE (i.e. EL_7) -# from the CHROOT_NAME -ifeq ($(patsubst %epel-7-x86_64,,$(lastword $(subst +, ,$(CHROOT_NAME)))),) -DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist}) -VERSION_ID := 7 -DISTRO_ID := el7 -DISTRO_BASE := EL_7 -DISTRO_VERSION ?= $(VERSION_ID) -ORIG_TARGET_VER := 7 -SED_EXPR := 1s/$(DIST)//p -endif -ifeq ($(patsubst %epel-8-x86_64,,$(lastword $(subst +, ,$(CHROOT_NAME)))),) -DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist}) -VERSION_ID := 8 -DISTRO_ID := el8 -DISTRO_BASE := EL_8 -ifneq ($(DISTRO_VERSION_EL8),) -override DISTRO_VERSION := $(DISTRO_VERSION_EL8) -endif -DISTRO_VERSION ?= $(VERSION_ID) -ORIG_TARGET_VER := 8 -SED_EXPR := 1s/$(DIST)//p -endif -ifeq ($(patsubst %epel-9-x86_64,,$(lastword $(subst +, ,$(CHROOT_NAME)))),) -DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist}) -VERSION_ID := 9 -DISTRO_ID := el9 -DISTRO_BASE := EL_9 -ifneq ($(DISTRO_VERSION_EL9),) -override DISTRO_VERSION := $(DISTRO_VERSION_EL9) -endif -DISTRO_VERSION ?= $(VERSION_ID) -ORIG_TARGET_VER := 9 -SED_EXPR := 1s/$(DIST)//p -endif -ifeq ($(CHROOT_NAME),opensuse-leap-15.2-x86_64) -VERSION_ID := 15.2 -DISTRO_ID := sl15.2 -DISTRO_BASE := LEAP_15 -DISTRO_VERSION ?= $(VERSION_ID) -ORIG_TARGET_VER := 15.2 -SED_EXPR := 1p -endif -ifeq ($(CHROOT_NAME),opensuse-leap-15.3-x86_64) -VERSION_ID := 15.3 -DISTRO_ID := sl15.3 -DISTRO_BASE := LEAP_15 -DISTRO_VERSION ?= $(VERSION_ID) -ORIG_TARGET_VER := 15.3 -SED_EXPR := 1p -endif -ifeq ($(CHROOT_NAME),opensuse-leap-15.4-x86_64) -VERSION_ID := 15.4 -DISTRO_ID := sl15.4 -DISTRO_BASE := LEAP_15 -DISTRO_VERSION ?= $(VERSION_ID) -ORIG_TARGET_VER := 15.4 -SED_EXPR := 1p -endif -ifeq ($(CHROOT_NAME),opensuse-leap-15.5-x86_64) -VERSION_ID := 15.5 -DISTRO_ID := sl15.5 -DISTRO_BASE := LEAP_15 -DISTRO_VERSION ?= $(VERSION_ID) -ORIG_TARGET_VER := 15.5 -SED_EXPR := 1p -endif -ifeq ($(CHROOT_NAME),opensuse-leap-15.6-x86_64) -VERSION_ID := 15.6 -DISTRO_ID := sl15.6 -DISTRO_BASE := LEAP_15 -DISTRO_VERSION ?= $(VERSION_ID) -ORIG_TARGET_VER := 15.6 -SED_EXPR := 1p -endif -endif -ifeq ($(ID),centos) -ID = el -endif -ifeq ($(ID),rocky) -ID = el -endif -ifeq ($(ID),almalinux) -ID = el -endif -ifeq ($(ID),rhel) -ID = el -endif -ifeq ($(ID),el) -DISTRO_ID := el$(VERSION_ID) -DISTRO_BASE := $(basename EL_$(VERSION_ID)) -DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist}) -SED_EXPR := 1s/$(DIST)//p -SPECTOOL := spectool -define install_repo - if yum-config-manager --add-repo=$(1); then \ - repo_file=$$(ls -tar /etc/yum.repos.d/*.repo | tail -1); \ - sed -i -e 1d -e '$$s/^/gpgcheck=False/' $$repo_file; \ - else \ - exit 1; \ - fi -endef -endif -ifeq ($(findstring opensuse,$(ID)),opensuse) -ID_LIKE := suse -DISTRO_ID := sl$(VERSION_ID) -DISTRO_BASE := $(basename LEAP_$(VERSION_ID)) -endif -ifeq ($(ID),sles) -# SLES-12 or 15 detected. -ID_LIKE := suse -DISTRO_ID := sle$(VERSION_ID) -DISTRO_BASE := $(basename SLES_$(VERSION_ID)) -endif -ifeq ($(ID_LIKE),suse) -SPECTOOL := rpmdev-spectool -define install_repo - zypper --non-interactive ar $(1) -endef -endif -ifeq ($(ID_LIKE),debian) -ifndef LANG -export LANG = C.UTF-8 -endif -ifndef LC_ALL -export LC_ALL = C.UTF-8 -endif -else -ifndef LANG -export LANG = C.utf8 -endif -ifndef LC_ALL -export LC_ALL = C.utf8 -endif -endif diff --git a/utils/rpms/packaging/Makefile_packaging.mk b/utils/rpms/packaging/Makefile_packaging.mk deleted file mode 100644 index d356f0df78f..00000000000 --- a/utils/rpms/packaging/Makefile_packaging.mk +++ /dev/null @@ -1,516 +0,0 @@ -# Common Makefile for including -# Needs the following variables set at a minimum: -# NAME := -# SRC_EXT := - -# force bash (looking at you Ubuntu) -SHELL=/bin/bash - -# Put site overrides (i.e. DAOS_STACK_*_LOCAL_REPO) in here --include Makefile.local - -# default to Leap 15 distro for chrootbuild -CHROOT_NAME ?= opensuse-leap-15.3-x86_64 -include packaging/Makefile_distro_vars.mk - -ifeq ($(DEB_NAME),) -DEB_NAME := $(NAME) -endif - -CALLING_MAKEFILE := $(word 1, $(MAKEFILE_LIST)) - -# this Makefile should always be executed from it's own dir -TOPDIR ?= $(abspath $(dir $(firstword $(MAKEFILE_LIST)))) - -BUILD_PREFIX ?= . - -DOT := . -RPM_BUILD_OPTIONS += $(EXTERNAL_RPM_BUILD_OPTIONS) - -# some defaults the caller can override -PACKAGING_CHECK_DIR ?= ../packaging -LOCAL_REPOS ?= true -TEST_PACKAGES ?= ${NAME} - -# unfortunately we cannot always name the repo the same as the project -REPO_NAME ?= $(NAME) - -ifneq ($(CI_PR_REPOS),) -PR_REPOS ?= $(CI_PR_REPOS) -else -PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-repos: *\(.*\)/\1/p') -endif -LEAP_15_PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-repos-leap15: *\(.*\)/\1/p') -EL_7_PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-repos-el7: *\(.*\)/\1/p') -EL_8_PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-repos-el8: *\(.*\)/\1/p') -EL_9_PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-repos-el9: *\(.*\)/\1/p') -UBUNTU_20_04_PR_REPOS ?= $(shell git show -s --format=%B | sed -ne 's/^PR-repos-ubuntu20: *\(.*\)/\1/p') -REPO_FILES_PR ?= $(shell git show -s --format=%B | sed -ne 's/^Repo-files-PR: *\(.*\)/\1/p') - -ifneq ($(PKG_GIT_COMMIT),) -ifeq ($(GITHUB_PROJECT),) -ifeq ($(GIT_PROJECT),) -$(error You must set either GITHUB_PROJECT or GIT_PROJECT if you set PKG_GIT_COMMIT) -endif -endif -BUILD_DEFINES := --define "commit $(PKG_GIT_COMMIT)" -RPM_BUILD_OPTIONS := $(BUILD_DEFINES) -GIT_DIFF_EXCLUDES := $(PATCH_EXCLUDE_FILES:%=':!%') -endif - -FVERSION ?= latest -COMMON_RPM_ARGS := --define "_topdir $$PWD/_topdir" $(BUILD_DEFINES) -SPEC := $(shell if [ -f $(NAME)-$(DISTRO_BASE).spec ]; then echo $(NAME)-$(DISTRO_BASE).spec; else echo $(NAME).spec; fi) -VERSION = $(eval VERSION := $(shell rpm $(COMMON_RPM_ARGS) --specfile --qf '%{version}\n' $(SPEC) | sed -n '1p'))$(VERSION) -DEB_RVERS := $(subst $(DOT),\$(DOT),$(VERSION)) -DEB_BVERS := $(basename $(subst ~rc,$(DOT)rc,$(VERSION))) -RELEASE = $(eval RELEASE := $(shell rpm $(COMMON_RPM_ARGS) --specfile --qf '%{release}\n' $(SPEC) | sed -n '$(SED_EXPR)'))$(RELEASE) -SRPM = _topdir/SRPMS/$(NAME)-$(VERSION)-$(RELEASE)$(DIST).src.rpm -RPMS = $(eval RPMS := $(addsuffix .rpm,$(addprefix _topdir/RPMS/x86_64/,$(shell rpm --specfile $(SPEC)))))$(RPMS) -DEB_TOP := _topdir/BUILD -DEB_BUILD := $(DEB_TOP)/$(NAME)-$(VERSION) -DEB_TARBASE := $(DEB_TOP)/$(DEB_NAME)_$(VERSION) -REAL_SOURCE ?= $(eval REAL_SOURCE := $(shell CHROOT_NAME=$(CHROOT_NAME) $(SPECTOOL) $(COMMON_RPM_ARGS) -S -l $(SPEC) | sed -e 2,\$$d -e 's/\#/\\\#/g' -e 's/Source.*: *//'))$(REAL_SOURCE) -ifeq ($(ID_LIKE),debian) -ifneq ($(DEB_SOURCE),) -SOURCE ?= $(DEB_SOURCE) -endif -endif -SOURCE ?= $(REAL_SOURCE) -PATCHES ?= $(eval PATCHES := $(shell CHROOT_NAME=$(CHROOT_NAME) $(SPECTOOL) $(COMMON_RPM_ARGS) -l $(SPEC) | sed -ne 1d -e '/already present/d' -e 's/.*: *//' -e 's/.*\///' -e '/\.patch/p'))$(PATCHES) -OTHER_SOURCES := $(eval OTHER_SOURCES := $(shell CHROOT_NAME=$(CHROOT_NAME) $(SPECTOOL) $(COMMON_RPM_ARGS) -l $(SPEC) | sed -ne 1d -e '/already present/d' -e '/^Patch.*:/d' -e 's/Source.*: *//' -e 's/.*\///' -e p))$(OTHER_SOURCES) -SOURCES := $(addprefix _topdir/SOURCES/,$(notdir $(SOURCE) $(OTHER_SOURCES)) $(PATCHES)) -ifeq ($(ID_LIKE),debian) -DEBS := $(addsuffix _$(VERSION)-1_amd64.deb,$(shell sed -n '/-udeb/b; s,^Package:[[:blank:]],$(DEB_TOP)/,p' $(TOPDIR)/debian/control)) -DEB_PREV_RELEASE := $(shell cd $(TOPDIR) && dpkg-parsechangelog -S version) -ifneq ($(GIT_SHORT),) -GIT_INFO ?= .$(GIT_NUM_COMMITS).g$(GIT_SHORT) -endif -DEB_DSC := $(DEB_NAME)_$(DEB_PREV_RELEASE)$(GIT_INFO).dsc -TARGETS := $(DEBS) -else -TARGETS := $(RPMS) $(SRPM) -endif - -define distro_map - case $(DISTRO_ID) in \ - el7) distro="centos7" \ - ;; \ - el*) distro="$(DISTRO_ID)" \ - ;; \ - sle12.3) distro="sles12.3" \ - ;; \ - sl42.3) distro="leap42.3" \ - ;; \ - sl15.*) distro="leap15" \ - ;; \ - ubuntu*) distro="$(DISTRO_ID)" \ - ;; \ - esac; -endef - -define install_repos - if [ "$(ID_LIKE)" = "debian" ]; then \ - IFS='|' read -ra BASES <<< "$($(DISTRO_BASE)_LOCAL_REPOS)"; \ - for baseurl in "$${BASES[@]}"; do \ - baseurl="$${baseurl# *}"; \ - $(call install_repo,$$baseurl) \ - done; \ - fi - for repo in $($(DISTRO_BASE)_PR_REPOS) \ - $(PR_REPOS) $(1); do \ - branch="master"; \ - build_number="lastSuccessfulBuild"; \ - if [[ $$repo = *@* ]]; then \ - branch="$${repo#*@}"; \ - repo="$${repo%@*}"; \ - if [[ $$branch = *:* ]]; then \ - build_number="$${branch#*:}"; \ - branch="$${branch%:*}"; \ - fi; \ - fi; \ - $(call distro_map) \ - baseurl=$${JENKINS_URL:-https://jenkins-3.daos.hpc.amslabs.hpecorp.net/}job/daos-stack/job/$$repo/job/$$branch/; \ - baseurl+=$$build_number/artifact/artifacts/$$distro/; \ - $(call install_repo,$$baseurl) \ - done -endef - -all: $(TARGETS) - -%/: - mkdir -p $@ - -%.gz: % - rm -f $@ - gzip $< - -%.bz2: % - rm -f $@ - bzip2 $< - -%.xz: % - rm -f $@ - xz -z $< - -_topdir/SOURCES/%: % | _topdir/SOURCES/ - rm -f $@ - ln $< $@ - -# At least one spec file, SLURM (sles), has a different version for the -# download file than the version in the spec file. -ifeq ($(DL_VERSION),) -DL_VERSION = $(subst ~,,$(VERSION)) -endif -ifeq ($(DL_NAME),) -DL_NAME = $(NAME) -endif - -$(notdir $(SOURCE) $(OTHER_SOURCES) $(REAL_SOURCE)): $(SPEC) $(CALLING_MAKEFILE) - # TODO: need to clean up old ones - $(SPECTOOL) $(COMMON_RPM_ARGS) -g $(SPEC) - -$(DEB_TOP)/%: % | $(DEB_TOP)/ - -$(DEB_BUILD)/%: % | $(DEB_BUILD)/ - -$(DEB_BUILD).tar.$(SRC_EXT): $(notdir $(SOURCE)) | $(DEB_TOP)/ - ln -f $< $@ - -$(DEB_TARBASE).orig.tar.$(SRC_EXT): $(DEB_BUILD).tar.$(SRC_EXT) - rm -f $(DEB_TOP)/*.orig.tar.* - ln -f $< $@ - -deb_detar: $(notdir $(SOURCE)) $(DEB_TARBASE).orig.tar.$(SRC_EXT) - # Unpack tarball - rm -rf ./$(DEB_TOP)/.patched ./$(DEB_TOP)/.detar - rm -rf ./$(DEB_BUILD)/* ./$(DEB_BUILD)/.pc ./$(DEB_BUILD)/.libs - mkdir -p $(DEB_BUILD) - tar -C $(DEB_BUILD) --strip-components=1 -xpf $< - -# Extract patches for Debian -$(DEB_TOP)/.patched: $(PATCHES) check-env deb_detar | \ - $(DEB_BUILD)/debian/ - mkdir -p ${DEB_BUILD}/debian/patches - mkdir -p $(DEB_TOP)/patches - for f in $(PATCHES); do \ - rm -f $(DEB_TOP)/patches/*; \ - if git mailsplit -o$(DEB_TOP)/patches < "$$f"; then \ - fn=$$(basename "$$f"); \ - for f1 in $(DEB_TOP)/patches/*;do \ - [ -e "$$f1" ] || continue; \ - f1n=$$(basename "$$f1"); \ - echo "$${fn}_$${f1n}" >> $(DEB_BUILD)/debian/patches/series; \ - mv "$$f1" $(DEB_BUILD)/debian/patches/$${fn}_$${f1n}; \ - done; \ - else \ - fb=$$(basename "$$f"); \ - cp "$$f" $(DEB_BUILD)/debian/patches/; \ - echo "$$fb" >> $(DEB_BUILD)/debian/patches/series; \ - if ! grep -q "^Description:\|^Subject:" "$$f"; then \ - sed -i '1 iSubject: Auto added patch' \ - "$(DEB_BUILD)/debian/patches/$$fb"; \ - fi; \ - if ! grep -q "^Origin:\|^Author:\|^From:" "$$f"; then \ - sed -i '1 iOrigin: other' \ - "$(DEB_BUILD)/debian/patches/$$fb"; \ - fi; \ - fi; \ - done - touch $@ - - -# Move the debian files into the Debian directory. -ifeq ($(ID_LIKE),debian) -$(DEB_TOP)/.deb_files: $(shell find $(TOPDIR)/debian -type f) deb_detar | \ - $(DEB_BUILD)/debian/ - cd $(TOPDIR)/ && \ - find debian -maxdepth 1 -type f -exec cp '{}' '$(BUILD_PREFIX)/$(DEB_BUILD)/{}' ';' - if [ -e $(TOPDIR)/debian/source ]; then \ - cp -r $(TOPDIR)/debian/source $(DEB_BUILD)/debian; fi - if [ -e $(TOPDIR)/debian/local ]; then \ - cp -r $(TOPDIR)/debian/local $(DEB_BUILD)/debian; fi - if [ -e $(TOPDIR)/debian/examples ]; then \ - cp -r $(TOPDIR)/debian/examples $(DEB_BUILD)/debian; fi - if [ -e $(TOPDIR)/debian/upstream ]; then \ - cp -r $(TOPDIR)/debian/upstream $(DEB_BUILD)/debian; fi - if [ -e $(TOPDIR)/debian/tests ]; then \ - cp -r $(TOPDIR)/debian/tests $(DEB_BUILD)/debian; fi - rm -f $(DEB_BUILD)/debian/*.ex $(DEB_BUILD)/debian/*.EX - rm -f $(DEB_BUILD)/debian/*.orig -ifneq ($(GIT_INFO),) - cd $(DEB_BUILD); dch --distribution unstable \ - --newversion $(DEB_PREV_RELEASE)$(GIT_INFO) \ - "Git commit information" -endif - touch $@ -endif - -# see https://stackoverflow.com/questions/2973445/ for why we subst -# the "rpm" for "%" to effectively turn this into a multiple matching -# target pattern rule -$(subst rpm,%,$(RPMS)): $(SPEC) $(SOURCES) - rpmbuild -bb $(COMMON_RPM_ARGS) $(RPM_BUILD_OPTIONS) $(SPEC) - -$(subst deb,%,$(DEBS)): $(DEB_BUILD).tar.$(SRC_EXT) \ - deb_detar $(DEB_TOP)/.deb_files $(DEB_TOP)/.patched - rm -f $(DEB_TOP)/*.deb $(DEB_TOP)/*.ddeb $(DEB_TOP)/*.dsc \ - $(DEB_TOP)/*.dsc $(DEB_TOP)/*.build* $(DEB_TOP)/*.changes \ - $(DEB_TOP)/*.debian.tar.* - rm -rf $(DEB_TOP)/*-tmp - cd $(DEB_BUILD); debuild --no-lintian -b -us -uc - cd $(DEB_BUILD); debuild -- clean - git status - rm -rf $(DEB_TOP)/$(NAME)-tmp - lfile1=$(shell echo $(DEB_TOP)/$(NAME)[0-9]*_$(VERSION)-1_amd64.deb);\ - lfile=$$(ls $${lfile1}); \ - lfile2=$${lfile##*/}; lname=$${lfile2%%_*}; \ - dpkg-deb -R $${lfile} \ - $(DEB_TOP)/$(NAME)-tmp; \ - if [ -e $(DEB_TOP)/$(NAME)-tmp/DEBIAN/symbols ]; then \ - sed 's/$(DEB_RVERS)-1/$(DEB_BVERS)/' \ - $(DEB_TOP)/$(NAME)-tmp/DEBIAN/symbols \ - > $(DEB_BUILD)/debian/$${lname}.symbols; fi - cd $(DEB_BUILD); debuild -us -uc - rm $(DEB_BUILD).tar.$(SRC_EXT) - for f in $(DEB_TOP)/*.deb; do \ - echo $$f; dpkg -c $$f; done - -$(DEB_TOP)/$(DEB_DSC): $(CALLING_MAKEFILE) $(DEB_BUILD).tar.$(SRC_EXT) \ - deb_detar $(DEB_TOP)/.deb_files $(DEB_TOP)/.patched - rm -f $(DEB_TOP)/*.deb $(DEB_TOP)/*.ddeb $(DEB_TOP)/*.dsc \ - $(DEB_TOP)/*.dsc $(DEB_TOP)/*.build* $(DEB_TOP)/*.changes \ - $(DEB_TOP)/*.debian.tar.* - rm -rf $(DEB_TOP)/*-tmp - cd $(DEB_BUILD); dpkg-buildpackage -S --no-sign --no-check-builddeps - -$(SRPM): $(SPEC) $(SOURCES) - if [ -f bz-1955184_find-requires ]; then \ - chmod 755 bz-1955184_find-requires; \ - fi - rpmbuild -bs $(COMMON_RPM_ARGS) $(RPM_BUILD_OPTIONS) $(SPEC) - -srpm: $(SRPM) - -$(RPMS): $(SRPM) $(CALLING_MAKEFILE) - -rpms: $(RPMS) - -repo: rpms - rm -rf _topdir/RPMS/repodata/ - createrepo _topdir/RPMS/ - -$(DEBS): $(CALLING_MAKEFILE) - -debs: $(DEBS) - -ls: $(TARGETS) - ls -ld $^ - -ifneq ($(PKG_GIT_COMMIT),) -# This not really intended to run in CI. It's meant as a developer -# convenience to generate the needed patch and add it to the repo to -# be committed. -$(VERSION)..$(PKG_GIT_COMMIT).patch: -ifneq ($(GITHUB_PROJECT),) - # it really sucks that GitHub's "compare" returns such dirty patches - #curl -O 'https://github.com/$(GITHUB_PROJECT)/compare/$@' - git clone https://github.com/$(GITHUB_PROJECT).git -else - git clone $(GIT_PROJECT) -endif - set -x; pushd $(NAME) && \ - trap 'popd && rm -rf $(NAME)' EXIT; \ - echo git diff $(VERSION)..$(PKG_GIT_COMMIT) --stat -- \ - $(GIT_DIFF_EXCLUDES ); \ - git diff $(VERSION)..$(PKG_GIT_COMMIT) -- \ - $(GIT_DIFF_EXCLUDES) > ../$@; \ - popd; \ - trap 'rm -rf $(NAME)' EXIT; \ - git add $@ -patch: $(VERSION)..$(PKG_GIT_COMMIT).patch -else -patch: - echo "PKG_GIT_COMMIT is not defined" -endif - -ifeq ($(ID_LIKE),debian) -chrootbuild: $(DEB_TOP)/$(DEB_DSC) - $(call distro_map) \ - DISTRO="$$distro" \ - PR_REPOS="$(PR_REPOS)" \ - REPO_FILES_PR="$(REPO_FILES_PR)" \ - DISTRO_BASE_PR_REPOS="$($(DISTRO_BASE)_PR_REPOS)" \ - JENKINS_URL="$${JENKINS_URL}" \ - JOB_REPOS="$(JOB_REPOS)" \ - REPO_FILE_URL="$(REPO_FILE_URL)" \ - DISTRO_BASE_LOCAL_REPOS="$($(DISTRO_BASE)_LOCAL_REPOS)" \ - VERSION_CODENAME="$(VERSION_CODENAME)" \ - DEB_TOP="$(DEB_TOP)" \ - DEB_DSC="$(DEB_DSC)" \ - DISTRO_ID_OPT="$(DISTRO_ID_OPT)" \ - LOCAL_REPOS='$(LOCAL_REPOS)' \ - ARTIFACTORY_URL="$(ARTIFACTORY_URL)" \ - packaging/debian_chrootbuild -else -chrootbuild: $(SRPM) $(CALLING_MAKEFILE) - $(call distro_map) \ - DISTRO="$$distro" \ - CHROOT_NAME="$(CHROOT_NAME)" \ - PR_REPOS="$(PR_REPOS)" \ - REPO_FILES_PR="$(REPO_FILES_PR)" \ - DISTRO_BASE_PR_REPOS="$($(DISTRO_BASE)_PR_REPOS)" \ - JENKINS_URL="$${JENKINS_URL}" \ - JOB_REPOS="$(JOB_REPOS)" \ - REPO_FILE_URL="$(REPO_FILE_URL)" \ - MOCK_OPTIONS="$(MOCK_OPTIONS)" \ - RPM_BUILD_OPTIONS='$(RPM_BUILD_OPTIONS)' \ - LOCAL_REPOS='$(LOCAL_REPOS)' \ - ARTIFACTORY_URL="$(ARTIFACTORY_URL)" \ - DISTRO_VERSION="$(DISTRO_VERSION)" \ - PACKAGE="$(NAME)" \ - TARGET="$<" \ - packaging/rpm_chrootbuild -endif - -podman_chrootbuild: - if ! podman build --build-arg REPO_FILE_URL=$(REPO_FILE_URL) \ - --build-arg FVERSION=$(FVERSION) \ - -t $(subst +,-,$(CHROOT_NAME))-chrootbuild \ - -f packaging/Dockerfile.mockbuild .; then \ - echo "Container build failed"; \ - exit 1; \ - fi - rm -f /var/lib/mock/$(CHROOT_NAME)/result/{root,build}.log - if ! podman run --rm --privileged -w $(TOPDIR) -v=$(TOPDIR)/..:$(TOPDIR)/.. \ - -it $(subst +,-,$(CHROOT_NAME))-chrootbuild \ - bash -c 'if ! DISTRO_REPOS=false \ - REPO_FILE_URL=$(REPO_FILE_URL) \ - make REPO_FILES_PR=$(REPO_FILES_PR) \ - MOCK_OPTIONS=$(MOCK_OPTIONS) \ - CHROOT_NAME=$(CHROOT_NAME) -C $(CURDIR) chrootbuild; then \ - cat /var/lib/mock/$(CHROOT_NAME)/{result/{root,build},root/builddir/build/BUILD/*/config}.log; \ - exit 1; \ - fi; \ - rpmlint $$(ls /var/lib/mock/$(CHROOT_NAME)/result/*.rpm | \ - grep -v -e debuginfo -e debugsource -e src.rpm)'; then \ - exit 1; \ - fi - -docker_chrootbuild: - if ! $(DOCKER) build --build-arg UID=$$(id -u) -t chrootbuild \ - --build-arg REPO_FILE_URL=$(REPO_FILE_URL) \ - -f packaging/Dockerfile.mockbuild .; then \ - echo "Container build failed"; \ - exit 1; \ - fi - rm -f /var/lib/mock/$(CHROOT_NAME)/result/{root,build}.log - if ! $(DOCKER) run --user=$$(id -u) --privileged=true -w $(TOPDIR) \ - -v=$(TOPDIR):$(TOPDIR) \ - -it chrootbuild bash -c "make -C $(CURDIR) \ - CHROOT_NAME=$(CHROOT_NAME) chrootbuild"; then \ - cat /var/lib/mock/$(CHROOT_NAME)/result/{root,build}.log; \ - exit 1; \ - fi - -rpmlint: $(SPEC) - rpmlint --ignore-unused-rpmlintrc $< - -packaging_check: - if grep -e --repo $(CALLING_MAKEFILE); then \ - echo "SUSE repos in $(CALLING_MAKEFILE) don't need a \"--repo\" any more"; \ - exit 2; \ - fi - if ! diff --exclude \*.sw? \ - --exclude debian \ - --exclude .git \ - --exclude Jenkinsfile \ - --exclude libfabric.spec \ - --exclude Makefile \ - --exclude README.md \ - --exclude SECURITY.md \ - --exclude LICENSE \ - --exclude _topdir \ - --exclude \*.tar.\* \ - --exclude \*.code-workspace \ - --exclude install \ - --exclude packaging \ - --exclude utils \ - --exclude .vscode \ - -bur $(PACKAGING_CHECK_DIR)/ packaging/; then \ - exit 1; \ - fi - -check-env: -ifndef DEBEMAIL - $(error DEBEMAIL is undefined) -endif -ifndef DEBFULLNAME - $(error DEBFULLNAME is undefined) -endif - -test: - # Test the rpmbuild by installing the built RPM - $(call install_repos,$(REPO_NAME)@$(BRANCH_NAME):$(BUILD_NUMBER)) - dnf -y install $(TEST_PACKAGES) - -show_NAME: - @echo '$(NAME)' - -show_DISTRO_ID: - @echo '$(DISTRO_ID)' - -show_distro_map: - @$(call distro_map) echo "$$distro" - -show_spec: - @echo '$(SPEC)' - -show_build_defines: - @echo '$(BUILD_DEFINES)' - -show_common_rpm_args: - @echo '$(COMMON_RPM_ARGS)' - -show_version: - @echo '$(VERSION)' - -show_dl_version: - @echo '$(DL_VERSION)' - -show_release: - @echo '$(RELEASE)' - -show_rpms: - @echo '$(RPMS)' - -show_source: - @echo '$(SOURCE)' - -show_real_source: - @echo '$(REAL_SOURCE)' - -show_patches: - @echo '$(PATCHES)' - -show_sources: - @echo '$(SOURCES)' - -show_other_sources: - @echo '$(OTHER_SOURCES)' - -show_targets: - @echo '$(TARGETS)' - -show_makefiles: - @echo '$(MAKEFILE_LIST)' - -show_calling_makefile: - @echo '$(CALLING_MAKEFILE)' - -show_git_metadata: - @echo '$(GIT_SHA1):$(GIT_SHORT):$(GIT_NUM_COMMITS)' - -.PHONY: srpm rpms debs deb_detar ls chrootbuild rpmlint FORCE \ - show_version show_release show_rpms show_source show_sources \ - show_targets check-env show_git_metadata diff --git a/utils/rpms/packaging/ccache-stats.patch b/utils/rpms/packaging/ccache-stats.patch deleted file mode 100644 index 26d5eeb7726..00000000000 --- a/utils/rpms/packaging/ccache-stats.patch +++ /dev/null @@ -1,66 +0,0 @@ -From e87d916d7f49ea4949973adf0f09e9e5bf891e03 Mon Sep 17 00:00:00 2001 -From: "Brian J. Murrell" -Date: Tue, 30 Jan 2024 11:03:12 -0500 -Subject: [PATCH 1/2] Show ccache stats at the end of the build - -Zero the ccache stats at the beginning of the build and then display the -ccache stats at the end of the build to see how effective ccache was. - -Signed-off-by: Brian J. Murrell ---- - mock/py/mockbuild/plugins/ccache.py | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/mock/py/mockbuild/plugins/ccache.py b/mock/py/mockbuild/plugins/ccache.py -index 2666ad9fc..1080ffe68 100644 ---- a/mock/py/mockbuild/plugins/ccache.py -+++ b/mock/py/mockbuild/plugins/ccache.py -@@ -35,6 +35,7 @@ def __init__(self, plugins, conf, buildroot): - buildroot.preexisting_deps.append("ccache") - plugins.add_hook("prebuild", self._ccacheBuildHook) - plugins.add_hook("preinit", self._ccachePreInitHook) -+ plugins.add_hook("postbuild", self._ccachePostBuildHook) - buildroot.mounts.add( - BindMountPoint(srcpath=self.ccachePath, bindpath=buildroot.make_chroot_path("/var/tmp/ccache"))) - -@@ -47,6 +48,9 @@ def __init__(self, plugins, conf, buildroot): - @traceLog() - def _ccacheBuildHook(self): - self.buildroot.doChroot(["ccache", "-M", str(self.ccache_opts['max_cache_size'])], shell=False) -+ # zero ccache stats -+ getLog().info("Zero ccache stats:") -+ self.buildroot.doChroot(["ccache", "--zero-stats"], printOutput=True, shell=False) - - # set up the ccache dir. - # we also set a few variables used by ccache to find the shared cache. -@@ -61,3 +65,10 @@ def _ccachePreInitHook(self): - file_util.mkdirIfAbsent(self.buildroot.make_chroot_path('/var/tmp/ccache')) - file_util.mkdirIfAbsent(self.ccachePath) - self.buildroot.uid_manager.changeOwner(self.ccachePath, recursive=True) -+ -+ # get some cache stats -+ def _ccachePostBuildHook(self): -+ # show the cache hit stats -+ getLog().info("ccache stats:") -+ self.buildroot.doChroot(["ccache", "--show-stats"], printOutput=True, shell=False) -++ - -From bfd3a7e1bb47d28ee60a94cb5985c1f66476475f Mon Sep 17 00:00:00 2001 -From: "Brian J. Murrell" -Date: Tue, 30 Jan 2024 11:17:48 -0500 -Subject: [PATCH 2/2] Remove extraneous line - -Signed-off-by: Brian J. Murrell ---- - mock/py/mockbuild/plugins/ccache.py | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/mock/py/mockbuild/plugins/ccache.py b/mock/py/mockbuild/plugins/ccache.py -index 1080ffe68..1a20846d3 100644 ---- a/mock/py/mockbuild/plugins/ccache.py -+++ b/mock/py/mockbuild/plugins/ccache.py -@@ -71,4 +71,3 @@ def _ccachePostBuildHook(self): - # show the cache hit stats - getLog().info("ccache stats:") - self.buildroot.doChroot(["ccache", "--show-stats"], printOutput=True, shell=False) --+ diff --git a/utils/rpms/packaging/debian_chrootbuild b/utils/rpms/packaging/debian_chrootbuild deleted file mode 100755 index c3a83054a73..00000000000 --- a/utils/rpms/packaging/debian_chrootbuild +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -set -uex - -if [ -n "${ARTIFACTORY_URL:-}" ] && "$LOCAL_REPOS"; then - echo "MIRRORSITE=${ARTIFACTORY_URL}artifactory/ubuntu-proxy" | sudo tee /root/.pbuilderrc -fi - -# shellcheck disable=SC2086 -sudo pbuilder create \ - --extrapackages "gnupg ca-certificates" \ - $DISTRO_ID_OPT - -repo_args="" -repos_added=() -for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do - branch="master" - build_number="lastSuccessfulBuild" - if [[ $repo = *@* ]]; then - branch="${repo#*@}" - repo="${repo%@*}" - if [[ $branch = *:* ]]; then - build_number="${branch#*:}" - branch="${branch%:*}" - fi - fi - if [[ " ${repos_added[*]} " = *\ ${repo}\ * ]]; then - # don't add duplicates, first found wins - continue - fi - repos_added+=("$repo") - repo_args="$repo_args|deb [trusted=yes] ${JENKINS_URL:-https://jenkins-3.daos.hpc.amslabs.hpecorp.net/}job/daos-stack/job/$repo/job/$branch/$build_number/artifact/artifacts/$DISTRO/ ./" -done - -repo_args+="|$(curl -sSf "$REPO_FILE_URL"daos_ci-"$DISTRO"-artifactory.list | - sed -e 's/#.*//' -e '/ubuntu-proxy/d' -e '/^$/d' -e '/^$/d' \ - -e 's/signed-by=.*\.gpg/trusted=yes/' | - sed -e ':a; N; $!ba; s/\n/|/g')" -for repo in $JOB_REPOS; do - repo_name=${repo##*://} - repo_name=${repo_name//\//_} - if [[ " ${repos_added[*]} " = *\ ${repo_name}\ * ]]; then - # don't add duplicates, first found wins - continue - fi - repos_added+=("$repo_name") - repo_args+="|deb ${repo} $VERSION_CODENAME main" -done -# NB: This PPA is needed to support modern go toolchains on ubuntu 20.04. -# After the build is updated to use 22.04, which supports go >= 1.18, it -# should no longer be needed. -repo_args="$repo_args|deb [trusted=yes] https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu $VERSION_CODENAME main" -echo "$repo_args" -if [ "$repo_args" = "|" ]; then - repo_args="" -else - #repo_args="--othermirror"${repo_args#|}\"" - repo_args="${repo_args#|}" -fi -cd "$DEB_TOP" -# shellcheck disable=SC2086 -sudo pbuilder update --override-config $DISTRO_ID_OPT ${repo_args:+--othermirror "$repo_args"} -# fail the build if the *.symbols file(s) need updating -sudo DPKG_GENSYMBOLS_CHECK_LEVEL="${DPKG_GENSYMBOLS_CHECK_LEVEL:-4}" pbuilder build "$DEB_DSC" diff --git a/utils/rpms/packaging/rpm_chrootbuild b/utils/rpms/packaging/rpm_chrootbuild deleted file mode 100755 index 70127132fe2..00000000000 --- a/utils/rpms/packaging/rpm_chrootbuild +++ /dev/null @@ -1,166 +0,0 @@ -#!/bin/bash - -set -uex - -: "${HTTPS_PROXY:=}" -: "${REPO_FILE_URL:=}" -: "${REPOSITORY_NAME:=artifactory}" - -cp /etc/mock/"$CHROOT_NAME".cfg mock.cfg - -# Enable mock ccache plugin -cat <> mock.cfg -config_opts['plugin_conf']['ccache_enable'] = True -config_opts['plugin_conf']['ccache_opts']['dir'] = "%(cache_topdir)s/%(root)s/ccache/" -EOF - -# Optionally add a proxy to mock -if [ -n "$HTTPS_PROXY" ];then - yum_proxy="http://${HTTPS_PROXY##*//}" - echo "config_opts['https_proxy'] = '$yum_proxy'" >> mock.cfg -fi - -# No proxy for local mirrors -if [ -n "$REPO_FILE_URL" ]; then - direct="${REPO_FILE_URL##*//}" - direct="${direct%%/*}" - echo "config_opts['no_proxy'] = '${direct}'" >> mock.cfg -fi - -if [[ $CHROOT_NAME == *epel-8-x86_64 ]]; then - cat <> mock.cfg -config_opts['module_setup_commands'] = [ - ('enable', 'javapackages-tools:201801'), - ('disable', 'go-toolset') -] -EOF -fi - -# Use dnf on CentOS 7 -if [[ $CHROOT_NAME == *epel-7-x86_64 ]]; then - MOCK_OPTIONS="--dnf --no-bootstrap-chroot${MOCK_OPTIONS:+ }$MOCK_OPTIONS" -fi - -# Allow BR: foo-devel < 1.2 to work when foo-devel-1.3 is actually available -cat <> mock.cfg -config_opts['dnf.conf'] += """ -[main] -best=0 -""" -EOF - -# shellcheck disable=SC2153 -repo_adds=() -repo_dels=() - -echo -e "config_opts['yum.conf'] += \"\"\"\n" >> mock.cfg - -if [ -n "${ARTIFACTORY_URL:-}" ] && "$LOCAL_REPOS"; then - repo_dels+=("--disablerepo=\*") - - if [ -n "${REPO_FILE_URL:-}" ]; then - if [ -n "$REPO_FILES_PR" ]; then - if [[ $REPO_FILES_PR = PR-* ]]; then - build_number="lastSuccessfulBuild" - branch="$REPO_FILES_PR" - if [[ $branch = *:* ]]; then - build_number="${branch#*:}" - branch="${branch%:*}" - fi - REPO_FILE_URL="${JENKINS_URL:-https://jenkins-3.daos.hpc.amslabs.hpecorp.net/}job/daos-do/job/repo-files/job/$branch/$build_number/artifact/" - else - if [ ! -d "$REPO_FILES_PR" ]; then - echo "Could not find your specified directory \"$REPO_FILES_PR\" to read repo-files from" - exit 1 - fi - REPO_FILE_URL="file://$(readlink -e "$REPO_FILES_PR")/" - fi - fi - curl --noproxy '*' -sSf "$REPO_FILE_URL"daos_ci-"${CHROOT_NAME%-*}".repo >> mock.cfg - repo_adds+=("--enablerepo *-${REPOSITORY_NAME}") - fi -fi - -repos_added=() -for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do - branch="master" - build_number="lastSuccessfulBuild" - if [[ $repo = *@* ]]; then - branch="${repo#*@}" - repo="${repo%@*}" - if [[ $branch = *:* ]]; then - build_number="${branch#*:}" - branch="${branch%:*}" - fi - fi - if [[ " ${repos_added[*]} " = *\ ${repo}\ * ]]; then - # don't add duplicates, first found wins - continue - fi - repos_added+=("$repo") - repo_adds+=("--enablerepo $repo:${branch//[@\/]/_}:$build_number") - echo -e "[$repo:${branch//[@\/]/_}:$build_number]\n\ -name=$repo:${branch//[@\/]/_}:$build_number\n\ -baseurl=${ARTIFACTS_URL:-${JENKINS_URL:-https://jenkins-3.daos.hpc.amslabs.hpecorp.net/}job/}daos-stack/job/$repo/job/${branch//\//%2F}/$build_number/artifact/artifacts/$DISTRO/\n\ -enabled=1\n\ -gpgcheck=False\n" >> mock.cfg -done -for repo in $JOB_REPOS; do - repo_name=${repo##*://} - repo_name=${repo_name//\//_} - if [[ " ${repos_added[*]} " = *\ ${repo_name}\ * ]]; then - # don't add duplicates, first found wins - continue - fi - repos_added+=("$repo_name") - repo_adds+=("--enablerepo $repo_name") - echo -e "[${repo_name//[@\/]/_}]\n\ -name=${repo_name}\n\ -baseurl=${repo//\//%2F}\n\ -enabled=1\n" >> mock.cfg -done -echo "\"\"\"" >> mock.cfg - -if [ -n "$DISTRO_VERSION" ]; then - releasever_opt=("--config-opts=releasever=$DISTRO_VERSION") -fi - -bs_dir=/CIShare/mock/cache/"${CHROOT_NAME}"-bootstrap-$(id -u) -if ls -l "$bs_dir"/root_cache/cache.tar.gz; then - ls -ld /var || true - ls -ld /var/cache || true - ls -ld /var/cache/mock || true - ls -l /var/cache/mock || true - mkdir -p "/var/cache/mock/${CHROOT_NAME}-bootstrap/" - flock "$bs_dir" -c "cp -a $bs_dir/root_cache /var/cache/mock/${CHROOT_NAME}-bootstrap" -fi -if ls -l "$bs_dir/ccache-$CHROOT_NAME-$PACKAGE".tar.gz; then - flock "$bs_dir" -c "tar -C / -xzf $bs_dir/ccache-$CHROOT_NAME-$PACKAGE.tar.gz" -fi - -rc=0 -# shellcheck disable=SC2086,SC2048 -if ! eval time mock -r mock.cfg ${repo_dels[*]} ${repo_adds[*]} --no-clean \ - --disablerepo=\*-debug* ${releasever_opt[*]} $MOCK_OPTIONS \ - $RPM_BUILD_OPTIONS "$TARGET"; then - rc=${PIPESTATUS[0]} -fi - -# Save the ccache -if [ -d /CIShare/mock/ ]; then - mkdir -p "$bs_dir"/ - if ! flock "$bs_dir" -c "tar -czf $bs_dir/ccache-$CHROOT_NAME-$PACKAGE.tar.gz /var/cache/mock/${CHROOT_NAME}/ccache"; then - echo "Failed to save ccache. Plowing onward." - echo "I am $(id)" - fi - if ls -l /var/cache/mock/"${CHROOT_NAME}"-bootstrap/root_cache/cache.tar.gz; then - if ! cmp /var/cache/mock/"${CHROOT_NAME}"-bootstrap/root_cache/cache.tar.gz "$bs_dir"/root_cache/cache.tar.gz; then - if ! flock "$bs_dir" -c "cp -a /var/cache/mock/${CHROOT_NAME}-bootstrap/root_cache $bs_dir/"; then - echo "Failed to save root_cache. Plowing onward." - echo "I am $(id)" - fi - fi - fi -fi - -exit "$rc" diff --git a/utils/rpms/packaging/rpmlint--ignore-unused-rpmlintrc.patch b/utils/rpms/packaging/rpmlint--ignore-unused-rpmlintrc.patch deleted file mode 100644 index f24075ff35c..00000000000 --- a/utils/rpms/packaging/rpmlint--ignore-unused-rpmlintrc.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 060fbdd03d03b0b9835b861a72f9aeb25347277d Mon Sep 17 00:00:00 2001 -From: Martin Liska -Date: Tue, 25 Jan 2022 14:29:05 +0100 -Subject: [PATCH] Add new option --ignore-unused-rpmlintrc. - -The option skips reporting of unused-rpmlintrc-filter errors. - -Fixes: #794. ---- - rpmlint/cli.py | 2 ++ - rpmlint/lint.py | 3 ++- - test/test_lint.py | 3 ++- - 3 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/rpmlint/cli.py b/rpmlint/cli.py -index 81d5b92b..8a7bc09e 100644 ---- a/rpmlint/cli.py -+++ b/rpmlint/cli.py -@@ -82,6 +82,8 @@ def process_lint_args(argv): - parser.add_argument('-i', '--installed', nargs='+', default='', help='installed packages to be validated by rpmlint') - parser.add_argument('-t', '--time-report', action='store_true', help='print time report for run checks') - parser.add_argument('-T', '--profile', action='store_true', help='print cProfile report') -+ parser.add_argument('--ignore-unused-rpmlintrc', action='store_true', -+ help='Do not report "unused-rpmlintrc-filter" errors') - lint_modes_parser = parser.add_mutually_exclusive_group() - lint_modes_parser.add_argument('-s', '--strict', action='store_true', help='treat all messages as errors') - lint_modes_parser.add_argument('-P', '--permissive', action='store_true', help='treat individual errors as non-fatal') -diff --git a/rpmlint/lint.py b/rpmlint/lint.py -index a98d2c04..1d5e0050 100644 ---- a/rpmlint/lint.py -+++ b/rpmlint/lint.py -@@ -277,7 +277,8 @@ - - # validate used filters in rpmlintrc - if is_last: -- self.output.validate_filters(pkg) -+ if not self.options['ignore_unused_rpmlintrc']: -+ self.output.validate_filters(pkg) - - if spec_checks: - self.specfiles_checked += 1