Subject: Re: bug#43491: Fakechroot execution engine can fail to find libraries

From: Ludovic Courtès <[email-masked]>
Date: Fri, 17 Mar 2023 18:03:31 +0100

Reopening this old bug from this commit:

--8<---------------cut here---------------start------------->8---
$ guix describe
Generation 250	Mar 12 2023 23:58:03	(current)
  guix 1ed227d
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 1ed227d7952af48efe50a2f6c9537e17c356daa1
--8<---------------cut here---------------end--------------->8---

> I pushed this as a workaround as commit
> 58abd5873985e0cd9a2926867bf697c5e7bc01f9.
>
> The ld.so issue is still open but there seems to be consensus that it’s
> a bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=26634>.

Commit 58abd5873985e0cd9a2926867bf697c5e7bc01f9 appears to be
incomplete.

Let’s suppose this:

  (mkdir /tmp/fakechroot-test && cd ~/tmp/fakechroot-test/ && \
   tar xf $(guix pack --save-provenance -RR openmpi intel-mpi-benchmarks bash-minimal -S /bin=bin))

The motivating example at the beginning of this thread works fine:

--8<---------------cut here---------------start------------->8---
$ unshare -m -U -r -f sh -c 'mount -t tmpfs none /gnu; GUIX_EXECUTION_ENGINE=fakechroot /tmp/fakechroot-test/bin/orterun --version'
orterun (OpenRTE) 4.1.4

Report bugs to http://www.open-mpi.org/community/help/
--8<---------------cut here---------------end--------------->8---

… but this doesn’t:

--8<---------------cut here---------------start------------->8---
$ unshare -m -U -r -f sh -c 'mount -t tmpfs none /gnu; GUIX_EXECUTION_ENGINE=fakechroot /tmp/fakechroot-test/bin/IMB-MPI1'
/tmp/fakechroot-test/gnu/store/i9ypns78lmy8xr0x4zvdwc4b80m0yl72-intel-mpi-benchmarks-2019.6/bin//IMB-MPI1: error while loading shared libraries: libevent_core-2.1.so.7: cannot open shared object file: No such file or directory
--8<---------------cut here---------------end--------------->8---

Reason appears to be that ‘LOADER_AUDIT_RUNPATH’ only contains what’s in
the RUNPATH of ‘IMB-MPI1’ and not its indirect dependencies—libevent is
one of them.

Ludo’.