From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uF8UJLP7x2N0IgEAbAwnHQ (envelope-from ) for ; Wed, 18 Jan 2023 15:01:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GBO2I7P7x2N1bAEAauVa8A (envelope-from ) for ; Wed, 18 Jan 2023 15:01:23 +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 5C58215907 for ; Wed, 18 Jan 2023 15:01:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI907-0006C3-Jm; Wed, 18 Jan 2023 09:01:15 -0500 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 1pI8zu-0006A7-IP for bug-guix@gnu.org; Wed, 18 Jan 2023 09:01:02 -0500 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 1pI8zu-0005oo-8H for bug-guix@gnu.org; Wed, 18 Jan 2023 09:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pI8zu-0003hQ-3p for bug-guix@gnu.org; Wed, 18 Jan 2023 09:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#25235: [PATCH v2 1/1] build-system/pyproject: Do not wrap native-inputs. References: <87eg13birp.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <87eg13birp.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 18 Jan 2023 14:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25235 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 25235@debbugs.gnu.org Cc: arunisaac@systemreboot.net, Maxim Cournoyer , ludo@gnu.org, Lars-Dominik Braun , efraim@flashner.co.il, rekado@elephly.net, jgart , marius@gnu.org Received: via spool by 25235-submit@debbugs.gnu.org id=B25235.167405045414199 (code B ref 25235); Wed, 18 Jan 2023 14:01:02 +0000 Received: (at 25235) by debbugs.gnu.org; 18 Jan 2023 14:00:54 +0000 Received: from localhost ([127.0.0.1]:39892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pI8zm-0003gx-6e for submit@debbugs.gnu.org; Wed, 18 Jan 2023 09:00:54 -0500 Received: from mail-yw1-f170.google.com ([209.85.128.170]:39590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pI8zj-0003gj-3r for 25235@debbugs.gnu.org; Wed, 18 Jan 2023 09:00:52 -0500 Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-4d19b2686a9so340636597b3.6 for <25235@debbugs.gnu.org>; Wed, 18 Jan 2023 06:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/AK/zl6sgkui8TDEDsE+Jy91ApP9Eqqtts/Ib0j/ofo=; b=Agf1LGbH7K7sTsWy+5m36y/cHwrZBjxWtUPsQRl8qnB1JuzZn0+oQkq0MibbBFNeU3 745nBue8lrHb94PkQ3tHKnWOOZxiBZL0nEnln+0Nq57Hl65/goKP8nfEWyiWuV7sbVGC 09UVGsgFeNVSWrwedaBWoEXj4OBLqZK1/tA5X/A1PkEmwvtUTBP5i/pseppvGEt5Z/0C bsybXNdXeelhcqUMwbC/7FAic9g501gWGvCoXKKEJu10yQIi2u+6hvAsJv1NSjSNk8L6 RT5k8azWDwW1ZSMY06NqFBNkGvDAgepHhhDEQlj72p7vafbWhordeZQJpczDO2lgjE3B scPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/AK/zl6sgkui8TDEDsE+Jy91ApP9Eqqtts/Ib0j/ofo=; b=wtUXC9PvBIVoO6mTlGqobzA+Axz5uMG2m27qFad7V5CIra/DGGr1bygt35ps49FjZg XJnKO16R4w54MJ8kyk05m1yU31wBcd5YoU+0AeLFzQo0OK2LCelv9pW1xT+OJkKmAeLI 2TV+7IH+bj03GseVv10r//4fDQz1TRjsLh8LMLw3lnBWlia1HJmI9oDso3u24vkS3fO9 ZJEWSVCGgLar16ZP8utfKoZIppXqAOyoGpAoPBR3BSQ8YGgNrxzzshzmROAoB9Pn3bJE cCjcDX+yAJtNM+8WHtAk2FxzmbiKCi6B+3qXXGJ4SmzwLhxFqs7axKRF09R0mDL6Y0VU eF9Q== X-Gm-Message-State: AFqh2kqUKhypphEj3PlayeFVP/2QJfD/wFSFypjGAJGNENu8fD3cne9B Rqp0gsv4YD8IS54esGwb2ZhOVaagAtbZQv3D X-Google-Smtp-Source: AMrXdXvHLw7SbuNsdCqTN4AoFnjlbZaoIsbq/ZnSDH1PLnzf4+Z2jFdayVjOx0+tHs/p1WFifGnO4A== X-Received: by 2002:a81:1d43:0:b0:373:4bf8:e45d with SMTP id d64-20020a811d43000000b003734bf8e45dmr3184372ywd.20.1674050445326; Wed, 18 Jan 2023 06:00:45 -0800 (PST) Received: from localhost.localdomain (dsl-205-233-125-107.b2b2c.ca. [205.233.125.107]) by smtp.gmail.com with ESMTPSA id u6-20020a05620a0c4600b007054feab4aesm22201475qki.27.2023.01.18.06.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 06:00:44 -0800 (PST) From: Maxim Cournoyer Date: Wed, 18 Jan 2023 09:00:35 -0500 Message-Id: <20230118140036.13436-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674050483; a=rsa-sha256; cv=none; b=e6m0fYAwkuE0ibyEsN/U5qwJlqc8AS16z0/A5p8epuHhv8C2fq8Aqjw+ocn0Y1Y/+zFJaU tC3WzE8wNRKPp9K16CpUpAaIKIZ1F2DRE5LeMaYAfUqQv6DAAK5ui12NrESJDmDTd0C8Ij 2SiA//9ry4Duw3wNFHOn1iUIbGusPD83H9AKypWo7a1TIIKaYslwfCNEcVZ127pUXkUBTz xrMtMWX8yp2orhcYpI1jyq+9vFZtjJF2JHyEwbsyCdJ+idHDXSakj1bEs27vVd0qW+bjS2 FZsD8VErgwn96JMcMNVxwRHJJlPITNJFptjjyWqHPtiPh08VmlfbUInOx6MqQA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Agf1LGbH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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=1674050483; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=/AK/zl6sgkui8TDEDsE+Jy91ApP9Eqqtts/Ib0j/ofo=; b=oH0QGDc8woo+KqI87do4VO7bSS03TrxNMaaNBlS75PxRnVyu0Z1Wr7owyiYCfKoQ309bmR 6kyyXhxO4XOIGNSzxttvD4Nq6fJA694UchETo2JYN4TUc5kNvBBmzfD5Uyj2Hx4Rd3Wht3 CT4gZsvJ90Wucl/4AwBjfQHHWxVkB07EwhB7+ddm0JHHUFb4X6h1O/wN5gVaJYk2PChMYn Jm4i/JykFglo9vKAAu2WbFW6viycx0stjwZXPxr5z9EHnlUygIdEQ5IQgFzVbajfitPJm+ 0HtNBv/N7rhwDNfv28z1+5DCR9T0LK0s0X5RBt0UYChDU9XoJMTkpg7NbuExFQ== X-Spam-Score: 7.47 X-Migadu-Queue-Id: 5C58215907 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Agf1LGbH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: 7.47 X-TUID: 3J/7Y1k2ZXsc Fixes . * guix/build/pyproject-build-system.scm (wrap) [native-inputs]: New argument. Filter out native inputs from the values in GUIX_PYTHONPATH. --- Changes in v2: - Add missing copyright line - Rework wrap phase to avoid removing inputs found in both native-inputs and inputs - Enclose wrap computations in an 'unless' form and streamline guix/build/pyproject-build-system.scm | 39 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm index a66c1fb34a..9da86bfc54 100644 --- a/guix/build/pyproject-build-system.scm +++ b/guix/build/pyproject-build-system.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Lars-Dominik Braun ;;; Copyright © 2022 Marius Bakke +;;; Copyright © 2023 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -445,7 +446,7 @@ (define* (add-install-to-pythonpath #:key native-inputs outputs "A phase that just wraps the 'add-installed-pythonpath' procedure." (add-installed-pythonpath native-inputs outputs)) -(define* (wrap #:key inputs outputs #:allow-other-keys) +(define* (wrap #:key native-inputs inputs outputs #:allow-other-keys) (define (list-of-files dir) (find-files dir (lambda (file stat) (and (eq? 'regular (stat:type stat)) @@ -458,20 +459,28 @@ (define bindirs (string-append dir "/sbin")))) outputs)) - ;; Do not require "guile" to be present in the package inputs - ;; even when there is nothing to wrap. - ;; Also, calculate (guile) only once to prevent some I/O. - (define %guile (delay (search-input-file inputs "bin/guile"))) - (define (guile) (force %guile)) - - (let* ((var `("GUIX_PYTHONPATH" prefix - ,(search-path-as-string->list - (or (getenv "GUIX_PYTHONPATH") ""))))) - (for-each (lambda (dir) - (let ((files (list-of-files dir))) - (for-each (cut wrap-script <> #:guile (guile) var) - files))) - bindirs))) + (unless (null? bindirs) + (let* ((guile (search-input-file inputs "bin/guile")) + (native-input-dirs (match native-inputs + (((_ . dir) ...) + dir))) + (input-dirs (match inputs + (((_ . dir) ...) + dir))) + (build-inputs (lset-difference string=? native-input-dirs + input-dirs)) + ;; A build input is an input listed in native-inputs and NOT in + ;; inputs. + (build-input? (lambda (x) + (any (cut string-prefix? <> x) build-inputs))) + (var `("GUIX_PYTHONPATH" prefix + ,(remove build-input? (search-path-as-string->list + (or (getenv "GUIX_PYTHONPATH") "")))))) + (for-each (lambda (dir) + (let ((files (list-of-files dir))) + (for-each (cut wrap-script <> #:guile guile var) + files))) + bindirs)))) (define* (rename-pth-file #:key name native-inputs outputs #:allow-other-keys #:rest args) -- 2.39.1