unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Rutherther <rutherther@protonmail.com>
Cc: Josselin Poiret <dev@jpoiret.xyz>,
	73304@debbugs.gnu.org, Konrad Hinsen <konrad.hinsen@fastmail.net>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: bug#73304: Python in relocatable guix pack leads to wrong sys.path
Date: Mon, 30 Sep 2024 23:08:29 +0200	[thread overview]
Message-ID: <87zfno3l4i.fsf@gnu.org> (raw)
In-Reply-To: <87ed5j1jzd.fsf@protonmail.com> (rutherther@protonmail.com's message of "Mon, 16 Sep 2024 19:23:04 +0000")

Hello,

Rutherther <rutherther@protonmail.com> skribis:

> When I add both python and a python package (seems like any) to a
> relocatable guix pack, the resulting python in the merged profile seems
> to be broken. Specifically its `sys.path` contains missing paths.
>
> To replicate:
> ```
> mkdir -p /tmp/b && cd /tmp/b
> tar xzvf $(guix pack -RR python python-pyflakes -S /profile=)`
> ```
>
> Then try executing the python from merged profile, and see sys.path output
>
> ./profile/bin/python3
>>>> import sys
>>>> print(sys.path)
> ['', '/tmp/b/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python310.zip', '/tmp/b/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10', '/tmp/b/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10/lib-dynload', '/tmp/b/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10/site-packages']
>
>
> Now if you instead use the realpath of this python
>
> $(realpath ./profile/bin/python3)
>>>> import sys
>>>> print(sys.path)
> ['', '/tmp/b/gnu/store/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python310.zip', '/tmp/b/gnu/store/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10', '/tmp/b/gnu/store/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10/lib-dynload', '/tmp/b/gnu/store/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10/site-packages']
>
> As can be observed, the first instance misses "gnu/store" in the path,
> and instead points to a path that does not exist.

Commit d5e0180805f52ef38a03ff9d6c11dd6174e3526b fixed a similar issue I
think, discussed at <https://issues.guix.gnu.org/53258>.

Not sure whether it’s a new problem here.  Konrad, Maxim, Josselin,
WDYT? :-)

Thanks,
Ludo’.




  parent reply	other threads:[~2024-09-30 21:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 19:23 bug#73304: Python in relocatable guix pack leads to wrong sys.path Rutherther via Bug reports for GNU Guix
2024-09-16 19:28 ` Rutherther via Bug reports for GNU Guix
2024-09-30 21:08 ` Ludovic Courtès [this message]
2024-10-01 19:39   ` Rutherther via Bug reports for GNU Guix
2024-10-02  6:20   ` Konrad Hinsen
2024-10-02 11:59     ` Konrad Hinsen
2024-10-06  8:29       ` Konrad Hinsen
2024-10-14 11:11         ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87zfno3l4i.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=73304@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=konrad.hinsen@fastmail.net \
    --cc=maxim.cournoyer@gmail.com \
    --cc=rutherther@protonmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).