unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* trash-cli commands fail after upgrade to 0.21.10.24
@ 2022-02-05  4:39 Jacob MacDonald
  2022-02-10 13:51 ` Daniel Meißner
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob MacDonald @ 2022-02-05  4:39 UTC (permalink / raw)
  To: help-guix

I use Guix on top of a Pop!_OS install. Guix's version of trash-cli
recently updated, and the command stopped working for me. Python can't
find the 'trashcli' module unless I install python-wrapper beside it.
python-wrapper does not seem to be a propagated input of trash-cli.
I'm not sure what the expected behavior around system/Guix Python and
python-wrapper is. Is it normal to need to install Python in my
profile to launch packages written in the language? hg is the only
other script in ~/.guix-profile/bin with a Python shebang, but it's
straight to Guix's Python. The previous version of trash-cli also
didn't behave like this.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: trash-cli commands fail after upgrade to 0.21.10.24
  2022-02-05  4:39 trash-cli commands fail after upgrade to 0.21.10.24 Jacob MacDonald
@ 2022-02-10 13:51 ` Daniel Meißner
  2022-02-10 20:53   ` Simon Streit
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Daniel Meißner @ 2022-02-10 13:51 UTC (permalink / raw)
  To: Jacob MacDonald; +Cc: help-guix

Hi!

Jacob MacDonald writes:

> I use Guix on top of a Pop!_OS install. Guix's version of trash-cli
> recently updated, and the command stopped working for me. Python can't
> find the 'trashcli' module unless I install python-wrapper beside it.
> python-wrapper does not seem to be a propagated input of trash-cli.
> I'm not sure what the expected behavior around system/Guix Python and
> python-wrapper is. Is it normal to need to install Python in my
> profile to launch packages written in the language?

AFAIK this should work without python-wrapper.

> hg is the only other script in ~/.guix-profile/bin with a Python
> shebang, but it's straight to Guix's Python. The previous version of
> trash-cli also didn't behave like this.

Do you remember which version of trash-cli worked?  In Guix’ history I
find three versions 0.12.9.14, 0.17.1.1 and 0.17.1.14.

I can reproduce the problem.  Interestingly, the shebang points to
Python3 despite the fact that the packages requests python2:

--8<---------------cut here---------------start------------->8---
daniel@xii-04 ~$ guix shell --pure trash-cli coreutils
Folgende Ableitung wird erstellt:
   /gnu/store/7mmjs56vyc4hrgmd464bxllk9d2082sr-profile.drv

Zertifikatsbündel der Zertifikatsautoritäten wird erstellt …
Liste der Emacs-Unterverzeichnisse wird erzeugt …
Schriftartenverzeichnis wird erstellt …
Verzeichnis von Info-Handbüchern wird erstellt …
Profil mit 2 Paketen wird erstellt …
daniel@xii-04 ~ [env]$ head $GUIX_ENVIRONMENT/bin/trash
#!/gnu/store/j5pp84nxd2gmlckdbf8pdljk5xh1byzc-python-wrapper-3.9.9/bin/python
from __future__ import absolute_import
import sys
from trashcli.put import main as main
sys.exit(main())
--8<---------------cut here---------------end--------------->8---


I don’t know if this is the root cause of the problem, though.  Maybe
someone else who knows the python-build-system better could help.

Best

--
Daniel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: trash-cli commands fail after upgrade to 0.21.10.24
  2022-02-10 13:51 ` Daniel Meißner
@ 2022-02-10 20:53   ` Simon Streit
  2022-02-11  2:59   ` Jacob MacDonald
  2022-02-13 14:00   ` Daniel Meißner
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Streit @ 2022-02-10 20:53 UTC (permalink / raw)
  To: Daniel Meißner; +Cc: help-guix, Jacob MacDonald

Hello,

Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de> writes:

> Do you remember which version of trash-cli worked?  In Guix’ history I
> find three versions 0.12.9.14, 0.17.1.1 and 0.17.1.14.

The last working version is 0.17.1.14.  I tried to wrap the binaries
with GUIX_PYTHONPATH.  It didn't work somehow.  Unfortunately I didn't
keep my modifications.


Kind regards
Simon 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: trash-cli commands fail after upgrade to 0.21.10.24
  2022-02-10 13:51 ` Daniel Meißner
  2022-02-10 20:53   ` Simon Streit
@ 2022-02-11  2:59   ` Jacob MacDonald
  2022-02-13 14:00   ` Daniel Meißner
  2 siblings, 0 replies; 7+ messages in thread
From: Jacob MacDonald @ 2022-02-11  2:59 UTC (permalink / raw)
  To: Daniel Meißner; +Cc: help-guix

On Thu, Feb 10, 2022 at 7:52 AM Daniel Meißner
<daniel.meissner-i4k@ruhr-uni-bochum.de> wrote:
> Do you remember which version of trash-cli worked?  In Guix’ history I
> find three versions 0.12.9.14, 0.17.1.1 and 0.17.1.14.

I, too, used 0.17.1.14 before the upgrade.

> Interestingly, the shebang points to Python3 despite the fact that the packages requests python2:

I missed the fact that the old package asked for Python 2. I did find
a GitHub issue with my error message
(https://github.com/andreafrancia/trash-cli/issues/94), but ignored it
because of that miss. The solution for the Guix version is still
unclear to me, and it's for an old version, though.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: trash-cli commands fail after upgrade to 0.21.10.24
  2022-02-10 13:51 ` Daniel Meißner
  2022-02-10 20:53   ` Simon Streit
  2022-02-11  2:59   ` Jacob MacDonald
