From patchwork Sat Jun 6 09:00:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22564 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 CF87D27BBE3; Sat, 6 Jun 2020 10:01:08 +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.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID,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 5BCEB27BBE1 for ; Sat, 6 Jun 2020 10:01:08 +0100 (BST) Received: from localhost ([::1]:59048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhUhP-0001Fo-Qs for patchwork@mira.cbaines.net; Sat, 06 Jun 2020 05:01:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhUhK-0001Fe-CZ for guix-patches@gnu.org; Sat, 06 Jun 2020 05:01:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhUhK-0007S9-3a for guix-patches@gnu.org; Sat, 06 Jun 2020 05:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhUhK-0007JO-1A for guix-patches@gnu.org; Sat, 06 Jun 2020 05:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41734] [PATCH] gnu: sudo: Separate Python output. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 06 Jun 2020 09:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41734 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41734@debbugs.gnu.org Cc: Mathieu Othacehe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159143402828055 (code B ref -1); Sat, 06 Jun 2020 09:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Jun 2020 09:00:28 +0000 Received: from localhost ([127.0.0.1]:50685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhUgm-0007IR-BP for submit@debbugs.gnu.org; Sat, 06 Jun 2020 05:00:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:33110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhUgk-0007IK-U5 for submit@debbugs.gnu.org; Sat, 06 Jun 2020 05:00:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhUgk-00017v-K9 for guix-patches@gnu.org; Sat, 06 Jun 2020 05:00:26 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:50630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhUgj-0007K3-FP; Sat, 06 Jun 2020 05:00:26 -0400 Received: by mail-wm1-x344.google.com with SMTP id v19so10512544wmj.0; Sat, 06 Jun 2020 02:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=R07Wp8G2eBZauvIE7MseLhWmwPrZafZeWszLfr/XgFE=; b=qx4PcLE/+37tTdHco+dIeQYqeljPwLPl3mHvKnykjEIFhPcaN9LowPdgff4fSTqROC SX7AMJI1oOJT3G/UosAjVL+CEnbIMOtEPCSpn6cvyOtK7Id80fbtZSZJsfrYpsG2tymG 6vQLRvLrqedbDxr6xpHfyMQYSF9DxiH24SoSpmwlGltd8ccZAEMIUxz9lWpNflDCBYX0 Qi83r7I62xF2CPle/Of1ArCIpqNR5O/Y2FLI68NnlKqlE0MyClYYM6PJJjLJssrq9Kmg PEFh9O24Gt60no3V1vzv9+LLvtaxxUcOYyES3q6+Y4yO7keihhccvownKjh/m0O8ji2g jd6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=R07Wp8G2eBZauvIE7MseLhWmwPrZafZeWszLfr/XgFE=; b=thJMisJpABAJtDehnyuaFDSkEXO82SG8+UoGC82XHiDzuumEmHyZn1Ba8GsrYKYcXJ ZNgcMks0V5fh/RgXnhcbPqZeAQW9uxrL/dRpF2qidKlSexlKKmtunp4Voab2TgIVrXK2 w6Lqcj5pSLdHoLxKXVbWKNlKvJLVg+1tSZbf7HorWRDRmzmWzl1XQoGyx9N84MLZFDoM l7K5tWFK34T/rDcSXOA5UYPLQJsmRu6If0Dzs35Jrh4WZp1yhsG9QFdMpnAhYHocZ0qd nz3EhdZO0uPdxoL/kTP38D2P2sgfZaq6qEEP9SXRykzY1v/ZHY8gTjGBilci+3Z/iDR8 6Opw== X-Gm-Message-State: AOAM531sAOayBT+Jr9VQvJYNMMJsDLLUy9/7WMi9c9iwjHqRpKHDEHRF Wt0jRkQm0yEZkeFLwhjHUyNiSCqlS80= X-Google-Smtp-Source: ABdhPJzo4Y0Rouet/4Myw4zDF34mj7hszKx9ZB/YzEa9LTUsEUB291iqmw0v1M+VI2jg50egKm2SxQ== X-Received: by 2002:a7b:c7d8:: with SMTP id z24mr6375433wmk.28.1591434022570; Sat, 06 Jun 2020 02:00:22 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:809b:e323:9e90:279b]) by smtp.gmail.com with ESMTPSA id x205sm15569384wmx.21.2020.06.06.02.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jun 2020 02:00:21 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Sat, 6 Jun 2020 11:00:14 +0200 Message-Id: <20200606090014.12578-1-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=m.othacehe@gmail.com; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 The Python plugin of "sudo" drag the Python interpreter to the closure of Guix System. Put it in a separate output. * gnu/packages/admin.scm (sudo)[arguments]: Add a 'separate-python-output phase. --- Hello, Here's a patch to remove Python from the Guix Sytem closure. As Python cross-compilation is broken, the "python" output cannot be populated when cross-compiling. This is not great. An alternative would be not to provide "python" output when cross-compiling but that requires to turn "output" into a thunk field, and I been advised not to do that (for performance reasons) in the past. WDYT? Thanks, Mathieu gnu/packages/admin.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 77981e520a..9d9d70c88d 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -1375,6 +1375,7 @@ system administrator.") (delete-file-recursively "lib/zlib") #t)))) (build-system gnu-build-system) + (outputs (list "out" "python")) (arguments `(#:configure-flags (list (string-append "--docdir=" (assoc-ref %outputs "out") @@ -1432,7 +1433,23 @@ system administrator.") (substitute* "plugins/sudoers/Makefile.in" (("^pre-install:" match) (string-append match "\ndisabled-" match))) - #t))) + #t)) + (add-after 'install 'separate-python-output + (lambda* (#:key target outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (out:python (assoc-ref outputs "python"))) + ;; Python cross-compilation is not working. + (if target + (mkdir-p (string-append out:python "/empty")) + (for-each + (lambda (file) + (let ((old (string-append out "/" file)) + (new (string-append out:python "/" file))) + (mkdir-p (dirname new)) + (rename-file old new))) + (list "libexec/sudo/python_plugin.so" + "libexec/sudo/python_plugin.la"))) + #t)))) ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but ;; the chroot's /etc/passwd doesn't have it. Turn off the tests.