From 931d61f432a34bf311a597ad5322ed85fb36dbb8 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 22 Apr 2020 15:43:23 +0300 Subject: [PATCH] Fix regression(s) on build dependency resolution Upstream ticket https://github.com/rpm-software-management/rpm/issues/1189 --- ...source-package-provides-in-depsolvin.patch | 65 +++++++++++++++++++ rpm.spec | 6 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 0001-Don-t-look-into-source-package-provides-in-depsolvin.patch diff --git a/0001-Don-t-look-into-source-package-provides-in-depsolvin.patch b/0001-Don-t-look-into-source-package-provides-in-depsolvin.patch new file mode 100644 index 0000000..c2684bd --- /dev/null +++ b/0001-Don-t-look-into-source-package-provides-in-depsolvin.patch @@ -0,0 +1,65 @@ +From a4afbb62c94c6e0dc18c1bf08336aeb4a91f82de Mon Sep 17 00:00:00 2001 +Message-Id: +From: Panu Matilainen +Date: Wed, 22 Apr 2020 14:12:47 +0300 +Subject: [PATCH] Don't look into source package provides in depsolving + +Fixes regressions from commit 75ec16e660e784d7897b37cac1a2b9b135825f25: +the newly added provides of to-be-built packages were being used for +dependency resolution, such as spec satifying its own buildrequires, +and matched against conflicts in installed packages. + +Source packages cannot obsolete anything or provide capabilities or files +to transactions, don't add them to rpmal at all. Explicitly skip checks +against source provides, similarly to what we already did with obsoletes. + +Fixes: #1189 +--- + lib/depends.c | 8 ++++---- + lib/rpmal.c | 4 ++++ + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/lib/depends.c b/lib/depends.c +index 6acb21dc3..579451926 100644 +--- a/lib/depends.c ++++ b/lib/depends.c +@@ -1040,6 +1040,10 @@ int rpmtsCheck(rpmts ts) + checkDS(ts, dcache, p, rpmteNEVRA(p), rpmteDS(p, RPMTAG_OBSOLETENAME), + tscolor); + ++ /* Skip obsoletion and provides checks for source packages (ie build) */ ++ if (rpmteIsSource(p)) ++ continue; ++ + /* Check provides against conflicts in installed packages. */ + while (rpmdsNext(provides) >= 0) { + checkInstDeps(ts, dcache, p, RPMTAG_CONFLICTNAME, NULL, provides, 0); +@@ -1047,10 +1051,6 @@ int rpmtsCheck(rpmts ts) + checkInstDeps(ts, dcache, p, RPMTAG_REQUIRENAME, NULL, provides, 1); + } + +- /* Skip obsoletion checks for source packages (ie build) */ +- if (rpmteIsSource(p)) +- continue; +- + /* Check package name (not provides!) against installed obsoletes */ + checkInstDeps(ts, dcache, p, RPMTAG_OBSOLETENAME, NULL, rpmteDS(p, RPMTAG_NAME), 0); + +diff --git a/lib/rpmal.c b/lib/rpmal.c +index 3c8acd63a..8a47d025a 100644 +--- a/lib/rpmal.c ++++ b/lib/rpmal.c +@@ -247,6 +247,10 @@ void rpmalAdd(rpmal al, rpmte p) + rpmalNum pkgNum; + availablePackage alp; + ++ /* Source packages don't provide anything to depsolving */ ++ if (rpmteIsSource(p)) ++ return; ++ + if (al->size == al->alloced) { + al->alloced += al->delta; + al->list = xrealloc(al->list, sizeof(*al->list) * al->alloced); +-- +2.25.3 + diff --git a/rpm.spec b/rpm.spec index a4a44f4..1a20816 100644 --- a/rpm.spec +++ b/rpm.spec @@ -25,7 +25,7 @@ %global rpmver 4.15.90 %global snapver git14971 -%global rel 7 +%global rel 8 %global srcver %{version}%{?snapver:-%{snapver}} %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} @@ -63,6 +63,7 @@ Patch100: 0001-Unset-SOURCE_DATE_EPOCH-for-the-test-suite.patch Patch101: 0001-rpmfc-Do-not-prepend-buildroot-to-a-path-for-paramet.patch Patch102: 0001-Fix-regression-causing-all-ELF-files-classified-as-O.patch Patch103: 0001-Warn-on-undefined-components-in-buildtree-macros.patch +Patch104: 0001-Don-t-look-into-source-package-provides-in-depsolvin.patch # These are not yet upstream Patch906: rpm-4.7.1-geode-i686.patch @@ -533,6 +534,9 @@ make check || (cat tests/rpmtests.log; exit 1) %doc doc/librpm/html/* %changelog +* Wed Apr 22 2020 Panu Matilainen - 4.15.90-0.git14971.8 +- Fix regression(s) on build dependency resolution + * Wed Apr 22 2020 Panu Matilainen - 4.15.90-0.git14971.7 - Add rpmdb-rebuild systemd service