Bug#790739: don't warn about dev-pkg-without-shlib-symlink for GCC runtime libraries
* Jakub Wilk, 2015-11-29, 12:31: Something fishy is going on here. So the fishy thing is that checks/shared-libs.pm has this: my $MA_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/); whereas checks/binaries.pm and checks/files.pm have this: my $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/, sub { return { 'dir' => $_[1], 'match' => qr/\Q$_[1]\E/ } }); So, thanks data caching, $MA_DIRS could be initialized with a completely different structure than the shared-libs check expected. This preprocessing (introduced in 37774bb101dd) doesn't seem useful to me, so I got rid of it. I'd appreciate if someone familiar with Lintian codebase reviewed the patch. -- Jakub Wilk diff --git a/checks/binaries.pm b/checks/binaries.pm --- a/checks/binaries.pm +++ b/checks/binaries.pm @@ -86,8 +86,7 @@ = Lintian::Data->new('binaries/embedded-libs', qr/\s*+\|\|/, \&_embedded_libs); -our $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/, -sub { return { 'dir' => $_[1], 'match' => qr/\Q$_[1]\E/ } }); +our $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/); sub _split_hash { my (undef, $val) = @_; @@ -192,9 +191,8 @@ # This avoids false positives with plugins like Apache modules, # which may have their own SONAMEs but which don't matter for the # purposes of this check. Also filter out nsswitch modules -if (defined($MULTIARCH_DIRS->value($arch))) { -$madir = $MULTIARCH_DIRS->value($arch)->{'dir'}; -} else { +$madir = $MULTIARCH_DIRS->value($arch); +if (not defined($madir)) { # In the case that the architecture is "all" or unknown (or we do # not know the multi-arch path for a known architecture) , we assume # it the multi-arch path to be this (hopefully!) non-existent path to @@ -202,8 +200,6 @@ $madir = './!non-existent-path!/./'; } -$madir = './!non-existent-path!/./' unless defined $madir; - $gnu_triplet_re = quotemeta $madir; $gnu_triplet_re =~ s,^i386,i[3-6]86,; $ruby_triplet_re = $gnu_triplet_re; diff --git a/checks/files.pm b/checks/files.pm --- a/checks/files.pm +++ b/checks/files.pm @@ -37,8 +37,7 @@ my $LOCALE_CODES = Lintian::Data->new('files/locale-codes', qr/\s++/); my $INCORRECT_LOCALE_CODES = Lintian::Data->new('files/incorrect-locale-codes', qr/\s++/); -my $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/, -sub { return { 'dir' => $_[1], 'match' => qr/\Q$_[1]\E/ } }); +my $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/); my $PRIVACY_BREAKER_WEBSITES= Lintian::Data->new( 'files/privacy-breaker-websites', @@ -657,17 +656,15 @@ # check if pkgconfig file include path point to # arch specific dir MULTI_ARCH_DIR: -foreach my $multiarch_dir ($MULTIARCH_DIRS->all) { -my $value = $MULTIARCH_DIRS->value($multiarch_dir); -my $pkgconfig_dir = $value->{'dir'}; -my $regex = $value->{'match'}; -if ($pkg_config_arch eq $pkgconfig_dir) { +foreach my $arch ($MULTIARCH_DIRS->all) { +my $madir = $MULTIARCH_DIRS->value($arch); +if ($pkg_config_arch eq $madir) { next MULTI_ARCH_DIR; } -if ($block =~ m{\W$regex(\W|$)}xms) { +if ($block =~ m{\W\Q$madir\E(\W|$)}xms) { tag 'pkg-config-multi-arch-wrong-dir',$file, 'full text contains architecture specific dir', - $pkgconfig_dir; + $madir; last MULTI_ARCH_DIR; } }
Bug#790739: don't warn about dev-pkg-without-shlib-symlink for GCC runtime libraries
Control: found -1 2.5.38 Hi Matthias! * Matthias Klose, 2015-11-29, 00:42: fyi, the applied patch doesn't seem to be good enough. https://lintian.debian.org/maintainer/debian-...@lists.debian.org.html#gcc-5 generated with lintian 2.5.38.1 still complains about these symlinks. Thanks for letting us know. Indeed, I get: $ lintian libgomp1_5.2.1-26_i386.deb libgcc-5-dev_5.2.1-26_i386.deb W: libgomp1: dev-pkg-without-shlib-symlink usr/lib/i386-linux-gnu/libgomp.so.1.0.0 usr/lib/i386-linux-gnu/libgomp.so Oddly, when I ask for this particular tag, Lintian doesn't emit anything: $ lintian -T dev-pkg-without-shlib-symlink libgomp1_5.2.1-26_i386.deb libgcc-5-dev_5.2.1-26_i386.deb [nothing] (And this is how I tested if my patch is sufficient...) Something fishy is going on here. I will investigate further. -- Jakub Wilk
Bug#790739: don't warn about dev-pkg-without-shlib-symlink for GCC runtime libraries
On 08/27/2015 10:23 PM, Jakub Wilk wrote: The attached patch fixes all these bugs. awesome!
Bug#790739: don't warn about dev-pkg-without-shlib-symlink for GCC runtime libraries
Control: tags -1 + patch * Matthias Klose d...@debian.org, 2015-07-01, 13:03: lintian currently warns for every runtime library built by the GCC sources about the missing symlink, because GCC ships the .so symlink together with the static and internal libraries in /usr/lib/gcc/triplet/version. Lintian already had code to accommodate GCC, but: 1) It assumed that the source package name is gcc-X.Y, which is no longer the case. 2) It assumed that triplet is $DEB_HOST_MULTIARCH, which is not the case on any-i386. 3) It didn't know about the 64 subdirectory... 4) ...but that didn't matter because it never checked existence of any symlinks, as long as /usr/lib/gcc/triplet/version existed. The attached patch fixes all these bugs. -- Jakub Wilk diff --git a/checks/shared-libs.pm b/checks/shared-libs.pm --- a/checks/shared-libs.pm +++ b/checks/shared-libs.pm @@ -268,7 +268,7 @@ push @alt, $link_file; -if ($proc-pkg_src =~ m/^gcc-(\d+.\d+)$/o) { +if ($proc-pkg_src =~ m/^gcc-(\d+(?:.\d+)?)$/o) { # gcc has a lot of bi-arch libs and puts the dev symlink # in slightly different directories (to be co-installable # with itself I guess). Allegedly, clang (etc.) have to @@ -277,11 +277,12 @@ my $gcc_ver = $1; my $basename = basename($link_file); my $madir = $MA_DIRS-value($proc-pkg_arch); +$madir =~ s/^i386/i586/; my $stem; # Generally we are looking for # * usr/lib/gcc/MA-TRIPLET/$gcc_ver/${BIARCH}$basename # -# Where BIARCH is one of {,32/,n32/,x32/,sf/,hf/}. Note +# Where BIARCH is one of {,64/,32/,n32/,x32/,sf/,hf/}. Note # the empty string as a possible option. # # The two-three letter name directory before the @@ -291,7 +292,7 @@ # just do without it as often (but not always) works. $stem = usr/lib/gcc/$gcc_ver unless defined $madir; -push @alt, map { $stem/$_ } ('', qw(32 n32 x32 sf hf)); +push @alt, map { $stem/$_$basename } ('', qw(64/ 32/ n32/ x32/ sf/ hf/)); } PKG:
Bug#790739: don't warn about dev-pkg-without-shlib-symlink for GCC runtime libraries
Package: lintian lintian currently warns for every runtime library built by the GCC sources about the missing symlink, because GCC ships the .so symlink together with the static and internal libraries in /usr/lib/gcc/triplet/version. Instead of adding 50 override files for this warning, please could you avoid this warning, or provide a location (maybe the source override file?) where to override this warning once? -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org