unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* streamlining custom package development
@ 2023-03-03 10:44 Przemysław Kamiński
  2023-03-03 11:05 ` Marek Paśnikowski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Przemysław Kamiński @ 2023-03-03 10:44 UTC (permalink / raw)
  To: help-guix


[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-07 21:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 10:44 streamlining custom package development Przemysław Kamiński
2023-03-03 11:05 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).