From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +JrUH+vDxmMXPwEAbAwnHQ (envelope-from ) for ; Tue, 17 Jan 2023 16:51:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CMm+H+vDxmO8NwEAauVa8A (envelope-from ) for ; Tue, 17 Jan 2023 16:51:07 +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 18D7717877 for ; Tue, 17 Jan 2023 16:51:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHoEV-0006K8-Os; Tue, 17 Jan 2023 10:50:43 -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 1pHoDr-00068Z-8K for bug-guix@gnu.org; Tue, 17 Jan 2023 10:50: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 1pHoDq-0008HI-IE for bug-guix@gnu.org; Tue, 17 Jan 2023 10:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pHoDp-0005yk-Ti for bug-guix@gnu.org; Tue, 17 Jan 2023 10:50:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#25235: [PATCH 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: Tue, 17 Jan 2023 15:50:01 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: arunisaac@systemreboot.net, 25235@debbugs.gnu.org, Lars-Dominik Braun , rekado@elephly.net, jgart , marius@gnu.org Received: via spool by 25235-submit@debbugs.gnu.org id=B25235.167397055322903 (code B ref 25235); Tue, 17 Jan 2023 15:50:01 +0000 Received: (at 25235) by debbugs.gnu.org; 17 Jan 2023 15:49:13 +0000 Received: from localhost ([127.0.0.1]:37999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHoD3-0005xL-4F for submit@debbugs.gnu.org; Tue, 17 Jan 2023 10:49:13 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:40653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHoCx-0005x2-VO for 25235@debbugs.gnu.org; Tue, 17 Jan 2023 10:49:11 -0500 Received: by mail-qt1-f170.google.com with SMTP id jr10so20185405qtb.7 for <25235@debbugs.gnu.org>; Tue, 17 Jan 2023 07:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=atmHEGP+J01UGpbm2w+csmlYUatEsd8Ex85gW9T6mk8=; b=Tzjudb9nGOhz3CxFB/4HVA9KfG1Btwx5wb0kHwbsifN/jukRIJgLKHvjJPqXcUz/cA g6lraVmVZk9/0zWtCdscxA2u0QgJwSmRP0fpando6Z35cOBBSyxtbCitaD/KzWrIVd2J 00mEt6yzvcZzx5qV74npdmcLfp5yHoI7kuke+xuO3fm6NLN50Buky0c04dW6120LI44G rM7OpFN16TE+I+tfEsCmpmNyg/l+aRT8dtkfZMfPZDWlF/lPFZ9Wd8IMhacIMBCIfTjD 9NvFB891iR0OsYpUjy7s58/CAWqOA3XYwve4vMcPxPBsLb2PGDUKnUebgRpyGalUGuSP VhnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=atmHEGP+J01UGpbm2w+csmlYUatEsd8Ex85gW9T6mk8=; b=FUi846ojINvlH6qKGKLQlfpCzCtsofivafnfqEIFaq9D9LXBIV50VXvmMcZtAV8tHL 2aFZEzaVlhEs1pfeBYz+gNDn7xTl9GiB0yTtdfQnHGa+PwHH70guvt4opqGI7EQwB0wR MTOQgCy9K4nTpXjuE7nmdHEK03jdgFglSV53J+L5v/tfwja2Pz0J2U1f7MUdz4gRyRQX uBgIceotXH/feq/Y9hfY4QsT5bAc+wAgnWhwfg7H5RJ7r8lvmLoNjebjRHKkitVtpt3E zIJhExEu/syA+vO+IPNWct+hCZkMxXQqvNsSqcIZKEBVno11qz6xT5v/VqbLlWToCKfN 1QNg== X-Gm-Message-State: AFqh2kosVYS/dRaJaWxWa/pJ6+6YXiq8hU58mEYlT6ZVOiCOY0URlUqZ h8S8wZD1mCF6T0KEmhUaRJ4= X-Google-Smtp-Source: AMrXdXtwVcRx/NpVEsxIxTPS0BDqautf82/J0NiOnhLf/Ym3eKbHRxDFAQWTjsdgfX7wRg7lmxIBBw== X-Received: by 2002:ac8:5693:0:b0:3b6:30cb:b6c4 with SMTP id h19-20020ac85693000000b003b630cbb6c4mr10521587qta.25.1673970542434; Tue, 17 Jan 2023 07:49:02 -0800 (PST) Received: from hurd (dsl-205-233-125-107.b2b2c.ca. [205.233.125.107]) by smtp.gmail.com with ESMTPSA id k4-20020ac84744000000b003b630ea0ea1sm3133032qtp.19.2023.01.17.07.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 07:49:02 -0800 (PST) From: Maxim Cournoyer References: <20230116212920.9641-1-maxim.cournoyer@gmail.com> <20230116212920.9641-2-maxim.cournoyer@gmail.com> <874jspjyrv.fsf@gnu.org> Date: Tue, 17 Jan 2023 10:49:00 -0500 In-Reply-To: <874jspjyrv.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 17 Jan 2023 10:28:20 +0100") Message-ID: <877cxl2mc3.fsf@gmail.com> 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 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=Tzjudb9n; 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=1673970667; a=rsa-sha256; cv=none; b=fSk4/obGJL1nivhpcG113qgzrMld9PMf1owOBc3Q6jod5OhlFonGpysA9JaUM3gl6mXdwW zRdHDHXNHOLKipge12+OoZTyUC2qB8KtFGitTDRBBwnRPlxUoERMhh3y4uD52GLoeTaceO RES6ztxWvvK+f3kXqI+o2iL8ivyrXwUnFltD9lsHGv6fA9wEv0NXtXSJodF5pSEsIm5esi xXKHQofZPsmPxIg+nHnAyhxVBJR+oNqER0UK9hQQGRRcuJCnyvDKdnrfhRY7RQZoHJOw4R O9AAGt8jnKEsS01IJ2IYUzUXzd9q2WXqJpgPzA729e5iy6mzQ+tWxzmkxF2Nlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673970667; 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=atmHEGP+J01UGpbm2w+csmlYUatEsd8Ex85gW9T6mk8=; b=ZW+2Ib+ypjV6gBC/zTTIZT6Jk4N3BFbyqAEmx6Ytw5bWfBtD9m7nsDaIgMCQjnuG1/q6PC pdQddQjIlxpe5WGT1CB7x9U5kQgGCJqjFAlc6wZ41tQqA6AUTOb/Wst6njo+WfpxncGnlY jEv8IUb8mkKlYJSdYmPLB4If1qJMF2IolsMhzuj5FhKwj7P3SyJNq3E15s+R0fPHDjBs1B 3K4zVn2WXn9JH1m74VbwLXo6cGDi/fYT5OBi6TvuVZuxb2gMr7ZDV3F0xrpuPo8PPHEXuu YvnNtzlkVCVE3UcrCh9051pwTTKmm6Xt/abw4L2ykbyI33wBKHLaZAEiicTfkA== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Tzjudb9n; 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.03 X-Spam-Score: -2.03 X-Migadu-Queue-Id: 18D7717877 X-Migadu-Scanner: scn1.migadu.com X-TUID: lAJLu6iL6UYi Hi Ludovic, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >> Fixes . >> >> * guix/build/pyproject-build-system.scm (wrap) [native-inputs]: New argu= ment. >> Filter out native inputs from the values in GUIX_PYTHONPATH. > > Yay, great to see this fixed! > >> guix/build/pyproject-build-system.scm | 16 ++++++++++++---- >> 1 file changed, 12 insertions(+), 4 deletions(-) >> >> diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyprojec= t-build-system.scm >> index a66c1fb34a..cd418f7ec9 100644 >> --- a/guix/build/pyproject-build-system.scm >> +++ b/guix/build/pyproject-build-system.scm >> @@ -445,7 +445,7 @@ (define* (add-install-to-pythonpath #:key native-inp= uts 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)) >> @@ -464,9 +464,17 @@ (define bindirs >> (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") ""))))) >> + ;; Use the same strategy to compute the native-input file names. >> + (define %native-input-dirs (delay (match native-inputs >> + (((_ . dir) ...) >> + dir)))) >> + (define (native-input-dirs) (force %native-input-dirs)) >> + >> + (let ((var `("GUIX_PYTHONPATH" prefix >> + ,(remove (lambda (x) >> + (any (cut string-prefix? <> x) (native-input-= dirs))) >> + (search-path-as-string->list >> + (or (getenv "GUIX_PYTHONPATH") "")))))) > > I think there=E2=80=99s no need to delay+thunk things since we=E2=80=99re= using them > right away. How about: > > (define native-input-directories > (match native-inputs > =E2=80=A6)) > > (let ((var `("GUIX_PYTHONPATH" prefix > ,(remove (lambda (x) =E2=80=A6 native-input-directories = =E2=80=A6) =E2=80=A6)))) > =E2=80=A6) > > ? It's a (small) optimization, that was intended to delay things until they are really needed that was already used for %bash (now %guile) in the wrap phase of (guix build python-build-system). The idea is to delay the evaluation of native-input-directories or the lookup for guile in the inputs until it's really necessary. For example, the computations are avoided when there are no "bin" or "sbin" sub-directories in the outputs. > (Same for =E2=80=98%guile=E2=80=99 above, but I don=E2=80=99t see it in = =E2=80=98master=E2=80=99; maybe that=E2=80=99s > from another branch?) Yes, the change build on both #60847 (Enable cross-compilation for the pyproject-build-system) and #60868 (Use wrap-script instead of wrap-program), which should be applied first. %guile appears in #60868, and changes that make the above easy (native-inputs always appearing as native-inputs, even for native builds) are from #60847. --=20 Thanks, Maxim