Closed ppisar closed 4 months ago
I forgot to notice that the biggest mistake of the current code is that compiled librepo has struct LrDownloadTarget of a certain size, but applications including librepo header files without matching WITH_ZCHUNK will see struct LrDownloadTarget of a different size. This can lead to memory corruptions and segfaults.
DNF5 was asked to drop a useless dependency on zchunk https://github.com/rpm-software-management/dnf5/issues/1233 because it delegates all zchunk work to librepo. However it turned out that
struct LrDownloadTarget
ABI defined in<librepo/downloadtarget.h>
changes withWITH_ZCHUNK
macro.More over, if the macro is defined,
<zck.h>
is included albeitlibrepo-devel
RPM package does not depend onzchunk-devel
.All that pushes librepo internals to it users, e.g. to DNF5, and makes the build chain more error prone because the whole aplication stack needs to keep WITH_ZCHUNK in synchronization.
I would appreciate isolating librepo ABI from WITH_ZCHUNK macro.