From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id uL9LLUSlFWQJawEASxT56A (envelope-from ) for ; Sat, 18 Mar 2023 12:49:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mPs0LUSlFWQkOwAA9RJhRA (envelope-from ) for ; Sat, 18 Mar 2023 12:49:24 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 32BBE3D39E for ; Sat, 18 Mar 2023 12:49:24 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=ldsZvskh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=inria.fr (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679140164; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=XWNW7+WhWmoCEPFiiLNpr0ui96pVrAYwwib8sJFJky0=; b=G94Ua1JCC33gvjcvblEJ5FBrUdiAiV70QsOxxN5A8I99v37PCvdJnTomNYegSN/oLG3baP Uhle7NeXL22NIit5fBLLAajBBFDJZgX+xP+yM7Pvg0srOn76Yad+Ss7EEgTfdJU3omeoAD fjPU0et4WOKCNwYBLHwPVSTzPd9+oMQbAsaSGtkw/6NQ0BT3LbW0Bqc0E3PmUGCNsDGVPM QcaRwGX/M6o+S/xGoMOvT+JVBFXpSxWKw6LzHLn0sQYo29/mRYj75Z0di2/EPsgrwplQmj j4pE2XSsua5ALzSeA0ZfR0kwXR0ZNTYPjdfph7R85xh02wgX2r3wqH6k+lPtpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=ldsZvskh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=inria.fr (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679140164; a=rsa-sha256; cv=none; b=p/9vhbN6VLdJ3b4a0HK/AnJX+emfcJPe4JMbi2jv1ObefwhaXGWiE1rCJT8qF8o2KwkcgA cEhQ9J+JuUTeYBJyDSflv5mDZ1JEAXwIc3cHUIQc3YHuTfV+xJJdMSoNDxjSR9HmSD5Qsn Yme9Jft3D+8QNeWRoj8xNo8wMa/lbqn7JYsrVWIuCNJ3FuWCvGszQ508Bee3Gz61dzbSPS nQ7S5GI31RxGaNdAabIC4wcZWynlh9S/REiMwW38El272KWImjB078RQdi4ktb4RdOoA0B EmgnH371Ebz05vw7gFMiuIU5gTdxT5NloBP8kznfe+duLj+qqKayg8izU9Aehw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdV3l-0002XG-Iz; Sat, 18 Mar 2023 07:49:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdV3W-0002Cb-LW for bug-guix@gnu.org; Sat, 18 Mar 2023 07:49:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pdV3W-0007ar-DQ for bug-guix@gnu.org; Sat, 18 Mar 2023 07:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pdV3W-0000oz-0j for bug-guix@gnu.org; Sat, 18 Mar 2023 07:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#62253: Fakechroot execution engine =?UTF-8?Q?doesn=E2=80=99t?= outlive =?UTF-8?Q?=E2=80=98exec=E2=80=99?= calls Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 18 Mar 2023 11:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62253 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 62253@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16791401223131 (code B ref -1); Sat, 18 Mar 2023 11:49:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Mar 2023 11:48:42 +0000 Received: from localhost ([127.0.0.1]:46461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdV3C-0000oP-1b for submit@debbugs.gnu.org; Sat, 18 Mar 2023 07:48:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:59298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdV3A-0000oH-6G for submit@debbugs.gnu.org; Sat, 18 Mar 2023 07:48:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdV39-0008Le-Lw for bug-guix@gnu.org; Sat, 18 Mar 2023 07:48:39 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdV37-0007Xq-B5 for bug-guix@gnu.org; Sat, 18 Mar 2023 07:48:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=XWNW7+WhWmoCEPFiiLNpr0ui96pVrAYwwib8sJFJky0=; b=ldsZvskh3q+0YIdAMDiPILi3DN2hae75S/UnB++EIiFNx9nFlHCuN8Hb Gz9jsSTchXLXtnDP6BOqlDtIEKCeYFHHlv6pYque7bqToBl2P9KCpkOlQ gtqCzTyzPndRH9PB9RD+vxw40rE37zHv+ht0FpFWQVOi13Zc5qlnTao/J Q=; X-IronPort-AV: E=Sophos;i="5.98,271,1673910000"; d="scan'208";a="97878166" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2023 12:48:32 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 28 =?UTF-8?Q?Vent=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Capillaire X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 18 Mar 2023 12:48:32 +0100 Message-ID: <877cveuvov.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=192.134.164.83; envelope-from=ludovic.courtes@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: X-Migadu-Queue-Id: 32BBE3D39E X-Spam-Score: -3.45 X-Migadu-Spam-Score: -3.45 X-Migadu-Scanner: scn0.migadu.com List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: QEQ8L1UOCF5O For =E2=80=98guix pack -RR=E2=80=99 packs, unlike the =E2=80=9Cuserns=E2=80= =9D and =E2=80=9Cproot=E2=80=9D execution engines, the =E2=80=9Cfakechroot=E2=80=9D execution engine doesn=E2=80=99t = survive =E2=80=98exec=E2=80=99 calls: --8<---------------cut here---------------start------------->8--- $ mkdir -p /tmp/fakechroot-test && cd /tmp/fakechroot-test/ && tar xf $(gui= x pack -RR openmpi intel-mpi-benchmarks bash-minimal -S /bin=3Dbin) $ unshare -m -U -r -f sh -c 'mount -t tmpfs none /gnu; GUIX_EXECUTION_ENGIN= E=3Dfakechroot /tmp/fakechroot-test/bin/bash' bash-5.1# echo /gnu/store/*coreutils*/bin/ls /gnu/store/d251rfgc9nm2clzffzhgiipdvfvzkvwi-coreutils-8.32/bin/ls /gnu/stor= e/vqdsrvs9jbn0ix2a58s99jwkh74124y5-coreutils-minimal-8.32/bin/ls bash-5.1# test -f /gnu/store/*coreutils-8*/bin/ls bash-5.1# echo $? 0 bash-5.1# /gnu/store/*coreutils-8*/bin/ls bash: /gnu/store/d251rfgc9nm2clzffzhgiipdvfvzkvwi-coreutils-8.32/bin/ls: No= such file or directory --8<---------------cut here---------------end--------------->8--- This is because the ELF interpreter of the unwrapped =E2=80=98ls=E2=80=99 b= inary remains /gnu/store/=E2=80=A6-glibc-2.33/lib/ld-linux-x86-64-so.2 and no LD_PRELOAD interposition can address that. In this case, adding =E2=80=98coreutils=E2=80=99 to the profile (on the =E2= =80=98guix pack=E2=80=99 command line) would give us wrapped binaries, and the problem is solved. But in other cases, it=E2=80=99s not that simple. For instance, libmpi.so = from Open=C2=A0MPI tries to exec one its programs, using its absolute file name: --8<---------------cut here---------------start------------->8--- $ unshare -m -U -r -f sh -c 'mount -t tmpfs none /gnu; GUIX_EXECUTION_ENGIN= E=3Dfakechroot /tmp/fakechroot-test/bin/IMB-MPI1' -------------------------------------------------------------------------- The singleton application was not able to find the executable "orted" in your PATH or in the directory where Open MPI/OpenRTE was initially installe= d, and therefore cannot continue. For reference, we tried the following command: /gnu/store/c7g9qalmbz4a94hwzk1v1cbq7n5m8plq-openmpi-4.1.4/bin/orted and got the error No such file or directory. [=E2=80=A6] --8<---------------cut here---------------end--------------->8--- I can think of several ways to address that: 1. Change the exec* wrappers in libfakechroot such that, on ENOENT, they try a direct ld.so invocation to run program, like =E2=80=98run-in-namespace.c=E2=80=99 does. Problem is that for this to work correctly, it would need to compute the =E2=80=98--library-path=E2=80=99 argument at run time, by = computing the equivalent of (map dirname (file-needed/recursive program)). Impractical at best. 2. Wrap/graft every package in the closure (as opposed to generating wrappers for just those packages that appear in the profile, which is what =E2=80=98guix pack=E2=80=99 currently does). The downside is that the =E2=80=9Cuserns=E2=80=9D and =E2=80=9Cproot= =E2=80=9D execution engines don=E2=80=99t need something this heavyweight: they just need a leaf package to be wrapped. 3. Ignore the problem. After all, we=E2=80=99re talking about a corner c= ase of the =E2=80=9Cfakechroot=E2=80=9D engine, which is a niche within a = niche. Food for thought=E2=80=A6 Ludo=E2=80=99.