Bug#98928: build fails with fakeroot, because LD_LIBRARY_PATH is clobbered
Package: apt
Version: 0.5.3
Severity: wishlist
PROBLEM
bash-2.05$ /usr/bin/fakeroot debian/rules binary
...
dh_installdeb -papt-utils
LD_LIBRARY_PATH=`pwd`/debian/apt/usr/lib:`pwd`/debian/apt-utils/usr/lib dh_shlibdeps -papt-utils -- -Ldebian/shlibs.local.apt-utils
/usr/bin/perl: error while loading shared libraries: libfakeroot.so.0: cannot open shared object file: No such file or directory
make: *** [apt-utils] Error 127
bash-2.05$ pwd
CAUSE
fakeroot was changing recently and now uses LD_LIBRARY_PATH in
addition to LD_PRELOAD. The following is the debian/changelog from fakeroot package:
fakeroot (0.4.4-9.2) unstable; urgency=low
* NMU, for sparc64 environment
* Added debian/rules section to build a 64bit libfakeroot
* Updated libtool, since the old one didn't like the -m64 option with
the --mode=link
* exclude libfakeroot from dh_shlibdeps call. The faked binary provides
all the deps we need, and this avoids the 64bit library from pulling
in libc6-sparc
* fakeroot: Use LD_LIBRARY_PATH for setting directory, and only
LD_PRELOAD the library name. This makes it so the the 32/64 libs for
sparc/sparc64 will load which ever one is needed.
-- Ben Collins <bcollins@debian.org> Fri, 27 Apr 2001 10:14:03 -0400
SOLUTION
Append to LD_LIBRARY_PATH.
SEE ALSO
Bug#98766: Acknowledgement (fakeroot sets LD_LIBRARY_PATH: affects apt build)
In regard to #98766, on Sat, 26 May 2001 07:46:40 -0400, Ben Collins <bcollins@debian.org> writes:
> On Sat, May 26, 2001 at 08:14:07AM +0000, Peter Muir wrote:
> >
> > 1) Set policy: do not overwrite LD_LIBRARY_PATH.
> > 2) Any other method for sparc64 binaries to find the correct library?
> >
>
> Since this doesn't affect many packages, I suggest filing bugs on them
> to not clobber LD_LIBRARY_PATH, but instead append to it.
>
> There is no other method for the 32bit/64bit setup for sparc
> libfakeroot, without causing security problems.
>
> --
> -----------=======-=-======-=========-----------=====------------=-=------
> / Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \
> ` bcollins@debian.org -- bcollins@openldap.org -- bcollins@linux.com '
> `---=========------=======-------------=-=-----=-===-======-------=--=---'
>
PATCH
original version: debian_version_0_5_3
patched version: debian_version_0_5_3-0_1
Index: debian/apt/debian/changelog
diff -u debian/apt/debian/changelog:1.1.1.3 debian/apt/debian/changelog:1.2
--- debian/apt/debian/changelog:1.1.1.3 Sat May 26 18:26:29 2001
+++ debian/apt/debian/changelog Sun May 27 15:05:36 2001
@@ -1,3 +1,9 @@
+apt (0.5.3-0.1) unstable; urgency=low
+
+ * Append to LD_LIBRARY_PATH so fakeroot can build.
+
+ -- Peter Muir <iyhi@yahoo.com> Sun, 27 May 2001 15:03:06 +0000
+
apt (0.5.3) unstable; urgency=low
* JoeyH's dpkg::preconfig not working. Closes: #88675
Index: debian/apt/debian/rules
diff -u debian/apt/debian/rules:1.1.1.3 debian/apt/debian/rules:1.2
--- debian/apt/debian/rules:1.1.1.3 Sat May 26 18:26:29 2001
+++ debian/apt/debian/rules Sun May 27 15:05:36 2001
@@ -187,7 +187,7 @@
dh_fixperms -p$@
dh_installdeb -p$@
dh_shlibdeps -papt -l`pwd`/debian/apt/usr/lib -- -Ldebian/shlibs.local.apt
-# LD_LIBRARY_PATH=`pwd`/debian/apt/usr/lib dh_shlibdeps -papt
+# LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:`pwd`/debian/apt/usr/lib dh_shlibdeps -papt
dh_gencontrol -p$@ -u -Vlibapt-pkg:provides=$(LIBAPTPKG_PROVIDE)
dh_makeshlibs -m$(LIBAPTPKG_MAJOR) -V '$(LIBAPTPKG_PROVIDE)' -papt
dh_md5sums -p$@
@@ -244,7 +244,7 @@
dh_compress -p$@
dh_fixperms -p$@
dh_installdeb -p$@
- LD_LIBRARY_PATH=`pwd`/debian/apt/usr/lib:`pwd`/debian/$@/usr/lib dh_shlibdeps -p$@ -- -Ldebian/shlibs.local.apt-utils
+ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:`pwd`/debian/apt/usr/lib:`pwd`/debian/$@/usr/lib dh_shlibdeps -p$@ -- -Ldebian/shlibs.local.apt-utils
dh_gencontrol -p$@ -u -Vlibapt-inst:major=$(LIBAPTINST_MAJOR)
dh_makeshlibs -m$(LIBAPTINST_MAJOR) -V '$(LIBAPTINST_PROVIDE)' -p$@
dh_md5sums -p$@
SUCCESSFUL BUILD AFTER PATCH
...
dh_installdeb -papt-utils
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/debian/apt/usr/lib:`pwd`/debian/apt-utils/usr/lib dh_shlibdeps -papt-utils -- -Ldebian/shlibs.local.apt-utils
dh_gencontrol -papt-utils -u -Vlibapt-inst:major=1.0
dpkg-gencontrol: warning: unknown substitution variable ${libapt-inst:provides}
dh_makeshlibs -m1.0 -V 'libapt-inst-libc6.2-3-2-1.0' -papt-utils
dh_md5sums -papt-utils
dh_builddeb -papt-utils
dpkg-deb: building package `apt-utils' in `../apt-utils_0.5.3-0.1_i386.deb'.
dpkg-genchanges
dpkg-genchanges: including full source code in upload
dpkg-buildpackage: full upload (original source is included)
Password:
(Reading database ... 117769 files and directories currently installed.)
Preparing to replace apt-utils 0.5.3 (using .../apt-utils_0.5.3-0.1_i386.deb) ...
Unpacking replacement apt-utils ...
Preparing to replace apt 0.5.3 (using .../apt/apt_0.5.3-0.1_i386.deb) ...
Unpacking replacement apt ...
Preparing to replace libapt-pkg-dev 0.5.3 (using .../libapt-pkg-dev_0.5.3-0.1_i386.deb) ...
Unpacking replacement libapt-pkg-dev ...
Preparing to replace libapt-pkg-doc 0.5.3 (using .../libapt-pkg-doc_0.5.3-0.1_all.deb) ...
Unpacking replacement libapt-pkg-doc ...
Setting up apt (0.5.3-0.1) ...
Setting up libapt-pkg-dev (0.5.3-0.1) ...
Setting up libapt-pkg-doc (0.5.3-0.1) ...
Setting up apt-utils (0.5.3-0.1) ...
bash-2.05$
-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux peter 2.4.4 #1 SMP Thu May 24 04:27:09 UTC 2001 i586
Locale: LANG=C, LC_CTYPE=C
Versions of packages apt depends on:
ii libc6 2.2.3-4 GNU C Library: Shared libraries an
ii libstdc++2.10-glibc2.2 1:2.95.4-0.010506 The GNU stdc++ library
ii fakeroot 0.4.4-9.2 Gives a fake root environment.
--
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Reply to: