From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 wClDGRyNzmOExgAAbAwnHQ (envelope-from ) for ; Mon, 23 Jan 2023 14:35:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EEp5GByNzmP2wwAAG6o9tA (envelope-from ) for ; Mon, 23 Jan 2023 14:35: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 0B08815093 for ; Mon, 23 Jan 2023 14:35:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJwyc-0005SJ-Fj; Mon, 23 Jan 2023 08:35:12 -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 1pJwyV-0005Pt-C5 for bug-guix@gnu.org; Mon, 23 Jan 2023 08:35:04 -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 1pJwyV-0001qr-2y for bug-guix@gnu.org; Mon, 23 Jan 2023 08:35:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJwyU-0000tv-Tz for bug-guix@gnu.org; Mon, 23 Jan 2023 08:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#25235: [PATCH v3 1/1] build-system/pyproject: Do not wrap native-inputs. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 23 Jan 2023 13:35: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.16744808873428 (code B ref 25235); Mon, 23 Jan 2023 13:35:02 +0000 Received: (at 25235) by debbugs.gnu.org; 23 Jan 2023 13:34:47 +0000 Received: from localhost ([127.0.0.1]:53673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJwyE-0000tE-VV for submit@debbugs.gnu.org; Mon, 23 Jan 2023 08:34:47 -0500 Received: from mail-qv1-f45.google.com ([209.85.219.45]:35814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJwyC-0000sp-8B for 25235@debbugs.gnu.org; Mon, 23 Jan 2023 08:34:45 -0500 Received: by mail-qv1-f45.google.com with SMTP id i12so9082161qvs.2 for <25235@debbugs.gnu.org>; Mon, 23 Jan 2023 05:34:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ulA8p0kw1QPAIbxw8h0W803/vAbfgYZP26cBHN8CtkU=; b=WeK9saqlcc2nUoLeWb9KFQFe8dBJUUWNmTpAra7aXiSKWQzCAc17o2SdXiSHJ4IOQX COuRY3NjFyWuAKYUV2A9di1jsXIHEusA6KImmnSaY5aY9GcLafsW2yeQFsKe0YpyxxkF moJnxOXJB1KKOE/o8bP3FMtnyXI66r+vSf37EvDMGHYkxv3HDtxy/IfFKidUc9KN265K cRYqHHlmhEgsTGnEZ6NEeL1RHpnKHhUJLI3nOjVP44beDe8GkLdKVee6UBcjfFJG/YMa LzgDWlVI6eZp3gH579McjfVFNmBs8EcPD5Ou1dYQ3PNK4ZZ3lk1bt+jwUHVu/LhQSpHI QtQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ulA8p0kw1QPAIbxw8h0W803/vAbfgYZP26cBHN8CtkU=; b=PxHg9BODBgNXTpljuylV7Adxzq89z7LkwnBeiiHPMXS4KAT9Um1VOwwSqYZ90VTYIq qpd6M3x8yiDtnvG/WbBvC0UNc8pM5XmcVg1Y3WEaU3/y6Tox7gzPWVGEtUbcj49t8MoG fb0yRrYZnbFLAJb2ElapdFYGKrhJe3tSHvwqg/XLUhypIsyy57lckoWUO0zwIprMhMZf dDU0Z4o7cX7dxZr7DlAH7ZJC8XvVqqSvkojig94LUmq1x/KrmlngKeWBXcxcKs+XW18B krADKhOP99sWwdQPPGZmfmiQUgh2CBEo11HWC+o3h59r8fh6NC14MusCgiz5NcS+JomZ Nhdw== X-Gm-Message-State: AFqh2kqBuuz+oz0gd5/6l6llHyRJoK3kE7A5odB4JfVN+VU0NdqTNNBL tJ99SEspA5rsgilthM2N5nhN8X0+alNiOdN8 X-Google-Smtp-Source: AMrXdXvMVf3ejU3KumNHJDhG+NwoPD4z3Bo7WK8NKd6RLVP/9+9747W0UMeYJwm3ZvtTIkAGjtSdyQ== X-Received: by 2002:ad4:4181:0:b0:535:5a91:f4c8 with SMTP id e1-20020ad44181000000b005355a91f4c8mr19042592qvp.49.1674480878636; Mon, 23 Jan 2023 05:34:38 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id x15-20020a05620a448f00b006ea7f9d8644sm32165615qkp.96.2023.01.23.05.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 05:34:38 -0800 (PST) From: Maxim Cournoyer Date: Mon, 23 Jan 2023 08:34:33 -0500 Message-Id: <20230123133434.1852-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123133434.1852-1-maxim.cournoyer@gmail.com> References: <20230123133434.1852-1-maxim.cournoyer@gmail.com> 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-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=WeK9saql; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674480924; a=rsa-sha256; cv=none; b=dueyZl+RfLID9i+PJreUZxW4zBjrwd7RCHmPJPTFw0pGnHu3g7DnUyXJ6BtF1BqqaU23Lu MLF0S80ZOYRNqxeP353GKtVhEUjNpsxSydKWspBVM2w0wuoKvttj/IcZVcyPBV20+KMsKG guYvm2r5e76b5Zld9OltycZwmr6wyxA7zvtx0XDJMfEZneKADhaeUkPf3xUoTJZN2aVVEL QWiZoujK62Dit+bjwuUwSjhYZxiMf545HozdX41v4M/8hC1l6XWmp5QAQ11l1HBBe6tSzN Bpoe5DS8xgSak4LmDXwxIEjDRiqMRBrRCck8KDTAizYM6VeAXsrTwWI6I2b7cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674480924; 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=ulA8p0kw1QPAIbxw8h0W803/vAbfgYZP26cBHN8CtkU=; b=ulxF5jXCMtlwMQrovb+iqoVrJSu81reV/ZzgsqniNkOZUU3ZRp4DKnAvf3daypWnUBRmEL MtjNp4i1C8sgp+J1PNilecYMgBK/m8wMf4BOfz8t+cBLPr7RwcNmQ52mJFKLYrV2SGEfij HUhl1aeQnAo0mLlQRNQfNJoAnL2HvYm04YJxzUWEH1Cn/0u9Y8XageSoCToFJfkWCn+JNH eXTnjGfk1iSYK5+26E014Y+PAMxkvy9rWpLcfvQHwxGY53he7Xhbu65cyTWVj68TVHSdbs RuiFek6uzitI86q6Migwe6uEq5+JsAMPQ66MI6Nql1lc2/+2lKcLaSuglytWbg== X-Spam-Score: -2.08 X-Migadu-Queue-Id: 0B08815093 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=WeK9saql; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-Migadu-Spam-Score: -2.08 X-TUID: 3Yhmu+aGqYWO Fixes . * guix/build/pyproject-build-system.scm (wrap) [native-inputs]: New argument. Filter out native inputs from the values in GUIX_PYTHONPATH. --- Changes in v3: - Rebase 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