@ 2022-02-13 14:00   ` Daniel Meißner
  2022-02-14  1:42     ` Jacob MacDonald
  2022-02-16 16:11     ` Daniel Meißner
  2 siblings, 2 replies; 7+ messages in thread
From: Daniel Meißner @ 2022-02-13 14:00 UTC (permalink / raw)
  To: Jacob MacDonald; +Cc: help-guix

Hi,

after setting GUIX_PYTHONPATH I was able to get the cli working (see
below).  This means the package needs a fix.  We could either patch the
scripts to include something like:

--8<---------------cut here---------------start------------->8---
import sys
sys.path.insert(0, "@pythondir@")
--8<---------------cut here---------------end--------------->8---

or maybe we could use the wrap-program procedure to wrap it with
GUIX_PYTHONPATH set correctly.  Is either method preferred?


Here's how it worked for me:

--8<---------------cut here---------------start------------->8---
daniel@think ~$ guix shell trash-cli
substitute: Liste der Substitute von „https://ci.guix.gnu.org“ wird aktualisiert … 100.0%
0,4 MB will be downloaded
 python-psutil-5.8.0  304KiB                                                                             1.8MiB/s 00:00 [##################] 100.0%
 trash-cli-0.21.10.24  49KiB                                                                             1.0MiB/s 00:00 [##################] 100.0%
The following derivation will be built:
   /gnu/store/fc26wwgy2zbq7k6271w8ksvaf3x10r0h-profile.drv

applying 1 graft for /gnu/store/rrchh68lpzrg70mf3awgr4y0ks788bgj-python-psutil-5.8.0.drv ...
applying 1 graft for /gnu/store/3pr2lwjan1i88aqs70bvv3m81z9xvfs3-trash-cli-0.21.10.24.drv ...
building CA certificate bundle...
listing Emacs sub-directories...
building fonts directory...
building directory of Info manuals...
building profile with 1 package...
daniel@think ~ [env]$ trash
Traceback (most recent call last):
  File "/gnu/store/kbsw86qqip1p9yzrnm36d71xhk278m1l-profile/bin/trash", line 4, in <module>
    from trashcli.put import main as main
ModuleNotFoundError: No module named 'trashcli'
daniel@think ~ [env]$ GUIX_PYTHONPATH=$GUIX_ENVIRONMENT/lib/python3.9/site-packages trash
Usage: trash [OPTION]... FILE...

trash: error: Please specify the files to trash.
daniel@think ~ [env]$
--8<---------------cut here---------------end--------------->8---

Best,

-- 
Daniel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: trash-cli commands fail after upgrade to 0.21.10.24
  2022-02-13 14:00   ` Daniel Meißner
@ 2022-02-14  1:42     ` Jacob MacDonald
  2022-02-16 16:11     ` Daniel Meißner
  1 sibling, 0 replies; 7+ messages in thread
From: Jacob MacDonald @ 2022-02-14  1:42 UTC (permalink / raw)
  To: Daniel Meißner; +Cc: help-guix

On Sun, Feb 13, 2022 at 8:00 AM Daniel Meißner
<daniel.meissner-i4k@ruhr-uni-bochum.de> wrote:
> after setting GUIX_PYTHONPATH I was able to get the cli working

Thanks for investigating. I had missed that environment variable, and
it looks like python-wrapper adds it to Guix's .profile. With the
proper environment variable and no python-wrapper, the program works
fine.

> This means the package needs a fix.  We could either patch the scripts
> ...
> or maybe we could use the wrap-program procedure to wrap it with GUIX_PYTHONPATH set correctly.

I took a look at the changes in
39510d5a5e4e0e38cd3d3bc944d5bf6d96242493, wrap-python3 in (gnu
packages python.scm), and the Python build system. There may be other
source code which answers my question, but: Did that version-bumping
commit break trash-cli with the version upgrade or with the new phase?
Does wrap-python3 write environment variables to my Guix profile
somehow, or does it just update what the wrapped package outputs?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: trash-cli commands fail after upgrade to 0.21.10.24
  2022-02-13 14:00   ` Daniel Meißner
  2022-02-14  1:42     ` Jacob MacDonald
@ 2022-02-16 16:11     ` Daniel Meißner
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Meißner @ 2022-02-16 16:11 UTC (permalink / raw)
  To: Jacob MacDonald; +Cc: help-guix

Apparently, it's now fixed:

https://issues.guix.gnu.org/53695#3

--
Daniel


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-16 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-05  4:39 trash-cli commands fail after upgrade to 0.21.10.24 Jacob MacDonald
2022-02-10 13:51 ` Daniel Meißner
2022-02-10 20:53   ` Simon Streit
2022-02-11  2:59   ` Jacob MacDonald
2022-02-13 14:00   ` Daniel Meißner
2022-02-14  1:42     ` Jacob MacDonald
2022-02-16 16:11     ` Daniel Meißner

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).