Bug#834026: libghc-yi-rope-dev: links against libicu but doesn't depend on it

2019-12-02 Thread Sean Whitton
control: severity -1 serious
control: tag -1 - moreinfo

Hello,

On Tue 16 Aug 2016 at 09:55AM -04, Joachim Breitner wrote:

> I believe the problem is the following: When linking libghc-yi-rope-
> dev, ghc (or Caba?) will look at all its dependencies, and their
> "extra-libraries" fields ("icuuc icui18n icudata" for text-icu) and
> pass that to the linker (as "-licuuc -licui18n -licudata"). This is how
> we get this unwanted dependency.
>
> But since yi-rope does itself not actually use any of these symbols,
> this is probably not required! And not passing these libraries here
> should solve the problem.

If this diagnosis of the problem is correct, then I believe that the bug
severity should be set back to 'serious'.

If libicu is not present on the system, attempts to open yi-rope will
crash because the dynamic linker will try and fail to open libicu, even
though no symbols from that library actually get used.

-- 
Sean Whitton


signature.asc
Description: PGP signature


Bug#834026: libghc-yi-rope-dev: links against libicu but doesn't depend on it

2016-08-16 Thread Joachim Breitner
Hi,

Am Montag, den 15.08.2016, 20:22 -0700 schrieb Sean Whitton:

> > But no dependency against libicu55.
> 
> libghc-yi-rope-dev depends on libghc-text-icu-dev (by means of a virtual
> package the latter provides), and libghc-text-icu-dev depends on
> libicu57.  If libicu57 went through a SONAME change and
> libghc-text-icu-dev was binNMU'd, we would also have to binNMU
> libghc-yi-rope-dev because there is no Haskell ABI stability.  So I
> believe that all required shared library dependency relationships are in
> place.

The problem is that the rebuilt libghc-text-icu-dev has, from the point
of view of the Haskell compiler, the same ABI. So no rebuilds of
libghc-yi-dev are triggered by our tools.

I believe the problem is the following: When linking libghc-yi-rope-
dev, ghc (or Caba?) will look at all its dependencies, and their
"extra-libraries" fields ("icuuc icui18n icudata" for text-icu) and
pass that to the linker (as "-licuuc -licui18n -licudata"). This is how
we get this unwanted dependency.

But since yi-rope does itself not actually use any of these symbols,
this is probably not required! And not passing these libraries here
should solve the problem.

Only when a haskell _program_ is (statically) linked, we want to do
this.

This seems to be done by
ppHsc2hs :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> 
PreProcessor
in Cabal/Distribution/Simple/PreProcess.hs.

I only found one relevant upstream ticket, see
https://ghc.haskell.org/trac/ghc/ticket/9498
which talks about related problems, but might fix this one.
https://ghc.haskell.org/trac/ghc/wiki/LinkingHaskell is also a good
read.

If someone feels bold he could change the Cabal code to pass linker
flags on for direct C dependencies and see if that works.

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
Debian Developer
  nome...@debian.org • https://people.debian.org/~nomeata
  XMPP: nome...@joachim-breitner.de • GPG-Key: 0xF0FBF51F
  https://www.joachim-breitner.de/

signature.asc
Description: This is a digitally signed message part


Bug#834026: libghc-yi-rope-dev: links against libicu but doesn't depend on it

2016-08-15 Thread Sean Whitton
control: tag -1 +moreinfo
control: severity -1 important

Dear Emilio,

On Thu, Aug 11, 2016 at 03:32:28PM +0200, Emilio Pozuelo Monfort wrote:
> Package: libghc-yi-rope-dev
> Version: 0.7.0.1-3
> Severity: serious
> 
> $ objdump -x 
> usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-7.10.3/yi-rope-0.7.0.1-HiTY8p3VPT60NpepXpO5r3/libHSyi-rope-0.7.0.1-HiTY8p3VPT60NpepXpO5r3-ghc7.10.3.so
>  | grep libicu
>   NEEDED   libicuuc.so.55
>   NEEDED   libicui18n.so.55
>   NEEDED   libicudata.so.55
> 
> But no dependency against libicu55.

libghc-yi-rope-dev depends on libghc-text-icu-dev (by means of a virtual
package the latter provides), and libghc-text-icu-dev depends on
libicu57.  If libicu57 went through a SONAME change and
libghc-text-icu-dev was binNMU'd, we would also have to binNMU
libghc-yi-rope-dev because there is no Haskell ABI stability.  So I
believe that all required shared library dependency relationships are in
place.

I'm lowering the severity to non-RC because, based on my understanding
of the shared library policy, this indirect dependency is sufficient.
If I'm wrong then please raise it back up.  Note that if you're right
that this is a bug, it probably affects all Haskell libraries that link
with non-Haskell shared libraries (all the reverse build dependencies of
libghc-text-icu-dev for a start).

The attached patch "fixes" the bug in that if it is applied, the binary
package gets a dependency on libicu57.  Though I don't think it should
be applied.

> This may be because of:
> 
> dh_shlibdeps -plibghc-yi-rope-dev -XlibHS

For the record, this isn't the problem -- dh_haskell_shlibdeps generates
the ${shlib:Depends} content by looking at a file that ghc generates.

-- 
Sean Whitton
Description: Add libicu shared library dependency
Author: Sean Whitton 
Forwarded: no
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/yi-rope.cabal
+++ b/yi-rope.cabal
@@ -30,6 +30,8 @@ library
 , text
 , text-icu
 
+  extra-libraries: icuuc
+
   hs-source-dirs:  src
   default-language:Haskell2010
 


signature.asc
Description: PGP signature


Bug#834026: libghc-yi-rope-dev: links against libicu but doesn't depend on it

2016-08-11 Thread Emilio Pozuelo Monfort
Package: libghc-yi-rope-dev
Version: 0.7.0.1-3
Severity: serious

$ objdump -x 
usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-7.10.3/yi-rope-0.7.0.1-HiTY8p3VPT60NpepXpO5r3/libHSyi-rope-0.7.0.1-HiTY8p3VPT60NpepXpO5r3-ghc7.10.3.so
 | grep libicu
  NEEDED   libicuuc.so.55
  NEEDED   libicui18n.so.55
  NEEDED   libicudata.so.55

But no dependency against libicu55.

This may be because of:

dh_shlibdeps -plibghc-yi-rope-dev -XlibHS

From:
https://buildd.debian.org/status/fetch.php?pkg=haskell-yi-rope=i386=0.7.0.1-3%2Bb2=1464933179

Cheers,
Emilio

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (800, 'unstable'), (700, 'experimental'), (650, 'testing'), (500, 
'unstable-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)