From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SLNNG1+RWWN9EAEAbAwnHQ (envelope-from ) for ; Wed, 26 Oct 2022 21:58:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +CwuG1+RWWN3DwEA9RJhRA (envelope-from ) for ; Wed, 26 Oct 2022 21:58:23 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DF19429CFF for ; Wed, 26 Oct 2022 21:58:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onmWW-00047n-N3; Wed, 26 Oct 2022 15:57:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onmWU-00042j-Sk for help-guix@gnu.org; Wed, 26 Oct 2022 15:57:11 -0400 Received: from mx0.riseup.net ([198.252.153.6]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onmWS-0008V9-8Y for help-guix@gnu.org; Wed, 26 Oct 2022 15:57:10 -0400 Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4MyKMj3Jz4z9sQf; Wed, 26 Oct 2022 19:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1666814225; bh=G3wDJqLbfQplL/I7doiFMcvFzgtqUEpzzlQ/zV7jdxw=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=l/shf5d3G1z6lwgMRJPRwf7odSimFvrqvfiQi6DTnjYlgcgTer9zp9h5hFRTQEYoP SBd7V63EnEU1tBRdVHHQvMiH+Bh2iwDqW3D0BYrfOnuHE94UMvHVWmfgDbQ4Qo5bHm d4qhbIWvlyZk8hD0t2Z80xcI5GsVgGopzwz+cOkw= X-Riseup-User-ID: E9D0BE52893C5B4ED5C796F4A14179A05AB19830E7C1B9143E685E222AEB1605 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4MyKMh50ttz5vTf; Wed, 26 Oct 2022 19:57:04 +0000 (UTC) References: <20221013182027.2044d8ff@koszkonutek-tmp.pl.eu.org> <87czaurh9e.fsf@gmail.com> <20221014110911.66168330@koszkonutek-tmp.pl.eu.org> <87mt9ypt4t.fsf@gmail.com> <20221017153648.7185c235@koszkonutek-tmp.pl.eu.org> <20221026092330.6df3870c@koszkonutek-tmp.pl.eu.org> From: Csepp To: Wojtek Kosior Cc: help-guix@gnu.org Subject: Re: program prepared with `guix pack` unusable by end users Date: Wed, 26 Oct 2022 21:55:58 +0200 In-reply-to: <20221026092330.6df3870c@koszkonutek-tmp.pl.eu.org> Message-ID: <87ilk61hpu.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=198.252.153.6; envelope-from=raingloom@riseup.net; helo=mx0.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Help-Guix" Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666814303; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=9BujXsehz2/cJ8w0tNkILJfLMxisd5AqrhX5s5SUW/U=; b=gLe2z/qajgn2LOt7HYq3X9/hr0e4NgFogTNL0tRVIy01IChPnUkUWKxjWqJMyyhDYGD8+u OLkXAOQfIYFqgx0qAlVyCfawnxauRmjxo5AZXitqVHe8mABW0Cq3eylbSnntqnLGzLyA+g lhI2NYgqwL5TG4oYqVXuIFXS3fJhvf/yllhx3fGjP3jrrYjJkZvlswALEmIdevg37GkBYI t18dcg581XlXNylM2V97V7R1WypsgK3CQYZrU1QjJJAtzPZjrSRwGXXhmuzEMHpExWN7qg CgR38qoXZBrYUVq3SAgXvNSmZ8bGOObPF9vx//H43mJHCS9AYLbCBSdaEZhrhA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666814303; a=rsa-sha256; cv=none; b=JWqCET12iU+QHaXfB4kpjZVwEcFZ5Cb+vdK/xoeBPbIZqv2Ik2DZP2ToiQvMvXCGfNWe/X GDd9hn2W6xXSKNyYYHQeUNx/RNg+jMS5OLdCitiXt7uzGBYns/DUUsbnpd4M7FPvIJpOas DFr1y2ke3EsugMFmalG/WlLIoFymMn/+hFKdF2wImELVgrdCMqdyYdP+i0dA1G+8rpYy1h ZgKmoIwInHaT4rELxpo7n8IFBlgXwzRTW/hDgGcA/QuGXVifCbQICSOcIvSAUoobo3GAjw efe3D6sBRzqvMQ8aG5Xf6Lchcgp9au9jpwYXAss1g28SlxNjl8DVzsiXcvxG9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b="l/shf5d3"; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.52 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b="l/shf5d3"; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DF19429CFF X-Spam-Score: -7.52 X-Migadu-Scanner: scn0.migadu.com X-TUID: dxHzQQOXqacc Wojtek Kosior via 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. > > You can see my fix here[1]. I most importantly needed to add the > following to #:phases of my package definition > >> (add-after 'wrap 'prevent-local-package-interference >> (lambda* (#:key outputs #:allow-other-keys) >> (match-let ((((_ . dir)) outputs)) >> (for-each (lambda (prog-name) >> (substitute* (string-append dir "/bin/" prog-name) >> (("^#!/.*$" shabang) >> (string-append shabang >> "export PYTHONNOUSERSITE=3D1\n")))) >> '("hydrilla" >> "hydrilla-server" >> "hydrilla-builder" >> "haketilo"))))) > > 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 > > [1] > https://git.koszko.org/pydrilla/commit/?h=3Dkoszko&id=3Df7c4dff95e88d58d6= 1c51b2a6b94c90e2e4e0c4b > > > -- (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=C3=B3w saints! #17: blessed Jolenta Helena > Poznaj =C5=9Bwi=C4=99tych krakowskich! #17: b=C5=82ogos=C5=82awiona Jole= nta Helena > https://pl.wikipedia.org/wiki/Jolenta_Helena > -- (sig_end) > > > On Mon, 17 Oct 2022 15:36:48 +0200 > Wojtek Kosior via wrote: > >> Hello again after a break, >>=20 >> > Well, then I tried to reproduce your failure in order to understand wh= at >> > is going wrong but I hit this: >> > >> > [...] >> >=20 >> > That=E2=80=99s because your package =E2=80=99python-pyopenssl-for-hake= tilo=E2=80=99 inherit from >> > =E2=80=99python-pyopenssl=E2=80=99 defined in (gnu packages python-cry= pto). The issue >> > is that the =E2=80=99origin=E2=80=99 also inherits >> >=20 >> > (origin >> > (inherit (package-source base)) >> >=20=20=20=20=20=20=20=20=20=20 >> > and thus >> >=20 >> > (patches (search-patches "python2-pyopenssl-openssl-compat.patc= h")))) >> >=20 >> > does not make sense anymore because this patch is against 21.0.0 and >> > your variant is about 22.0.0.=20=20 >>=20 >> Thank you for your time spent on trying this out. >>=20 >> The error is surely a result of us using different Guix versions. In the >> version I had the pyOpenSSL version was 20.0.1 and no patch was being >> used yet[1]. >>=20 >> Another user also had problems building from source under a different >> Guix version. I knew this would happen but I didn't have a ready >> solution before. I now came up with a Makefile that organizes most >> common development tasks in my project into rules that call `guix >> time-machine` under the hood[2]. This should be a general solution for >> this kind of problems. >>=20 >> > Well, further investigations about what could be wrong for =E2=80=9Cgu= ix pack=E2=80=9D >> > needs a way to reproduce. :-) Could you fix or point a working >> > example in your Git repository?=20=20 >>=20 >> As for troubleshooting the creation of Hydrilla 3.0-beta1 pack, one can >> get the same enviroment I was using by pulling Guix from commit >> fd00ac7e27c8a6d4b4d4719b4f8797bdce204623. Although most list users here >> probably know how to achieve this, I'm putting this here for convenience >>=20 >> > guix time-machine >> > --commit=3Dfd00ac7e27c8a6d4b4d4719b4f8797bdce204623 -- >> > >>=20 >> Anyway, the main problem could probably be also troubleshooted by >> experimenting with the pack I made available[3] as it is also the one >> that is known to have caused problems. >>=20 >> Thank you again, >> Wojtek >>=20 >> [1] >> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/python-cryp= to.scm?id=3Dfd00ac7e27c8a6d4b4d4719b4f8797bdce204623#n650 >> [2] >> https://git.koszko.org/pydrilla/commit/?h=3Dkoszko&id=3Ded2e14dd6ced4f64= b6ac707c5998b38a78e6d7ad >> [3] https://hydrillabugs.koszko.org/projects/haketilo/wiki/Releases#Files >>=20 >> -- (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 >>=20 >> Meet Krak=C3=B3w saints! #13: blessed Jan Beyzym >> Poznaj =C5=9Bwi=C4=99tych krakowskich! #13: b=C5=82ogos=C5=82awiony Jan= Beyzym >> https://pl.wikipedia.org/wiki/Jan_Beyzym >> -- (sig_end) >>=20 >>=20 >> On Fri, 14 Oct 2022 13:00:18 +0200 >> zimoun wrote: >>=20 >> > Hi, >> >=20 >> > On ven., 14 oct. 2022 at 11:09, Wojtek Kosior via = wrote: >> >=20=20=20 >> > > I accidently just replied to you, Simon, instead of making a "reply >> > > all". I'm reposting the same now, sorry for the nuisance...=20=20=20= =20 >> >=20 >> > Do not worry. :-) >> >=20=20=20 >> > > So, I did run `guix shell -L. hydrilla`. First, I got a warning about >> > >=20=20=20=20 >> > >> ambiguous package specification `hydrilla'=20=20=20=20 >> >=20 >> > That=E2=80=99s expected because: >> >=20 >> > --8<---------------cut here---------------start------------->8--- >> > (define-public hydrilla >> > (package >> > (name "hydrilla") >> >=20 >> > [...] >> >=20 >> > (define-public hydrilla-dist-tarball >> > (let ((base hydrilla) >> > (filename (string-append "hydrilla-" %hydrilla-version ".tar.g= z"))) >> > (package >> > (inherit base) >> > (source (local-file >> > --8<---------------cut here---------------end--------------->8--- >> >=20 >> > It means that the package =E2=80=99hydrilla=E2=80=99 has the name =E2= =80=9Chydrilla=E2=80=9D and because >> > the package =E2=80=99hydrilla-dist-tarball=E2=80=99 inherits then it a= lso has the name >> > =E2=80=9Chydrilla=E2=80=9D. Idem for the version field. >> >=20 >> > Therefore, >> >=20 >> > guix shell -L . hydrilla >> >=20 >> > refers to 2 possible packages. All Guix CLI commands use =E2=80=9Cnam= e=E2=80=9C and >> > =E2=80=9Cversion=E2=80=9D for looking up to packages and not the symbo= ls. >> >=20 >> >=20 >> > Well, then I tried to reproduce your failure in order to understand wh= at >> > is going wrong but I hit this: >> >=20 >> > --8<---------------cut here---------------start------------->8--- >> > $ guix build -L . python-pyopenssl@22.0.0 >> > The following derivations will be built: >> > /gnu/store/gyc6sw8a9vq09z6p7plv3k5sjjvrcz9i-python-pyopenssl-22.0.0.= drv >> > /gnu/store/rfawn8bnr1vz71gcm6dz171gfpk0fwai-pyOpenSSL-22.0.0.tar.xz.= drv >> > building /gnu/store/rfawn8bnr1vz71gcm6dz171gfpk0fwai-pyOpenSSL-22.0.0.= tar.xz.drv... >> > pyOpenSSL-22.0.0/ >> >=20 >> > [...] >> >=20 >> > pyOpenSSL-22.0.0/tox.ini >> > patching file src/OpenSSL/SSL.py >> > Hunk #1 FAILED at 1421. >> > Hunk #2 FAILED at 2449. >> > 2 out of 2 hunks FAILED -- saving rejects to file src/OpenSSL/SSL.py.r= ej >> > patching file tests/test_ssl.py >> > Hunk #1 FAILED at 1928. >> > 1 out of 1 hunk FAILED -- saving rejects to file tests/test_ssl.py.rej >> > source is at 'pyOpenSSL-22.0.0' >> > applying '/gnu/store/4cd1x970w3jg3rwaiqg174x56mvkihij-python2-pyopenss= l-openssl-compat.patch'... >> > Backtrace: >> >=20 >> > [...] >> >=20 >> > ERROR: >> > 1. &invoke-error: >> > program: "/gnu/store/z39hnrwds1dgcbpfgj8dnv2cngjb2xbl-patch-2.7.= 6/bin/patch" >> > arguments: ("--force" "--no-backup-if-mismatch" "-p1" "--input" = "/gnu/store/4cd1x970w3jg3rwaiqg174x56mvkihij-python2-pyopenssl-openssl-comp= at.patch") >> >=20 >> > [...] >> >=20 >> > builder for `/gnu/store/rfawn8bnr1vz71gcm6dz171gfpk0fwai-pyOpenSSL-22.= 0.0.tar.xz.drv' failed with exit code 1 >> > build of /gnu/store/rfawn8bnr1vz71gcm6dz171gfpk0fwai-pyOpenSSL-22.0.0.= tar.xz.drv failed >> > View build log at '/var/log/guix/drvs/rf/awn8bnr1vz71gcm6dz171gfpk0fwa= i-pyOpenSSL-22.0.0.tar.xz.drv.gz'. >> > cannot build derivation `/gnu/store/gyc6sw8a9vq09z6p7plv3k5sjjvrcz9i-p= ython-pyopenssl-22.0.0.drv': 1 dependencies couldn't be built >> > guix build: error: build of `/gnu/store/gyc6sw8a9vq09z6p7plv3k5sjjvrcz= 9i-python-pyopenssl-22.0.0.drv' failed >> > --8<---------------cut here---------------end--------------->8--- >> >=20 >> > That=E2=80=99s because your package =E2=80=99python-pyopenssl-for-hake= tilo=E2=80=99 inherit from >> > =E2=80=99python-pyopenssl=E2=80=99 defined in (gnu packages python-cry= pto). The issue >> > is that the =E2=80=99origin=E2=80=99 also inherits >> >=20 >> > (origin >> > (inherit (package-source base)) >> >=20=20=20=20=20=20=20=20=20=20 >> > and thus >> >=20 >> > (patches (search-patches "python2-pyopenssl-openssl-compat.patc= h")))) >> >=20 >> > does not make sense anymore because this patch is against 21.0.0 and >> > your variant is about 22.0.0. >> >=20 >> >=20 >> > Well, further investigations about what could be wrong for =E2=80=9Cgu= ix pack=E2=80=9D >> > needs a way to reproduce. :-) Could you fix or point a working example >> > in your Git repository? >> >=20 >> >=20 >> > Thanks, >> > simon >> >=20=20=20 >>=20 >>=20 > > > [[End of PGP Signed Part]] IMHO yes, the pack output does not work as expected. That's the definition of a bug.