Bug#897794: How to fix symbols files to work with gcc-7 and gcc-8 (Was: Bug#897794: libquazip: ftbfs with GCC-8)

2018-05-05 Thread Alf Gaida
Hi Andreas,
there is a MR waiting in salsa.

Cheers Alf



Bug#897794: How to fix symbols files to work with gcc-7 and gcc-8 (Was: Bug#897794: libquazip: ftbfs with GCC-8)

2018-05-05 Thread Yavor Doganov
Mattia Rizzolo wrote:
> On Fri, May 04, 2018 at 04:06:05PM +0300, Yavor Doganov wrote:
> > Andreas Tille wrote:
> > > What's the correct way to fix the symbols file to work with both
> > > versions of gcc?
> > 
> > Don't use symbols files for C++ libraries?
> 
> Please do not advocate nor recommend such pointless stands.

Symbols files are not mandatory; it's up to the maintainer whether to
use them or not.  If the maintainer's judgment is that the burden
outweighs the benefit, then so be it -- there is nothing wrong in
that.

What makes me feel uneasy is that the standard way of maintaining
symbols files involves abusing the Debian infrastructure.  It was
unthinkable 10-15 years ago to upload a package knowing in advance
that it would definitely FTBFS at least on certain architectures.
That's common practice nowadays and some of the slow arches are
suffering from it.

> Yes, many C++ libraries do a very horrible job at ABI maintenance
> that for them maintaining a symbols file is impossible.

They are probably hard to maintain as proper public shared libraries,
with symbols files or not.

> No, it's not impossible to maintain a symbols file for a C++
> library.

I didn't say it is impossible.

> Guess what, C++ is more complex than C.

Undoubtedly.



Bug#897794: How to fix symbols files to work with gcc-7 and gcc-8 (Was: Bug#897794: libquazip: ftbfs with GCC-8)

2018-05-04 Thread Mattia Rizzolo
On Sat, May 05, 2018 at 12:45:08AM +0200, Svante Signell wrote:
> But why log symbols at all? It
> seems to be very much not needed. If so tell me why it is!

Mainly I see two reasons:
 1. being able to use properly versioned dependencies on the library
 2. have a safety net against what are imho the most common ABI breaks

1: without symbols file you should take care of properly bumping the
shlibs version whenever you introduce a new symbols: in that case either
you don't know you are adding a new symbol, and so you won't bump the
shlibs version and you are going end up with a broken dependency (just
most of the times you are not going to notice it because just out of
luck you get a new enough version of the shared lib together of the
binary requiring the new symbol), or you use -V and force an overly
strict versioned dependency.  Please read:
 - dpkg-gensymbols(1)
 - dpkg-shlibdeps(1)
 - deb-shlibs(5)
 - deb-symbols(5)
 - dh_makeshlibs(1)
2: you'll notice ABI breaks whenever an under-diligent upstream drops a
public method —so dropping also the symbol— without changing SONAME


I personally find the second one particularly interesting: the amount of
upstreams who develop a library with the goal of providing a shared
library but nonetheless won't pose much interest and attention in proper
ABI (in particular symbols) handling is astonishing.
ABI breaks are awful to handle after they land in unstable, catching one
before can save the maintainer, release team and all the rdeps *a lot*
of otherwise wasted time and headaches.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#897794: How to fix symbols files to work with gcc-7 and gcc-8 (Was: Bug#897794: libquazip: ftbfs with GCC-8)

2018-05-04 Thread Svante Signell
On Fri, 2018-05-04 at 23:16 +0200, Mattia Rizzolo wrote:
> Yavor,
> 
> On Fri, May 04, 2018 at 04:06:05PM +0300, Yavor Doganov wrote:
> > Andreas Tille wrote:
> > > What's the correct way to fix the symbols file to work with both
> > > versions of gcc?

> Guess what, C++ is more complex than C.

Sorry for being uniformed/not knowing: But why log symbols at all? It
seems to be very much not needed. If so tell me why it is!



Bug#897794: How to fix symbols files to work with gcc-7 and gcc-8 (Was: Bug#897794: libquazip: ftbfs with GCC-8)

2018-05-04 Thread Mattia Rizzolo
On Fri, May 04, 2018 at 02:52:30PM +0200, Andreas Tille wrote:
> there are several bugs filed against packages of the Debian Med
> team.

Well, it's not really only about Debian Med...

> What's the correct way to fix the symbols file to work
> with both versions of gcc?

As usual.
Investigate why symbols disappear and decide what to do.
In case of symbols disappearing after changing the compiler, most likely
those symbols were weak and only leaked an implementation detail, and so
they need to be marked as "optional".
For example:

