all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Przemysław Kamiński" <cgenie@pm.me>
To: help-guix@gnu.org
Subject: streamlining custom package development
Date: Fri, 03 Mar 2023 10:44:21 +0000	[thread overview]
Message-ID: <d6778040-23d7-f5d1-89a3-0d8b5ccf211f@pm.me> (raw)


[-- Attachment #1.1.1.1.1: Type: text/plain, Size: 2120 bytes --]

Hello,

I'm a Guix noob so please be patient :)

I currently want to use Guix to do some reproducible package management 
for my code.

So far my workflow is this:
1. I want to build some Haskell code
2. I need custom libs, so I write a simple package file (ghc-stuff.scm) 
like this one:

(define-public ghc-stuff
   (package
    (name "ghc-stuff
    (version "0.1.0")
    (source
     (local-file "../../stuff"
                 #:recursive? #t))
    (build-system haskell-build-system)
    (propagated-inputs
     (list <some-packages>))

3. I run `guix build -L <my-custom-guix-package-dir> -m manifest.scm 
(manifest only contains a reference to ghc-stuff.scm)
4. I get an error which looks like this:
View build log at 
'/var/log/guix/drvs/j2/wa3vw49l78m85z74x91sklqxwhx87y-ghc-hwodr-0.1.0.drv.bz2'

so I fire up

bunzip --stdout 
'/var/log/guix/drvs/j2/wa3vw49l78m85z74x91sklqxwhx87y-ghc-hwodr-0.1.0.drv.bz2'

and see that I am missing some Haskell packages.

5. I use 'guix search ghc-chart' only to find out that 1.9.3 version is 
there while I'm using 1.9.4. So I fire up 'ghc import hackage Chart' to 
show a package definition stub for 1.9.4, I add that to a 
'ghc-chart.scm' file in <my-custom-guix-package-dir>, import that into 
my ghc-stuff.scm file, add to (propagated-inputs).

6. Flush and repeat step 3.

This is tedious. Is there a way to automate this a bit more?

I tried:

cat <stuff>/stuff.cabal | guix import hackage -s -r

but it complains with

failed to download "/run/user/1000/guix-file.0hKo9A" from 
"https://hackage.haskell.org/package/stuff/stuff-0.1.0.0.tar.gz"

then throws a bunch of "Syntax error: unexpected end of input" and then 
spits out the manifest, but only for my <stuff> code so some packages 
are still missing and I need to add them manually.


Also, is there a way to use 'guix repl --listen=37146' in my setup? I 
guess it would be even more streamlined not to quit emacs to test the 
package build, however I'm such a noob that I even don't know how to 
build my package via Guix repl.

Best,
Przemek

[-- Attachment #1.1.1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 1227 bytes --]

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

[-- Attachment #1.2: publickey - cgenie@pm.me - 9cc42b0a.asc --]
[-- Type: application/pgp-keys, Size: 681 bytes --]

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

             reply	other threads:[~2023-03-03 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 10:44 Przemysław Kamiński [this message]
2023-03-03 11:05 ` streamlining custom package development Marek Paśnikowski
2023-03-07 13:31 ` Simon Tournier
2023-03-07 16:02 ` Ludovic Courtès
2023-03-07 16:57   ` Przemysław Kamiński
2023-03-07 18:28     ` Simon Tournier

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6778040-23d7-f5d1-89a3-0d8b5ccf211f@pm.me \
    --to=cgenie@pm.me \
    --cc=help-guix@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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.