unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: "Tomáš Čech" <sleep_walker@gnu.org>
Cc: 28693@debbugs.gnu.org
Subject: [bug#28693] [PATCH] gnu: Add missing input to python-py3status.
Date: Fri, 6 Oct 2017 07:29:31 +0100	[thread overview]
Message-ID: <20171006072931.6caf481c@cbaines.net> (raw)
In-Reply-To: <20171005210857.5soxmlej6kgvqxrf@penguin>

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

On Thu, 5 Oct 2017 23:08:57 +0200
Tomáš Čech <sleep_walker@gnu.org> wrote:

> Hi Christopher,
> 
> first, let me thank you for your long explanatory review, I really
> appreciate it.

You're welcome :)

> On Wed, Oct 04, 2017 at 06:59:44AM +0000, Christopher Baines wrote:
> >On Wed,  4 Oct 2017 00:57:57 +0200
> >Tomáš Čech <sleep_walker@gnu.org> wrote:
> >  
> >> * gnu/packages/python.scm (python-py3status): Add missing input.
> >>
> >> file is used to determine configuration file encoding and py3status
> >> fails to run when this tool is missing.  
> >
> >Hey Tomáš,
> >
> >I don't know much about python-py3status, but I had a look at
> >building it with and without this patch, and it worked for me both
> >times.  
> 
> That is correct.
> 
> >When building with this patch, so with file as an additional input,
> >the resulting store item does not reference the file store item
> >(which you can check using guix size, which lists the referenced
> >store items [1]).
> >
> >Given file is used at runtime, it would be good if the resulting
> >store item for python-py3status referenced file. As far as I can
> >see, file is used here [2], so you could use the substitute*
> >procedure to replace the command name with an absolute path to the
> >binary in the store. This absolute path would then mean that file is
> >recorded as a "runtime" dependency of python-py3status.  
> 
> I have taken this approach as it seems to me as the most clean one. It
> works and `guix size' command now shows the file store in the list.

Great :)

> >Other approaches include wrapping the py3status binary to ensure the
> >PATH environment variable includes the dependencies (like file), or
> >adding file as to propagated-inputs (rather than inputs), which
> >ensures its installed when py3status is installed.
> >
> >All of these 3 approaches I've mentioned have some downsides.
> >Patching the files is tricky, and what is used where can change in
> >later releases.  
> 
> It adds burden to maintainer to verify sufficiency and need for every
> code change but besides that it looks as proper solution.
> 
> >As for wrapping, that is inelegant, and wouldn't help if this
> >is used as a python library.  
> 
> Agreed.
> 
> >Propagated inputs can conflict with other
> >packages and propagated inputs, which can cause issues for people
> >installing and upgrading packages.  
> 
> This point is interesting to me - can you please give me example?

So say a user has the file package installed in their profile, and also
has python-py3status installed in their profile. If python-py3status
propagates file, there is the opportunity for conflicts.

A profile directory is a union of some of the files in the component
packages. So, file from the profile has something for bin/file and
file propagated from python-py3status will also have bin/file. If you
installed the file package in your profile a while ago, and only
installed the python-py3status package recently, then there is a
possibility that they differ.

When this happens, there is an error shown, I found an example here [1].

1: https://lists.gnu.org/archive/html/guix-devel/2017-07/msg00001.html

I'm not sure how good this explanation is, so let me know if its
helpful or not.

> >From the number of occurrences of the subprocess module in this
> >package, this seems to be a problem not limited to the file tool,
> >but a large number of programs.  
> 
> That is correct but other occurences are related to plugins providing
> functionality. User has to prepare configuration to use that code.

Ok, that's good.

> Problem I'm trying to fix is causing hard-to-catch confusing error
> right after start for everyone who is missing file in PATH.
> 
> I somehow miss expressing optional run-time dependencies in Guix which
> would suit for this. I guess I'd go here with lazy approach and
> provide basic functionality my problem and let advanced user to deal
> with plugin problems by himself.
> 
> Otherwise the closure would grow beyond reason.
> 
> What do you think? Can this be the way here?

Compared to optional dependencies in other systems like Debian, they
still leave the user to sort out problems like this. I guess Guix could
offer a way of having optional inputs, but I'm not sure how that would
help. Also, multiple outputs to separate out the dependencies might be
more appropriate, but probably too much effort to do right now.

I'll reply to the patch separately.

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

  reply	other threads:[~2017-10-06  6:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 22:57 [bug#28693] [PATCH] gnu: Add missing input to python-py3status Tomáš Čech
2017-10-04  6:59 ` Christopher Baines
2017-10-05 21:08   ` Tomáš Čech
2017-10-06  6:29     ` Christopher Baines [this message]
2017-10-05 21:24   ` [bug#28693] [PATCH] gnu: Add missing input to python-py3status and fix call path Tomáš Čech
2017-10-05 22:22     ` Marius Bakke
2017-10-06  6:32     ` Christopher Baines
2017-10-08 11:05       ` bug#28693: " Tomáš Čech

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=20171006072931.6caf481c@cbaines.net \
    --to=mail@cbaines.net \
    --cc=28693@debbugs.gnu.org \
    --cc=sleep_walker@gnu.org \
    /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).