all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: arunisaac@systemreboot.net, 25235@debbugs.gnu.org, ludo@gnu.org,
	Lars-Dominik Braun <lars@6xq.net>,
	rekado@elephly.net, jgart <jgart@dismail.de>,
	marius@gnu.org
Subject: bug#25235: [PATCH 1/1] build-system/pyproject: Do not wrap native-inputs.
Date: Wed, 18 Jan 2023 11:51:16 +0200	[thread overview]
Message-ID: <Y8fBFLZkBH8OZCDO@3900XT> (raw)
In-Reply-To: <20230116212920.9641-2-maxim.cournoyer@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2744 bytes --]

I'm still on my first cup of coffee...

If a python input is in inputs and in native-inputs would it be included
in the wrapper or not? At first glance I'd say no. Does the search path
do deduplication? If it doesn't then it'd work to only remove the first
instance matching from native-input-dirs.

On Mon, Jan 16, 2023 at 04:29:19PM -0500, Maxim Cournoyer wrote:
> Fixes <https://issues.guix.gnu.org/25235>.
> 
> * guix/build/pyproject-build-system.scm (wrap) [native-inputs]: New argument.
> Filter out native inputs from the values in GUIX_PYTHONPATH.
> 
> ---
> 
>  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/pyproject-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-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))
> @@ -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") ""))))))
>      (for-each (lambda (dir)
>                  (let ((files (list-of-files dir)))
>                    (for-each (cut wrap-script <> #:guile (guile) var)
> -- 
> 2.38.1
> 
> 
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2023-01-18  9:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 23:28 bug#25235: Wrapped python programs get native-inputs in PYTHONPATH Marius Bakke
2016-12-20 14:00 ` Ludovic Courtès
2016-12-26 18:26   ` Leo Famulari
2017-03-29 11:27     ` Arun Isaac
2017-03-30 15:30       ` Ludovic Courtès
2017-03-30 19:07         ` Arun Isaac
2017-04-04 17:02         ` Arun Isaac
2019-02-07 13:22           ` Ricardo Wurmus
2020-04-06 14:49 ` bug#25235: (no subject) Ricardo Wurmus via web
2020-04-09  0:02   ` Arun Isaac
2020-04-21  2:15   ` bug#25235: Wrapped python programs get native-inputs in PYTHONPATH Arun Isaac
2023-01-16 21:29 ` bug#25235: [PATCH 0/1] build-system/pyproject: Do not wrap native-inputs Maxim Cournoyer
2023-01-16 21:29   ` bug#25235: [PATCH 1/1] " Maxim Cournoyer
2023-01-17  9:28     ` Ludovic Courtès
2023-01-17 15:49       ` Maxim Cournoyer
2023-01-18  9:51     ` Efraim Flashner [this message]
2023-01-18 13:22       ` Maxim Cournoyer
2023-01-18 13:59 ` bug#25235: [PATCH v2 0/1] " Maxim Cournoyer
2023-01-18 14:00 ` bug#25235: [PATCH v2 1/1] " Maxim Cournoyer
2023-01-23 10:27   ` Ludovic Courtès
2023-01-23 13:38     ` Maxim Cournoyer
2023-01-23 13:34 ` bug#25235: [PATCH v3 0/1] " Maxim Cournoyer
2023-01-23 13:34   ` bug#25235: [PATCH v3 1/1] " Maxim Cournoyer
2024-05-01  9:36 ` bug#25235: [Maxim Cournoyer] " Nicolas Graves via Bug reports for GNU Guix
2024-05-04  8:05   ` Lars-Dominik Braun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8fBFLZkBH8OZCDO@3900XT \
    --to=efraim@flashner.co.il \
    --cc=25235@debbugs.gnu.org \
    --cc=arunisaac@systemreboot.net \
    --cc=jgart@dismail.de \
    --cc=lars@6xq.net \
    --cc=ludo@gnu.org \
    --cc=marius@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.