[ #897794 ]
> > [...]
> > - (optional)_ZN5QListI16QuaZipFileInfo64ED1Ev@Base 0.7.3
> > - (optional)_ZN5QListI16QuaZipFileInfo64ED2Ev@Base 0.7.3
> > +#MISSING: 0.7.3-6# (optional)_ZN5QListI16QuaZipFileInfo64ED1Ev@Base 0.7.3
> > +#MISSING: 0.7.3-6# (optional)_ZN5QListI16QuaZipFileInfo64ED2Ev@Base 0.7.3

These are fine, dpkg-gensymbols is only being noisy here.

> > - (optional)_ZN5QListI7QStringED1Ev@Base 0.7.3
> > - (optional)_ZN5QListI7QStringED2Ev@Base 0.7.3
> > +#MISSING: 0.7.3-6# (optional)_ZN5QListI7QStringED1Ev@Base 0.7.3
> > +#MISSING: 0.7.3-6# (optional)_ZN5QListI7QStringED2Ev@Base 0.7.3
> >   _ZN5QListI9QFileInfoE13detach_helperEi@Base 0.7.3
> > - (optional)_ZN5QListI9QFileInfoED1Ev@Base 0.7.3
> > - (optional)_ZN5QListI9QFileInfoED2Ev@Base 0.7.3
> > +#MISSING: 0.7.3-6# (optional)_ZN5QListI9QFileInfoED1Ev@Base 0.7.3
> > +#MISSING: 0.7.3-6# (optional)_ZN5QListI9QFileInfoED2Ev@Base 0.7.3

same.

> > - (optional)_ZN7QStringD1Ev@Base 0.7.3
> > - (optional)_ZN7QStringD2Ev@Base 0.7.3
> > +#MISSING: 0.7.3-6# (optional)_ZN7QStringD1Ev@Base 0.7.3
> > +#MISSING: 0.7.3-6# (optional)_ZN7QStringD2Ev@Base 0.7.3

same.

Those ones probably come from a previous iteration, like gcc5→gcc6 or
gcc6→gcc7.

> > dpkg-gensymbols: warning: some symbols or patterns disappeared in the 
> > symbols file: see diff output below
> > dpkg-gensymbols: warning: debian/libquazip5-1/DEBIAN/symbols doesn't match 
> > completely debian/libquazip5-1.symbols
> > --- debian/libquazip5-1.symbols (libquazip5-1_0.7.3-6_amd64)
> > +++ dpkg-gensymbolsslI1lw   2018-05-02 13:22:04.076864552 +
> > @@ -74,8 +74,8 @@
> >   _ZN10QuaZipFileD0Ev@Base 0.7.3
> >   _ZN10QuaZipFileD1Ev@Base 0.7.3
> >   _ZN10QuaZipFileD2Ev@Base 0.7.3
> > - _ZN11QStringListC1ERK7QString@Base 0.7.3
> > - _ZN11QStringListC2ERK7QString@Base 0.7.3
> > +#MISSING: 0.7.3-6# _ZN11QStringListC1ERK7QString@Base 0.7.3
> > +#MISSING: 0.7.3-6# _ZN11QStringListC2ERK7QString@Base 0.7.3

This is the actual error.

|mattia@warren ~ % echo "
|dquote> > - _ZN11QStringListC1ERK7QString@Base 0.7.3
|dquote> > - _ZN11QStringListC2ERK7QString@Base 0.7.3
|dquote> " | c++filt
|> - QStringList::QStringList(QString const&)@Base 0.7.3
|> - QStringList::QStringList(QString const&)@Base 0.7.3

Yes, these are symbols that leaked through, so they can (and should) be
marked as "optional".

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#897794: How to fix symbols files to work with gcc-7 and gcc-8 (Was: Bug#897794: libquazip: ftbfs with GCC-8)

2018-05-04 Thread Mattia Rizzolo
Yavor,

On Fri, May 04, 2018 at 04:06:05PM +0300, Yavor Doganov wrote:
> Andreas Tille wrote:
> > What's the correct way to fix the symbols file to work with both
> > versions of gcc?
> 
> Don't use symbols files for C++ libraries?

Please do not advocate nor recommend such pointless stands.

Yes, C++ symbols are harder to track than C symbols.
Yes, C++ symbols handling requires more work than doing C symbols.
Yes, many C++ libraries do a very horrible job at ABI maintenance that
for them maintaining a symbols file is impossible.
No, it's not impossible to maintain a symbols file for a C++ library.
Yes, for decent libraries it's totally feasible also for mere humans.

Guess what, C++ is more complex than C.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#897794: How to fix symbols files to work with gcc-7 and gcc-8 (Was: Bug#897794: libquazip: ftbfs with GCC-8)

2018-05-04 Thread Andreas Tille
On Fri, May 04, 2018 at 04:06:05PM +0300, Yavor Doganov wrote:
> Andreas Tille wrote:
> > What's the correct way to fix the symbols file to work with both
> > versions of gcc?
> 
> Don't use symbols files for C++ libraries?

Well, it took a *long* time before I've undergone the process from
ignoring symbols files to finally providing some in cases where there
are good reasons to use them.  Shortly after I now get adise to not
use them.  I'm not sure whether this is fully honest - but to you
want to file a bug report against lintian to warn only about missing
symbols files if its not a C++ library?

Kind regards

 Andreas.

-- 
http://fam-tille.de