#978172 Decide whether libphonenumber or its users should B-D against libboost dev packages

#978172#5
Date:
2020-12-26 21:12:40 UTC
From:
To:
Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.

Relevant part (hopefully):
http://qa-logs.debian.net/2020/12/26/evolution-data-server_3.38.2-2_unstable.log

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with me
so that we can identify if something relevant changed in the meantime.

About the archive rebuild: The rebuild was done on EC2 VM instances from
Amazon Web Services, using a clean, minimal and up-to-date chroot. Every
failed build was retried once to eliminate random failures.

#978172#10
Date:
2021-01-01 20:22:44 UTC
From:
To:
Hello,

Seems like intentional(?) changes in libphonennumber caused this.

Adding recipient Matthias Klose, who uploaded the latest libphonenumber
version, to hopefully get a comment on if this is something than should
get fixed in libphonenumber or in e-d-s.

Please note that the libphonenumber Vcs-Git repo seems outdated so it's
not possible to track down exact commit which changed debian/control and
get more details!

Nope, this is a wild goose....
[...]


Hopefully actually relevant part (because I have to say finding the
actual error from CMake builds is horrible!):

```
gmake[3]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_24d88.dir/src.cxx.o
/usr/bin/c++ -DI18N_PHONENUMBERS_USE_BOOST  -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Dphone_number_with_boost_thread-mt -fPIE -o CMakeFiles/cmTC_24d88.dir/src.cxx.o -c /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/src.cxx
<command-line>: warning: ISO C++11 requires whitespace after the macro name
In file included from /usr/include/phonenumbers/phonenumberutil.h:32,
                 from /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/src.cxx:1:
/usr/include/phonenumbers/base/memory/scoped_ptr.h:10:10: fatal error: boost/scoped_ptr.hpp: No such file or directory
   10 | #include <boost/scoped_ptr.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[3]: *** [CMakeFiles/cmTC_24d88.dir/build.make:85: CMakeFiles/cmTC_24d88.dir/src.cxx.o] Error 1
gmake[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp'
gmake[2]: *** [Makefile:140: cmTC_24d88/fast] Error 2
```

So this looks like a bug in libphonenumber to me.... Interestingly
this is part of libphonenumber 7.1.0-7 changelog:
 * Don't build using boost, not required on recent Linux versions.

... and in /usr/include/phonenumbers/base/memory/scoped_ptr.h we can
see that the boost header is conditionally included based on
`#if defined(I18N_PHONENUMBERS_USE_BOOST)`.

That define in turn is apparently set by evolution-data-server:
./cmake/modules/FindPhonenumber.cmake:set(PHONENUMBER_DEFINITIONS -DI18N_PHONENUMBERS_USE_BOOST CACHE STRING "libphonenumber compile definitions, default is -DI18N_PHONENUMBERS_USE_BOOST")

Does that mean evolution-data-server is supposed to open-code the
dependencies needed by libphonenumber on boost ?
I think it would be better if the libphonenumber-dev pulled in
everything needed in every supported configuration (or alternatively
provided 2 separate -dev packages, eg. libphonenumber-boost-dev which
deps on libphonennumber-dev plus required boost parts but that seems
too complex for little gain - not to mention needing to go through NEW).



Regards,
Andreas Henriksson

#978172#33
Date:
2021-01-21 09:30:32 UTC
From:
To:
severity 978172 normal
retitle 978172 Decide whether libphonenumber or its users should B-D
against libboost dev packages
thanks

EDS builds fine again, now that libphonenumber has reintroduced the B-D
against libboost dev packages

libphonenumber maintainer wants use to depend on boost dev package,
let's discuss that after bullseye release

#978172#46
Date:
2022-01-30 17:37:16 UTC
From:
To:
Hi Laurent, Matthias, Andreas:

I am reviving the discussion now that bullseye has been released.  The
commit that added the B-D on libboost-thread-dev to libphonenumber-dev
is [1].

What are the drawbacks to leaving the boost B-D in libphonenumber-dev
and closing the bug?

Thank you,
tony

[1] https://salsa.debian.org/debian/libphonenumber/-/commit/be4e4215dcf0260344499ac05d9199ff55748cb7

#978172#51
Date:
2022-02-09 05:10:22 UTC
From:
To:
[ adding #978172 to Cc ]

Hi Tony,

yes, this is a similar issue, and I do also see the dependency as
mandatory there:

When libphonenumber8 is only using a library without exposing it in its
API, then there is no need for a dependency in libphonenumber-dev.[1]

When a library is exposing its own dependencies in its API,
by #include'ing of headers of the libraries it uses, then
the dependencies should provide everything necessary for
using the headers.

cu
Adrian

[1] Ignoring the static libraries in libphonenumber-dev, in practice
    static libraries are rarely used and -dev packages do not usually
    have dependencies for using them.