From patchwork Mon May 11 17:05:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 22000 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4072327BBE3; Mon, 11 May 2020 18:07:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id F39D327BBE1 for ; Mon, 11 May 2020 18:07:08 +0100 (BST) Received: from localhost ([::1]:51726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYBtU-0001Fa-EO for patchwork@mira.cbaines.net; Mon, 11 May 2020 13:07:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYBtO-0001EU-BU for guix-patches@gnu.org; Mon, 11 May 2020 13:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYBtO-0000gv-1z for guix-patches@gnu.org; Mon, 11 May 2020 13:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYBtN-0001VX-TG for guix-patches@gnu.org; Mon, 11 May 2020 13:07:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41189] [PATCH 0/3] Add Fakechroot engine for 'guix pack -RR' Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 11 May 2020 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41189 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41189@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15892167715734 (code B ref -1); Mon, 11 May 2020 17:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 May 2020 17:06:11 +0000 Received: from localhost ([127.0.0.1]:53123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYBsY-0001UO-2m for submit@debbugs.gnu.org; Mon, 11 May 2020 13:06:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:55082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYBsT-0001UD-Qd for submit@debbugs.gnu.org; Mon, 11 May 2020 13:06:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYBsT-0000KH-LC for guix-patches@gnu.org; Mon, 11 May 2020 13:06:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41485) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYBsT-0000a1-BV; Mon, 11 May 2020 13:06:05 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38072 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYBsP-0004hL-0l; Mon, 11 May 2020 13:06:04 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 11 May 2020 19:05:54 +0200 Message-Id: <20200511170554.22916-1-ludo@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Guix! ‘guix pack -RR’ is wonderful, as we know ;-), because it produces binaries that work everywhere. However, the overhead of PRoot is sometimes inappropriate, in particular for those who want to run packed software on high-performance computers, the very kind of machine that lacks Guix and unprivileged user namespaces. This patch series adds an optional “execution engine” to wrappers that uses ld.so and fakechroot LD_PRELOAD trickery. Since it’s just LD_PRELOAD, there’s very little overhead, unlike PRoot. On the flip side, it doesn’t work as well as PRoot, because it’s “just” LD_PRELOAD. For example, some of the ‘open’ calls made in libc are not intercepted; on such call is in ‘__gconv_load_cache’, which makes it fail, and in turn makes Guile fail to start in its first ‘scm_to_locale_string’ call. Things that work well include Bash and Python 3. Let me know how well it works for your favorite application! The execution engine can now be chosen at run time by setting the ‘GUIX_EXECUTION_ENGINE’. For the record, tools like udocker support a similar range of execution engines: . Feedback welcome! Thanks, Ludo’. Ludovic Courtès (3): pack: Wrapper honors 'GUIX_EXECUTION_ENGINE' environment variable. gnu: Add fakechroot. pack: Add relocation via ld.so and fakechroot. doc/guix.texi | 43 +++- gnu/packages/aux-files/run-in-namespace.c | 250 ++++++++++++++++++++-- gnu/packages/linux.scm | 30 +++ guix/scripts/pack.scm | 65 +++++- tests/guix-pack-relocatable.sh | 23 ++ 5 files changed, 376 insertions(+), 35 deletions(-)