Bug 1974781

Summary: Rebase to 0.9.0 introduces dependency on non-BaseOS content
Product: Red Hat Enterprise Linux 8 Reporter: Josh Boyer <jwboyer>
Component: device-mapper-persistent-dataAssignee: Marian Csontos <mcsontos>
Status: CLOSED ERRATA QA Contact: Filip Suba <fsuba>
Severity: unspecified Docs Contact:
Priority: urgent    
Version: 8.5CC: agk, fsuba, heinzm, jwakely, jwboyer, lvm-team, mcsontos, msnitzer, thornber
Target Milestone: betaFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: device-mapper-persistent-data-0.9.0-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:51:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Josh Boyer 2021-06-22 14:23:38 UTC
Description of problem:

device-mapper-persistent-data is a BaseOS component.  BaseOS components cannot rely on content outside of BaseOS at runtime.  The recent rebase to 0.9.0 has caused device-mapper-persistent-data to grow a runtime dependency on boost-iostreams at runtime, which is only shipped in AppStream.

Please assess if this runtime dependency can be removed.


Version-Release number of selected component (if applicable):

device-mapper-persistent-data-0.9.0-1.el8

Comment 1 Jonathan Wakely 2021-06-22 20:11:14 UTC
Every binary in the RPM now links to libboost_iostreams.so as a result of this upstream change:
https://github.com/jthornber/thin-provisioning-tools/commit/0e1700fbe9e34c58f1019a0c425fad9e62db24a3

That appears to have been needed because the file thin-provisioning/thin_metadata_pack.cc uses boost-iostreams headers, however that file is no longer in the repo.  It was removed by:

commit 61de3f92873310d8a25a8392f7e53ef67cc3d88c
Author: Joe Thornber <ejt>
Date:   Tue Jun 9 09:15:00 2020 +0100

    [thin_metadata_pack/unpack] Replace C++ implementation with a Rust one.


Maybe the addition of -lboost_iostreams to Makefile.in change should have been reverted after the file using it was rewritten in Rust?

Comment 2 Jonathan Wakely 2021-06-22 20:21:38 UTC
The package builds fine (and has no boost dependencies) with this change:

diff --git a/0013-makefile-remove-boost-dependency.patch b/0013-makefile-remove-boost-dependency.patch
new file mode 100644
index 0000000..1913bc6
--- /dev/null
+++ b/0013-makefile-remove-boost-dependency.patch
@@ -0,0 +1,11 @@
+--- thin-provisioning-tools-0.9.0/Makefile.in~ 2021-06-22 21:12:47.108349908 +0100
++++ thin-provisioning-tools-0.9.0/Makefile.in  2021-06-22 21:12:55.359423725 +0100
+@@ -173,7 +173,7 @@
+ CXXFLAGS+=@CXX_STRERROR_FLAG@
+ CXXFLAGS+=@LFS_FLAGS@
+ INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning
+-LIBS:=-laio -lexpat -lboost_iostreams -ldl
++LIBS:=-laio -lexpat -ldl
+ 
+ ifeq ("@DEVTOOLS@", "yes")
+ LIBS+=-lncurses
diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec
index 269dc67..eebbd31 100644
--- a/device-mapper-persistent-data.spec
+++ b/device-mapper-persistent-data.spec
@@ -10,7 +10,7 @@
 Summary: Device-mapper Persistent Data Tools
 Name: device-mapper-persistent-data
 Version: 0.9.0
-Release: 1%{?dist}%{?release_suffix}
+Release: 2%{?dist}%{?release_suffix}
 License: GPLv3+
 URL: https://github.com/jthornber/thin-provisioning-tools
 #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz
@@ -30,6 +30,7 @@ Patch10: 0009-build-Remove-unused-sources-from-the-regular-build.patch
 Patch11: 0010-all-Remove-unreachable-code.patch
 Patch12: 0011-file_utils-Fix-resource-leak.patch
 Patch13: 0012-thin_delta-Clean-up-duplicated-code.patch
+Patch14: 0013-makefile-remove-boost-dependency.patch
 
 BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++
 Requires: expat
@@ -78,6 +79,7 @@ END
 %patch11 -p1 -b .backup11
 %patch12 -p1 -b .backup12
 %patch13 -p1 -b .backup13
+%patch14 -p1 -b .backup14
 echo %{version}-%{release} > VERSION
 
 %build
@@ -148,6 +150,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools
 #% {_sbindir}/thin_show_duplicates
 
 %changelog
+* Tue Jun 22 2021 Jonathan Wakely <jwakely> - 0.9.0-2
+- Remove libboost_iostreams dependency (#1974781)
+
 * Mon Jun 14 2021 Marian Csontos <mcsontos> - 0.9.0-1
 - Update to upstream version 0.9.0.
 - Fix important issues found by static analysis.

Comment 3 Jonathan Wakely 2021-06-22 20:27:33 UTC
Pull req for upstream: https://github.com/jthornber/thin-provisioning-tools/pull/178

Comment 7 Filip Suba 2021-07-16 07:09:03 UTC
Verified with device-mapper-persistent-data-0.9.0-3.el8.

Comment 10 errata-xmlrpc 2021-11-09 19:51:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (device-mapper-persistent-data bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4457