[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1007764: gcc-defaults: please support DPKG_ROOT



(my last mail to doko@debian.org bounced with "retry timeout exceeded" so I'm
trying again with the ubuntu.com address as well)

Hi,

On Wed, 16 Mar 2022 13:30:26 +0100 Johannes Schauer Marin Rodrigues <josch@debian.org> wrote:
> when creating chroots for new architectures that are in the process of being
> bootstrapped without yet having emulation support from qemu, it is not
> possible to run maintainer scripts inside the foreign architecture chroot
> because foreign architecture ELF binaries cannot be executed. The solution to
> that problem is to run maintainer scripts from outside the chroot and use the
> DPKG_ROOT environment variable to instruct the maintainer script on which
> chroot to operate. By default, for normal installations, that environment
> variable is set, but empty.
> 
> Apart from init-system-helpers and pam, all packages in the
> Essential:yes set have support for DPKG_ROOT already. To start building
> packages we also need to install build-essential.
> 
> Please consider applying the patch from this merge request:
> 
> https://salsa.debian.org/toolchain-team/gcc-defaults/-/merge_requests/4
> 
> We tested it in our CI environment and it produces a bit-by-bit
> identical chroot with DPKG_ROOT compared to a normal installation.
> 
> https://salsa.debian.org/helmutg/dpkg-root-demo/
> 
> Since the DPKG_ROOT variable is empty on normal installations, the patch
> should have no effect in the normal case.

I wanted to send a friendly ping about this bug. I see that since I filed this
bug, you uploaded three new versions of gcc-defaults. Please consider applying
the changes of above merge request against gcc-defaults on salsa. Here is the
diff in plain text for your convenience:

--- a/debian/g++.postinst.in
+++ b/debian/g++.postinst.in
@@ -2,9 +2,9 @@

 # remove the doc dir, if it's still a directory and replace with a symlink
 pkg=`basename $0 .postinst`
-if [ ! -L  /usr/share/doc/$pkg ]; then
-    rm -rf /usr/share/doc/$pkg
-    ln -s cpp /usr/share/doc/$pkg
+if [ ! -L  "$DPKG_ROOT/usr/share/doc/$pkg" ]; then
+    rm -rf "$DPKG_ROOT/usr/share/doc/$pkg"
+    ln -s cpp "$DPKG_ROOT/usr/share/doc/$pkg"
 fi

 # fix for report #138038: remove old diversions

Attachment: signature.asc
Description: signature


Reply to: