From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gGqfB9jnR2N7MgEAbAwnHQ (envelope-from ) for ; Thu, 13 Oct 2022 12:26:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MHemB9jnR2O1SwAA9RJhRA (envelope-from ) for ; Thu, 13 Oct 2022 12:26:32 +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 65F7D24CCA for ; Thu, 13 Oct 2022 12:26:31 +0200 (CEST) Received: from localhost ([::1]:32878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oivQ6-0004E9-3v for larch@yhetil.org; Thu, 13 Oct 2022 06:26:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiusZ-0005AS-GN for help-guix@gnu.org; Thu, 13 Oct 2022 05:51:51 -0400 Received: from koszko.org ([93.95.227.159]:46558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiusV-0000jW-LJ for help-guix@gnu.org; Thu, 13 Oct 2022 05:51:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=koszko.org; s=mail; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=m6RJLTUy3ykVu2i4KWLSPz9NiUzq4mujRRcZ20kuS4A=; b=rZv+GXhKs/yjsMWihZ62sY1eA4 DfKyLpk6rHiDqSYWFS0/zPqvKw8c3vh/5q6PYluDCT8AuViYUB3hWrzKlGpmzh1BRwN6shideGAz6 YHpUDuPPlPBA/iR9ABSq2QmttYzzuMU9q+B8YKv04x//m1rPMxzDFWCX8C5gmXFVKxpPQ81TaYgMI Cyngicor+6+oYh5+HQeW8qqCq17nNqPMkRcANrMAjp9u5FKmK4abNYitGqLJwXesoQwN9FeolLHSb hEGflHf1PaAYsATIZyZHZf60rUd/JxV1SUuOHs+eQL0j0G21US0pXowOHluMbI96yb5lOKlVdFW+I NZAahTChUg02wHn8+uSxxvD336jTLFtwA+noN7FOSFNDOm7TiedVvEoTYo6zdL/PqAbZ65yjwUxOy c4ItgEulSQXij0ZECbHp5+IQCJDZvLI5c6xSfkdSF6DLBKNO/6mqDv+OQQm7cppJwGTNBQAxdLuHz EiVodiXuFD+A2xj7aDjLuDXVkm+oQNdI9S29uB1d4Gw9ZgO9zVWsKU+a1v4rYk18QR52n6Eur1jzO wHTk9GmnsmXWniRyQBsGF3WyyQ8HeTN/PgLTscZAPivVIYBgTnlSfMpWJsElUHvtAGqgMDcFinKxb 3+M+3bqtqzGN53IviU6Cclnd+SLZeBGILFfBugzEE=; Received: from [77.252.47.255] (helo=koszkonutek-tmp.pl.eu.org) by koszko.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oiusL-0002ld-Vq; Thu, 13 Oct 2022 11:51:38 +0200 Date: Thu, 13 Oct 2022 11:51:35 +0200 To: "(" Cc: Subject: Re: program prepared with `guix pack` unusable by end users Message-ID: <20221013115135.2a82894d@koszkonutek-tmp.pl.eu.org> In-Reply-To: References: <20221013091722.59d9ecc0@koszkonutek-tmp.pl.eu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/vg9uSsxYLq_jawGQFsPihO."; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=93.95.227.159; envelope-from=koszko@koszko.org; helo=koszko.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" Reply-to: Wojtek Kosior From: Wojtek Kosior via 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=1665656791; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=m6RJLTUy3ykVu2i4KWLSPz9NiUzq4mujRRcZ20kuS4A=; b=OdmUDxHSaouAE5Hfaqqjtcer7waICIzZd9GB4AK39yHiVr/6IbXneCpwuPJjmaVrPPNe+m x/xx5NctKMJzoTD90KL1elwTCJwAUwcPf+AjNNnq1R8FvI5XmdZqItvoAmdOjxWaqzxMrJ tndcms151tlIH5j/DKjzHz5L35wNAo/ZpJPyLwjAHAdAEchWrKEL5f2xlXctURdhFQ2S46 XfiHfI6Vza9VQGbgl+l2ogJO9uxHdhGq4M51PL9Qh69zemIwydcuLdRzGpjMhA/MG577nQ WQoXZoebiWNVhvvJZ4OZ8Z7TdZfxRr/lqjLAU8Fl7AcEyESmgj2z7q/mRyyH6Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665656791; a=rsa-sha256; cv=none; b=tN/zR8jOB9zi35o7KHgC7zzSQ3UMvw5E9HHQum+wjFYn46zJTyLdN0ZKR7YlJZo+LxhPpM 6ORbcc3VIdplv2n+K5hEzS1wwq97bv/osjOCpYze428yFPFWtFcf5oQ8NXEoOr5dDzWvkl gZYYJzkwWrHk4gUAfZjTH9slKUgn/ljhwAR4N53XwAmQSbCWpqChQnvq67tjjDC2K2iWiL r9gRfh/+X5iJv/5DZ77rhoz0NzAQ4tNhJILeDRfcLv6MpPcE7cgJxja8zGCzRe6NRlNaFE Hx/ofAbKQO1nMyAIpJsZ2UDotv+5mEH1VShANeI7rtZszraKsoa78QMuYpZmDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=rZv+GXhK; dmarc=pass (policy=none) header.from=gnu.org; 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: -3.80 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=rZv+GXhK; dmarc=pass (policy=none) header.from=gnu.org; 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: 65F7D24CCA X-Spam-Score: -3.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: KhdAgD3sIyox --Sig_/vg9uSsxYLq_jawGQFsPihO. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for response, Paren > Heya, >=20 > On Thu Oct 13, 2022 at 8:17 AM BST, Wojtek Kosior via wrote: > > > guix environment -L . -e '(@ (hydrilla) hydrilla)' -- python3 -m buil= d -s > > > guix pack -L . -RR \ > > > -S /hydrilla=3Dbin/hydrilla \ > > > -S /hydrilla-builder=3Dbin/hydrilla-builder \ > > > -S /hydrilla-server=3Dbin/hydrilla-server \ > > > -S /haketilo=3Dbin/haketilo \ > > > -e '(@ (hydrilla) hydrilla-dist-tarball)' =20 >=20 > I don't think this is an optimal way to use ``guix pack''. Surely this pa= ck > won't contain the Python modules that the script needs to import...? Actually, the pack *does* contain all the necessary modules. Here I made `hydrilla` resolve to a package that uses the entire contents of project directory as its `(source)`. `hydrilla-dist-tarball` then inherits from that package and causes a tarball under `./dist/` to instead be used as `(source)`. All the `(propagated-inputs)` are there, unmodified, in the child package. Any other ideas what could be causing problems? If you're curious, below I explain how I arrived at the commands I am using. Note that this is almost certainly in no way related to how console_script entries are found. So, in my project I initially added a guix.scm[1] that I could successfully use with `guix shell -Df guix.scm`. In guix.scm I initially specified the source of "hydrilla" package as > (source (local-file %source-dir > #:recursive? #t > #:select? (git-predicate %source-dir))) with %source-dir defined as > (define %source-dir (dirname (current-filename))) This turned out not to work correctly for building the package because the setuptools_scm python build plugin I am using relies on git metadata to decide the version of the package and what files should belong to it. Metadata from `.git/` is of course excluded with `git-predicate`. Also, an attempt to get away without using the `#:select?` keyword argument at all caused even weirder problems with some .py files being included in Guix package as empty files... Anyway, I figured out the best solution is to first generate a source tarball with `python3 -m build -s`. Such tarball gets placed under `./dist/` and already contains all the metadata prepared by setuptools_scm. Hence, the alternative definition of package source[2] > (source (local-file > (string-append %source-dir "/dist/" filename))) with `filename` bound to an appropriate string... This does work. But the tarball from beneath `./dist/` is what I distribute to users. Why should someone who downloads that tarball need to use the `python -m build -s`? There's no need. So I ended up making 2 variants of the package definition. One for release tarball users, using `(local-file %source-dir #:recursive? #t)`. And one for git checkout users. Now, I was not aware of a good way to use 2 different definitions with a simple guix.scm and `-f` option. Hence, I made it into a module and renamed that to hydrilla.scm. Under normal circumstances I could probably get away without using the `-e` option to guix. But here I have 2 packages with the same name "hydrilla". To be able to choose which one I want to use, I needed to refer to them by the names under which they are exported from the module. Hence, the `-e` option. Seeing how much confusion all this causes, I think I will stop caring about release tarball users running an unnecessary `python -m build -s`... > Also, ``guix environment'' has been deprecated for a while now; consider = using > ``guix shell'': >=20 > guix environment -L. hydrilla > # becomes > guix shell -DL. hydrilla >=20 > (``-D'' means "use the dependencies of the next listed package", as ``--a= d-hoc'' > is the default behaviour of ``guix shell''.) >=20 > -- ( I experienced guix shell failing to pick up changes I was making to guix.scm. It seemed to be incorrectly using a cached version of that file. Well, perhaps this behavior shall no longer occur when I use the `-e` flag? Idk, I discovered that flag after swithing to `guix environment`. Being now reminded about the deprecation (thanks!), I think I'll give `guix shell` another chance, though :) Best, Wojtek [1] https://git.koszko.org/pydrilla/tree/guix.scm?id=3Dd42379c189c33dac732a= 1a1341395a9f5683260b [2] https://git.koszko.org/pydrilla/tree/hydrilla.scm?h=3Dv3.0-beta1 -- (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! #2: blessed Aniela Salawa Poznaj =C5=9Bwi=C4=99tych krakowskich! #2: b=C5=82ogos=C5=82awiona Aniela = Salawa https://pl.wikipedia.org/wiki/Aniela_Salawa -- (sig_end) On Thu, 13 Oct 2022 09:26:32 +0100 "(" wrote: > Heya, >=20 > On Thu Oct 13, 2022 at 8:17 AM BST, Wojtek Kosior via wrote: > > > guix environment -L . -e '(@ (hydrilla) hydrilla)' -- python3 -m buil= d -s > > > guix pack -L . -RR \ > > > -S /hydrilla=3Dbin/hydrilla \ > > > -S /hydrilla-builder=3Dbin/hydrilla-builder \ > > > -S /hydrilla-server=3Dbin/hydrilla-server \ > > > -S /haketilo=3Dbin/haketilo \ > > > -e '(@ (hydrilla) hydrilla-dist-tarball)' =20 >=20 > I don't think this is an optimal way to use ``guix pack''. Surely this pa= ck > won't contain the Python modules that the script needs to import...? >=20 > Have you tried >=20 > guix pack -RL. hydrilla >=20 > ? Note that you don't actually need to use ``-e'', as the UI finds packag= es > by scanning all the modules in the load path for public variables contain= ing > objects. >=20 > Also, ``guix environment'' has been deprecated for a while now; consider = using > ``guix shell'': >=20 > guix environment -L. hydrilla > # becomes > guix shell -DL. hydrilla >=20 > (``-D'' means "use the dependencies of the next listed package", as ``--a= d-hoc'' > is the default behaviour of ``guix shell''.) >=20 > -- ( --Sig_/vg9uSsxYLq_jawGQFsPihO. Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTpcnBg48VjfIpPS0JLxSIcWnn9GgUCY0ffpwAKCRBLxSIcWnn9 GjA+AQDqPb7LPm7wy+mp67b0XP++P23m/WV92WKxtkSZhWkOsAD9FE4/xW1P378R 19eePMnwpTDgQsMD50K3tjXFwWwq8A0= =FK3c -----END PGP SIGNATURE----- --Sig_/vg9uSsxYLq_jawGQFsPihO.--