help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

streamlining custom package development


From: Przemysław Kamiński
Subject: streamlining custom package development
Date: Fri, 03 Mar 2023 10:44:21 +0000

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: OpenPGP_0xF39440D7C4D6E158.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Attachment: publickey - cgenie@pm.me - 9cc42b0a.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]