[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#1030546: qt6-base FTBFS on hppa



On Mon, Feb 06, 2023 at 03:22:21PM -0300, Lisandro Damián Nicanor Pérez Meyer wrote:
> Control: tag -1 -patch 
> 
> El lunes, 6 de febrero de 2023 15:03:41 -03 Lisandro Damián Nicanor Pérez 
> Meyer escribió:
> > clone 1030546 -1
> > reassign -1 src:libzstd 1.5.2+dfsg2-3
> > severity -1 important
> > retitle -1 libzstd: breaks detection using cmake?
> > block 1030546 by -1
> > thanks
> > 
> > El sábado, 4 de febrero de 2023 18:23:34 -03 Helge Deller escribió:
> > > Package: qt6-base
> > > Tags: patch, ftbfs, hppa
> > > Version: 6.4.2+dfsg
> > > 
> > > The attached patch fixes this qt6-base "build-from-source" (FTBFS) failure
> > > on hppa: /usr/bin/ld: /usr/lib/hppa-linux-gnu/libzstd.a(error_private.o):
> > > relocation R_PARISC_DPREL21L can not be used when making a shared object;
> > > recompile with -fPIC
> > > 
> > > The problem is, that qt6-base suddenly tries to link against the static
> > > library of libzstd.a, while in the past it did linked against the shared
> > > library:
> > > 
> > > In current failing build (6.4.2+dfsg-1):
> > > -- Found WrapZSTD: 1.5.2 (found suitable version "1.5.2", minimum required
> > > is "1.3") Full log is here:
> > > https://buildd.debian.org/status/fetch.php?pkg=qt6-base&arch=hppa&ver=6.4.
> > > 2% 2Bdfsg-1&stamp=1675198832&raw=0
> > > 
> > > while it worked in the past for qt6-base 6.4.2+dfsg~rc1-1
> > > -- Found WrapZSTD: /usr/lib/hppa-linux-gnu/libzstd.so (found suitable
> > > version "1.5.2", minimum required is "1.3") Full log is here:
> > > https://buildd.debian.org/status/fetch.php?pkg=qt6-base&arch=hppa&ver=6.4.
> > > 2% 2Bdfsg%7Erc1-1&stamp=1672201686&raw=0
> > > 
> > > The attached patch changes  WrapZSTD to prefer the dynamic library.
> > 
> > the source code between those two versions (and in fact between
> > 6.4.2+dfsg~rc1-1 and 6.4.2+dfsg~rc1-2) did not change, so there must be
> > something else, external, triggering the change here.
> > 
> > Look at this, on 6.4.2+dfsg~rc1-1 with libzstd 1.5.2+dfsg-1
> > 
> > -- Found WrapZSTD: /usr/lib/hppa-linux-gnu/libzstd.so (found suitable
> > version "1.5.2", minimum required is "1.3")
> > 
> > But on 6.4.2+dfsg~rc1-2, with 1.5.2+dfsg2-1:
> > 
> > -- Found WrapZSTD: 1.5.2 (found suitable version "1.5.2", minimum required
> > is "1.3")
> > 
> > 
> > libzstd maintainers: for some reason the libzstd detection changed between
> > 1.5.2+dfsg-1 and 1.5.2+dfsg2-1.
> 
> Well, the clone failed, but maybe this is not necessary.
> 
> If I'm reading the code and the packaging changes correctly the change is that 
> zstd changed from generating just pkgconfig files from also generating cmake 
> files. In this case the cmake files take precedence, but neither 
> zstd::libzstd_shared nor zstd::libzstd_static are being defined, and Helge's 
> patch reverses the order, thus changing the default.

FWIW, I think that you're mostly on the right path, but with a small correction:
both zstd::libzstd_shared and zstd::libzstd_static are defined by libzstd's
newly-exposed CMake config. I added --trace-expand to qt6-base's dh_auto_configure
arguments, and got (among much else) this output:

...
/<<PKGBUILDDIR>>/cmake/FindWrapZSTD.cmake(21):  find_package(zstd CONFIG QUIET )
/usr/lib/x86_64-linux-gnu/cmake/zstd/zstdConfigVersion.cmake(12):  set(PACKAGE_VERSION 1.5.2 )
...
/usr/lib/x86_64-linux-gnu/cmake/zstd/zstdTargets.cmake(69):  add_library(zstd::libzstd_shared SHARED IMPORTED )
/usr/lib/x86_64-linux-gnu/cmake/zstd/zstdTargets.cmake(71):  set_target_properties(zstd::libzstd_shared PROPERTIES INTERFACE_INCLUDE_DIRECTORIES /usr/include )
/usr/lib/x86_64-linux-gnu/cmake/zstd/zstdTargets.cmake(76):  add_library(zstd::libzstd_static STATIC IMPORTED )
/usr/lib/x86_64-linux-gnu/cmake/zstd/zstdTargets.cmake(78):  set_target_properties(zstd::libzstd_static PROPERTIES INTERFACE_INCLUDE_DIRECTORIES /usr/include )
...
/<<PKGBUILDDIR>>/cmake/FindWrapZSTD.cmake(25):  if(TARGET zstd::libzstd_static OR TARGET zstd::libzstd_shared )
...
/<<PKGBUILDDIR>>/cmake/FindWrapZSTD.cmake(28):  if(TARGET zstd::libzstd_static )
/<<PKGBUILDDIR>>/cmake/FindWrapZSTD.cmake(29):  set(zstdtargetsuffix _static )
...

So qt6-base's cmake/FindWrapZSTD.cmake file asks CMake about the zstd
configuration, then correctly determines that either the shared or
the static libraries are defined as CMake targets (they both are), and
then, at cmake/FindWrapZSTD.cmake line 28, prefers the static one to
the shared one. That's what caused the change in behavior.

> I'll open a bug upstream about this, in the meantime I'll create a derivative 
> patch that forces using the shared library, ie , being more aggressive so it's 
> understood.

Thanks for your analysis and your work!

G'luck,
Peter

-- 
Peter Pentchev  roam@ringlet.net roam@debian.org pp@storpool.com
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13

Attachment: signature.asc
Description: PGP signature


Reply to: