Bug#948589: nmu: file_1:5.38-3
On Fri, 10 Jan 2020 16:58:22 +0100 Christoph Biedl <debian.axhn@manchmal.in-ulm.de> wrote:
> Helmut Grohne wrote...
>
> > The file package was built with a broken version file wrt #948269. As
> > such libmagic1 lacks shared library dependencies. A simple rebuild fixes
> > the problem.
>
> This leaves me somewhat confused since I understand your rationale
> the file package needs itself to be built, in other words, a circular
> build dependency. This should not happen, and I'd like to eliminate
> that.
>
> Mind to shed some light on this? How was libmagic wrongly built, how did
> this manifest?
binary debdiff of bad and good libmagic1 builds:
File lists identical (after any substitutions)
Control files: lines which differ (wdiff format)
------------------------------------------------
Depends: {+libbz2-1.0, libc6 (>= 2.15), liblzma5 (>= 5.1.1alpha+20120614), zlib1g (>= 1:1.1.4),+} libmagic-mgc (= [-1:5.38-3.bad)-] {+1:5.38-3.good)+}
Version: [-1:5.38-3.bad-] {+1:5.38-3.good+}
The bad one was done with 1:5.38-2, the good one with 1:5.38-3 installed.
> (You might have noted the file build overrides dh_shlibdeps -
> appearently this is not enough?)
dh_shlibdeps (any maybe other dh_*) call 'file' - the (buggy?) version
installed in the system, not the freshly built one.
Attached patch is a hack to prepend a 'file' wrapper script in the path
that uses the freshly built one (I hope I did the call right?), this allows
for a correct libmagic1 package to be built even in the presence of the buggy
1:5.38-2 in the system by using the new file command during the later stages
of the build process.
It's probably not cross-build safe, though.
Andreas
diff -Nru file-5.38/debian/changelog file-5.38/debian/changelog
--- file-5.38/debian/changelog 2020-01-06 12:22:22.000000000 +0100
+++ file-5.38/debian/changelog 2020-01-10 21:32:05.000000000 +0100
@@ -1,3 +1,9 @@
+file (1:5.38-3.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+
+ -- Andreas Beckmann <anbe@debian.org> Fri, 10 Jan 2020 21:32:05 +0100
+
file (1:5.38-3) unstable; urgency=medium
* Revert upstream commit "... count as dynamically linked only the
diff -Nru file-5.38/debian/rules file-5.38/debian/rules
--- file-5.38/debian/rules 2018-02-07 23:56:07.000000000 +0100
+++ file-5.38/debian/rules 2020-01-10 21:32:05.000000000 +0100
@@ -2,6 +2,9 @@
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+# Use the just built file command for dh_shlibdeps and friends
+export PATH:=$(CURDIR)/debian/just-built:$(PATH)
+
# HOWMANY is the number of bytes looked at by file
CFLAGS += -DHOWMANY=0x18000
@@ -33,8 +36,16 @@
# Remove useless files
rm -f debian/tmp/usr/lib/*/*.la
+ mkdir -p debian/just-built
+ echo '#!/bin/sh\nLD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) exec $(CURDIR)/debian/tmp/usr/bin/file -m $(CURDIR)/debian/tmp/usr/share/file/magic.mgc "$$@"' > debian/just-built/file
+ chmod +x debian/just-built/file
+
override_dh_missing:
dh_missing --fail-missing
override_dh_shlibdeps:
dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib
+
+override_dh_auto_clean:
+ dh_auto_clean
+ $(RM) -r debian/just-built
Reply to: