From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id BVANGiIAZ2BYZQEAgWs5BA (envelope-from ) for ; Fri, 02 Apr 2021 13:29:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yFdzEiIAZ2A0PgAAbx9fmQ (envelope-from ) for ; Fri, 02 Apr 2021 11:29:38 +0000 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 5B0F8F534 for ; Fri, 2 Apr 2021 13:29:37 +0200 (CEST) Received: from localhost ([::1]:56510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSHzb-0006IQ-4W for larch@yhetil.org; Fri, 02 Apr 2021 07:29:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSHzS-0006Hm-CZ for help-guix@gnu.org; Fri, 02 Apr 2021 07:29:26 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSHzM-00087u-38 for help-guix@gnu.org; Fri, 02 Apr 2021 07:29:26 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 46FF916005F for ; Fri, 2 Apr 2021 13:29:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1617362954; bh=1C/2f7PeSKyT4AljHtny52UuSJmAi5vcpQbZH0XMVL0=; h=Subject:To:Cc:From:Date:From; b=ApP/un4o6JJCYkGsTaH7BEk8agRprWsfN825KvhRbDnPuW+DdY+KUHu6TaceqdXll iupKcOQvqWyTcWGApP17fnq5uirGm273GwkQWBwWRWSuZ5xNnOQOczajZ8PdJiFT85 iifRAQ0ldKEvzP04iKc8y103T5CoksayOzYj/hm0CT2ndVXU9Dk2dV5VAQRTqBwIPX 299MBl60FQG3JSIBoJ9hTlqBUQjTnVWdtyDckmtTUVJO2FED9+21gL3eNdUttVYGWX FMTpK4SqhnX+zt/JiVL2Nhxt9a7d82RyXHdWA48gWLWdyWJkrkKrNoeHPp5YTDrz/J 6v81tvPjDN1QA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FBd9h0Rpmz6tm9; Fri, 2 Apr 2021 13:29:11 +0200 (CEST) Subject: Re: About packaging documentation To: Ricardo Wurmus References: <87y2eomngw.fsf@elephly.net> <51eadb71-592c-d024-3163-85766a1a060c@posteo.de> <874khan4cn.fsf@elephly.net> From: Zelphir Kaltstahl Message-ID: Date: Fri, 2 Apr 2021 13:29:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <874khan4cn.fsf@elephly.net> Content-Language: en-US Received-SPF: pass client-ip=185.67.36.65; envelope-from=zelphirkaltstahl@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617362977; 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=SFVflboB1FyvLmoAQuaBT9NwtTiVmEahlRP2nDpuiXQ=; b=u4xmiOeKSqwpG+gj/ENcB+H7vJyayeDGblVsrOZbCpzeg3A3KpsYBM2vYgfULzzVQ7o6Pv 0xypbLRYbXHEkuCuoBABrgHayHjncHT1UoJeh/vwXkNb3LCjNRuefla2LND4aogO4L8P6M grlNNcTCdsLaFdfockikQdh+9vA6BYxyYWGAQUNE0UOrfysjeZVBv6T17ExfHhslMDS6PX H/50y/fajRqRizYINaBrKzHNOSzn2X3BvKDh4jwvg6yfA617aBDkBbkh2d7YhgyLYAwVYz 627TNrjHxkxZ8xD3o/n5y06ZTJp91NqrePbM/CaEEOaVEmE+ir/q8NKkhUr8RA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617362977; a=rsa-sha256; cv=none; b=FHQBskc0avogjYs7koirzRc35jk81g/oCiiEK81fD9KguwNt2PVzfTEJkjbMFHYn1BGuWA 2UBD4/Hi7OYHJoI6fPObnylrCOyN9kZ5hof/62HuSwsghmXMAcCtzMjo/o+7FfZnD40E44 WTi0AmM8GsqyvZcs4MbLI31MHMyRa8y6ChdNU0WHg43Zr7QNRbyPtyC3HWsqFx9I65Ur59 s6BpyX7UUA0quNOpG9TRmtZW7BNGnkbdaoNU92Ez2MLKT3h2Kw5g3fkeEuJhDA2+SlwIlB nqmgtMMiTIIhFMXv9vQy+JZW0EskocokEk7N/WGK/4Zy9itQUhJV5dOELBmbEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=posteo.de header.s=2017 header.b="ApP/un4o"; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: 0.17 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=posteo.de header.s=2017 header.b="ApP/un4o"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.de (policy=none); spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 5B0F8F534 X-Spam-Score: 0.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: TsxkXAGpf1uJ Hello Ricardo! On 3/16/21 11:03 PM, Ricardo Wurmus wrote: > Hi Zelphir, > >> Hello Ricardo! >> >> On 3/15/21 4:43 PM, Ricardo Wurmus wrote: >>> Hi Zelphir, >>> >>>> https://guix.gnu.org/cookbook/en/html_node/Packaging-Tutorial.html >>>> is a good >>>> start. It has even got cookbook in the name. Definitely the right idea to >>>> complement the general documentation. I am aware of its existence. >>>> Unfortunately, I could not get the basic approach of the "Hello World package" >>>> working for my package, even though it is pure guile, no other library required >>>> and no FFI or anything. I would have preferred not having to go through all the >>>> autotools stuff, and to have this simple way working for my package. Perhaps I >>>> did something slightly wrong. I do not know. Someone mentioned on the guile user >>>> mailing list, that this is all that should be needed for a pure guile package. >>>> Perhaps it can be updated? >>> Could you share the code you’re trying to package? Perhaps it will >>> become clearer to us what you would like to see changed in the cookbook >>> — and perhaps it will become clearer to you how packaging for Guix works. >> Yes, I'll link it: >> >> https://notabug.org/ZelphirKaltstahl/guile-fslib/commit/eacdbb5ee9e30413392908d9e3988e30e9411aa7 >> >> >> Or: >> >> https://notabug.org/ZelphirKaltstahl/guile-fslib/src/0.2.0 > Excellent. > > Here’s the package (I dumped this in (gnu packages guile-xyz)): > > --8<---------------cut here---------------start------------->8--- > (define-public guile-fslib > (package > (name "guile-fslib") > (version "0.2.0") > (source > (origin > (method git-fetch) > (uri (git-reference > (url "https://notabug.org/ZelphirKaltstahl/guile-fslib/") > (commit version))) > (file-name (git-file-name name version)) > (sha256 > (base32 > "118d84p443w7hrslv8hjyhgws631ia08mggiyklkmk0b9plfdsvz")))) > (build-system guile-build-system) > (inputs > `(("guile" ,guile-3.0))) > (home-page "https://notabug.org/ZelphirKaltstahl/guile-fslib") > (synopsis "File system utilities") > (description > "This package contains like super cool file system utilities and stuff. > It's really good and so easy to install!") > (license license:agpl3+))) > --8<---------------cut here---------------end--------------->8--- > > I only gave it a quick test like this: > > --8<---------------cut here---------------start------------->8--- > $ ./pre-inst-env guix environment --ad-hoc guile guile-fslib -- guile > […] > GNU Guile 3.0.5 > Copyright (C) 1995-2021 Free Software Foundation, Inc. > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. > > Enter `,help' for help. > scheme@(guile-user)> ,use (file-system) > scheme@(guile-user)> file-size-in-bytes > $1 = # > scheme@(guile-user)> > --8<---------------cut here---------------end--------------->8--- > > Seems to work. > > And this is what was installed: > > --8<---------------cut here---------------start------------->8--- > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0 > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0 > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/logging.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/test > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/test/test-fslib.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/test/test-list-utils.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/test/test-string-utils.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/fslib.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/file-reader.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/list-utils.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/file-system.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/lib/guile/3.0/site-ccache/string-utils.go > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0 > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/file-system.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/file-reader.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/test > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/test/test-string-utils.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/test/test-fslib.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/test/test-list-utils.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/string-utils.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/fslib.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/list-utils.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/guile/site/3.0/logging.scm > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc/guile-fslib-0.2.0 > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc/guile-fslib-0.2.0/todo.org > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc/guile-fslib-0.2.0/LICENSE > /gnu/store/2k3x0j6mvypjagam39dx89fd5yan7a3y-guile-fslib-0.2.0/share/doc/guile-fslib-0.2.0/README.md > --8<---------------cut here---------------end--------------->8--- > > One thing to note is that Guix didn’t run the tests, because it doesn’t > know how to (there’s no generic way to run tests for Guile packages, so > the build system doesn’t try). > > This can be changed by adding an “arguments” field to the package > definition that adds a phase to run the tests. First of all: Thanks again for providing the example definition of a package using the guile-build-system. This might well be the missing piece in the whole puzzle. I've looked at the cookbook again. The following things or aspects of the cookbook are not clear to me or cause confusion: (1) The cookbook does not even mention the guile-build-system. There is no example of it in the cookbook and no description of what a project needs to prepare or do, so that it can use the guile-build-system. Reading the cookbook one will not even know about the existence of guile-build-system. I checked, I searched the whole page at https://guix.gnu.org/cookbook/en/guix-cookbook.html for "guile-build-system". Zero hits. To be fair, the cookbook links to https://guix.gnu.org/manual/en/guix.html#Build-Systems , wherein there is a description of `guile-build-system`. There it says, what the guile-build-system is for, but no example is given. I guess this is, because the cookbook tries to be generic in a way, to apply to all languages, if only one uses autotools, as those are applicable to all languages. That is actually a good idea. I think, that build system specific examples would help people, who might not need the power of autotools, but for example have a pure GNU Guile project. This is probably, where I went wrong, when I tried to follow the cookbook months ago. I probably tried using gnu-build-system and failed, because I had no autotools infrastructure set up in my project. (2) The hello package example is using the gnu-build-system. I guess that means, that Guix will go through the usual autotools steps, after extracting a tarball or cloning a repository. However, then it would seem, that the success of the installation of the package largely hinges on what is defined in the autotools related files, like Makefile and such, which are part of the downloaded tar. Those however, are not described in the cookbook. If one is to create a package, which makes use of the gnu-build-system, then a description of how to get this done would be good to have. People have done it before, but documentation does not capture it. A good guide about this would have saved me a month of trying things, mailing list interaction, and write such guide myself. On the other hand, I would probably have learned less in the process. Getting back to the package definition example: Then there is another confusion: The definition you have written – Is that for editing the `guile.scm` in the Guix source tree, or is that for usage with `guix package --install-from-file=somename.scm` as shown for the hello package in the cookbook? My guess is, that it is for editing the Guix sources, because using it for `guix package --install-from-file` will not work, as the imports are missing and there is no "package value" returned at the end. I try to add those parts, but then more stuff is missing: ~~~~package definition~~~~ (use-modules (guix packages) (guix download) (guix build-system gnu) ((guix licenses) #:prefix license:)) (define-public guile-fslib (package (name "guile-fslib") (version "0.2.0") (source (origin (method git-fetch) (uri (git-reference (url "https://notabug.org/ZelphirKaltstahl/guile-fslib/") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "118d84p443w7hrslv8hjyhgws631ia08mggiyklkmk0b9plfdsvz")))) (build-system guile-build-system) (inputs `(("guile" ,guile-3.0))) (home-page "https://notabug.org/ZelphirKaltstahl/guile-fslib") (synopsis "File system utilities") (description "This package contains like super cool file system utilities and stuff. It's really good and so easy to install!") (license license:agpl3+))) guile-fslib ~~~~ ~~~~cli interaction~~~~ $ guix package --install-from-file=guix.scm /home/user/dev/guile/guile-fslib/guix.scm:18:0: error: git-fetch: unbound variable hint: Did you forget a `use-modules' form? ~~~~ So I looked at the guix sources and found git-fetch at https://git.savannah.gnu.org/cgit/guix.git/tree/guix/git-download.scm . I guess the import should be `(guix git-download)`? Then the next one is missing: `guile-build-system`. -> (guix build-system guile) Then `guile-3.0` is missing. -> (gnu packages guile) After adding these the whole file looks as follows: ~~~~ (use-modules (guix packages) (guix download) (guix git-download) (guix build-system gnu) (guix build-system guile) (gnu packages guile) ((guix licenses) #:prefix license:)) (define-public guile-fslib (package (name "guile-fslib") (version "0.2.0") (source (origin (method git-fetch) (uri (git-reference (url "https://notabug.org/ZelphirKaltstahl/guile-fslib/") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "118d84p443w7hrslv8hjyhgws631ia08mggiyklkmk0b9plfdsvz")))) (build-system guile-build-system) (inputs `(("guile" ,guile-3.0))) (home-page "https://notabug.org/ZelphirKaltstahl/guile-fslib") (synopsis "File system utilities") (description "This package contains like super cool file system utilities and stuff. It's really good and so easy to install!") (license license:agpl3+))) guile-fslib ~~~~ (I know, I might not need some of the imports remaining, like the `gnu-build-system` from `(guix build-system gnu)`, as I am then using the `guile-build-system`.) I think an example with `guile-build-system` would be good to have in the cookbook. The other docs (almost?) exclusively mention gnu-build-system only as well. If this definition of a package works using `guix package --install-from-file=somename.scm`, is it safe to assume, that it will work when putting that definition inside `guile.scm` in the GNU Guix sources? If it is not safe to assume this, what are the things, that make it unsafe to assume so? Best regards, Zelphir -- repositories: https://notabug.org/ZelphirKaltstahl