From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0M97-0001h5-RX for guix-patches@gnu.org; Fri, 06 Oct 2017 02:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0M94-000261-M5 for guix-patches@gnu.org; Fri, 06 Oct 2017 02:30:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:43367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0M94-00025q-Jc for guix-patches@gnu.org; Fri, 06 Oct 2017 02:30:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e0M94-0000gL-4n for guix-patches@gnu.org; Fri, 06 Oct 2017 02:30:02 -0400 Subject: [bug#28693] [PATCH] gnu: Add missing input to python-py3status. Resent-Message-ID: Date: Fri, 6 Oct 2017 07:29:31 +0100 From: Christopher Baines Message-ID: <20171006072931.6caf481c@cbaines.net> In-Reply-To: <20171005210857.5soxmlej6kgvqxrf@penguin> References: <20171003225757.28335-1-sleep_walker@gnu.org> <20171004075944.1e5a7cbf@cbaines.net> <20171005210857.5soxmlej6kgvqxrf@penguin> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/t2KX6=o1YIkOmd7KzNHDF3y"; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Tom=C3=A1=C5=A1_?= =?UTF-8?Q?=C4=8Cech?= Cc: 28693@debbugs.gnu.org --Sig_/t2KX6=o1YIkOmd7KzNHDF3y Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 5 Oct 2017 23:08:57 +0200 Tom=C3=A1=C5=A1 =C4=8Cech wrote: > Hi Christopher, >=20 > 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=C3=A1=C5=A1 =C4=8Cech wrote: > > =20 > >> * 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. =20 > > > >Hey Tom=C3=A1=C5=A1, > > > >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. =20 >=20 > That is correct. >=20 > >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. =20 >=20 > 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. =20 >=20 > It adds burden to maintainer to verify sufficiency and need for every > code change but besides that it looks as proper solution. >=20 > >As for wrapping, that is inelegant, and wouldn't help if this > >is used as a python library. =20 >=20 > Agreed. >=20 > >Propagated inputs can conflict with other > >packages and propagated inputs, which can cause issues for people > >installing and upgrading packages. =20 >=20 > 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. =20 >=20 > 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. >=20 > 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. >=20 > Otherwise the closure would grow beyond reason. >=20 > 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. --Sig_/t2KX6=o1YIkOmd7KzNHDF3y Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlnXIstfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdBFA//WLGgOmJ7BoqKLL3LqPpNIiOeg5V0/kfLDNHQmmJQqxZHRFPs4VMTxrB/ DPJjV4Z5xVBCHEB0UhM92QE98KenVBHd7UaLyQFjmGvjmeLUWdmoTlNwIr4laQMz gmCjS8UqWYEl2JtjRQW3qnhw9JEuZHgD+Yu7cuapuDbWNBvvCQsCfusN4vQV/rPf ikus7sqvaIXR9dwjAYySD+lwlkQqnfgyMWt+RVcAjt823djgvZu5kOCqRV+cfqMv hB7nPbWAx8fkh9TfKBj9wnWeYcSWMCHV/blwN+Rw5hMngZ0LCzorbeebnssxY17P K5ITTUvmBvAOSJCdiz20aEgVmRJkw/6DTUZBv3oZBmVKI1HU2bUUNVWwG0rTjgxz loUPo5eAUCsDJDOHSFVgQlme0frZh7Hr6dBNfgk6FPB7JMkK+ZKW6Jts2uYTIuax 25T0nSmxrX+XXlkT9shTBTxlw1JF//M5IpQnCNimJa9rQVPu7uyuwXrOR4Yw180p 0sD/v3RL7SsRKjlRY2UV0ypFKnXgh0kOuHeK0smthxBsdJ+ZxPs6NLYqhRWCI01N AhQ+8YBjrzwsXZvy1XodEf2foqFn6xpYV6v762tllmAVw0gK1/oZVRmp//KpgtNs csNUnZuEC0fC+KEk8dukp/l3l9WEJ+kHG8m0qti5kCCXA/9IN/k= =35IV -----END PGP SIGNATURE----- --Sig_/t2KX6=o1YIkOmd7KzNHDF3y--