all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wojtek Kosior via <help-guix@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: Csepp <raingloom@riseup.net>, help-guix@gnu.org
Subject: Re: program prepared with `guix pack` unusable by end users
Date: Thu, 27 Oct 2022 19:28:25 +0200	[thread overview]
Message-ID: <20221027192825.08f0af15@koszkonutek-tmp.pl.eu.org> (raw)
In-Reply-To: <877d0ljj84.fsf@gmail.com>

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

> > IMHO yes, the pack output does not work as expected.  That's the
> > definition of a bug.  
> 
> I disagree.  That Python gives precedence to USERSITE compared to
> site-packages and GUIX_PYTHONPATH is by design, so that users can
> override system provided libraries such as those by Guix.  It used to be
> the other way around, and it caused all sort of problems such as
> virtualenv not working as expected on Guix.

Perhaps the best solution would be to
* have Python interpreter itself give precedence to user site packages but
* have user site disabled (or enabled with lower precedence) by default
  for Python applications.

Consider the creation of wrapper script for python programs as it is
done now[1]. Is there currently any application that would behave
incorrectly with PYTHONNOUSERSITE exported as 1 and
`~/.local/lib/python<PYTHON-VERSION>/site-packages/` included in
GUIX-PYTHONPATH after the other paths? If there is, perhaps it would be
at least easier to make a workaround for this single application?

[1] https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/python-build-system.scm?id=176a501360699581b49f19ffde1ea3bb6285b8be#n225

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

Meet Kraków saints!           #0: saint Albert Chmielowski
Poznaj świętych krakowskich!  #0: święty Albert Chmielowski
https://pl.wikipedia.org/wiki/Adam_Chmielowski
-- (sig_end)


On Thu, 27 Oct 2022 12:59:23 -0400
Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> Hi,
> 
> Csepp <raingloom@riseup.net> writes:
> 
> > Wojtek Kosior via <help-guix@gnu.org> writes:
> >  
> >> [[PGP Signed Part:Undecided]]
> >> My problem has been solved. It turned out the Python interpreter
> >> contained within the pack was finding an older version of `hydrilla`
> >> Python package installed in `~/.local/lib/python3.9/site-packages` and
> >> that older version was missing the `console_scripts` entry point that
> >> was being loaded. It's worth mentioning that Python interpreter gives
> >> `~/.local/lib/python3.9/site-packages` priority over the paths that
> >> Guix adds to GUIX_PYTHONPATH.
> >>
> >> The solution was to patch the wrapper script for each of the commands
> >> my package provides. Definition of PYTHONNOUSERSITE enviroment variable
> >> stops Python from looking at local site packages.  
> 
> [...]
> 
> >> It's worth noting that this problem is not exclusive to `guix pack` or
> >> to my particular package. Users of other Python programs could in some
> >> circumstances experience similar issues. Which makes me think -
> >> shouldn't the default behavior be changed? Perhaps by making Python
> >> give paths from `GUIX_PYTHONPATH` priority over those in user site
> >> packages directory? Should I report this as a bug to bug-guix@gnu.org?
> >>
> >> Best,
> >> Wojtek  
> 
> [...]
> 
> > IMHO yes, the pack output does not work as expected.  That's the
> > definition of a bug.  
> 
> I disagree.  That Python gives precedence to USERSITE compared to
> site-packages and GUIX_PYTHONPATH is by design, so that users can
> override system provided libraries such as those by Guix.  It used to be
> the other way around, and it caused all sort of problems such as
> virtualenv not working as expected on Guix.
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2022-10-27 17:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 16:20 program prepared with `guix pack` unusable by end users Wojtek Kosior via
2022-10-13 17:34 ` (
2022-10-14  7:33 ` zimoun
2022-10-14  9:09   ` Wojtek Kosior via
2022-10-14 11:00     ` zimoun
2022-10-17 13:36       ` Wojtek Kosior via
2022-10-26  7:23         ` Wojtek Kosior via
2022-10-26 19:55           ` Csepp
2022-10-27 16:59             ` Maxim Cournoyer
2022-10-27 17:28               ` Wojtek Kosior via [this message]
2022-10-28 15:38                 ` Maxim Cournoyer
  -- strict thread matches above, loose matches on Subject: below --
2022-10-13  6:26 Greetd autologin? kiasoc5
2022-10-13  6:33 ` (
2022-10-13  7:17   ` program prepared with `guix pack` unusable by end users Wojtek Kosior via
2022-10-13  8:26     ` (
2022-10-13  9:51       ` Wojtek Kosior via
2022-10-13 13:19     ` zimoun

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=20221027192825.08f0af15@koszkonutek-tmp.pl.eu.org \
    --to=help-guix@gnu.org \
    --cc=koszko@koszko.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=raingloom@riseup.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.