unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Cameron <cam@tindall.space>
To: help-guix@gnu.org
Subject: help with copy-build-system
Date: Wed, 23 Dec 2020 17:23:11 -0600	[thread overview]
Message-ID: <c01f3685-003e-4106-826a-afdc5deab587@www.fastmail.com> (raw)

Hello,

I am new to Guix but it seems to be the perfect tools for running a small cluster of servers that I need to administer. The one thing that so far is holding me back from doing so is the absence of a package for Caddy (https://caddyserver.com) which this cluster relies on heavily. I hope in the future to package it properly, but it has a number of golang dependencies that are not themselves even packaged, and I am far from an expert on building Go software -- it seems doable but it would be a relatively big undertaking.

Instead, I thought I could create a private package with copy-build-system and simply install the pre-built binaries that the Caddy project provides. This is the caddy-package.scm that I have come up with:
> 
> (use-modules (guix)
>              (guix build-system copy)
>      (guix build utils)
>              (guix licenses))
> 
> 
> (package
> (name "caddy")
> 
> (version "2.2.1")
> 
> (source
>   (origin
>    (method url-fetch)
>    (uri (string-append "https://github.com/caddyserver/caddy/releases/download/" version "/caddy_" version "_linux_amd64.tar.gz"))
>    (sha256
>     (base32
>      "1va2h8hpxcby9rny7px1y2xks79rxb4svnf9mrdrlc5xn0s04dsx"))))
> 
> (build-system copy-build-system)
> 
> (arguments
>   '(#:install-plan '(("caddy" "bin/caddy"))))
> 
> (synopsis "This is a *BAD* Caddy package. It just pulls the already-built binary from Github, rather than building from source.")
> (description "See https://caddyserver.com/")
> (home-page "https://caddyserver.com/")
> (license asl2.0))

When I build this file with `guix build -f caddy-package.scm -K', it fails with this rather mysterious (to me) error during the unpack phase:

> starting phase `unpack'
> LICENSE
> README.md
> caddy
> Backtrace:
>            8 (primitive-load "/gnu/store/fa16h805lxm1fmyhdmnwd09cpd7…")
> In ice-9/eval.scm:
>    191:35  7 (_ #f)
> In guix/build/gnu-build-system.scm:
>     838:2  6 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
> In ice-9/boot-9.scm:
>   1736:10  5 (with-exception-handler _ _ #:unwind? _ # _)
> In srfi/srfi-1.scm:
>    857:16  4 (every1 #<procedure 7ffff634c0a0 at guix/build/gnu-bui…> …)
> In guix/build/gnu-build-system.scm:
>    847:30  3 (_ _)
>    164:15  2 (unpack #:source _)
>      65:2  1 (first-subdirectory _)
> In ice-9/boot-9.scm:
>   1669:16  0 (raise-exception _ #:continuable? _)
> 
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> Throw to key `match-error' with args `("match" "no matching pattern" ())'.
> note: keeping build directory `/tmp/guix-build-caddy-2.2.1.drv-20'
> builder for `/gnu/store/p65q2ndw8hcpiq2x62jb9mxv6xa88kkn-caddy-2.2.1.drv' failed with exit code 1
> build of /gnu/store/p65q2ndw8hcpiq2x62jb9mxv6xa88kkn-caddy-2.2.1.drv failed
> View build log at '/var/log/guix/drvs/p6/5q2ndw8hcpiq2x62jb9mxv6xa88kkn-caddy-2.2.1.drv.bz2'.
> guix build: error: build of `/gnu/store/p65q2ndw8hcpiq2x62jb9mxv6xa88kkn-caddy-2.2.1.drv' failed

Would anyone be able to give me any advice here? This seems to comport with the Reference Manual blurb (https://guix.gnu.org/manual/en/guix.html#index-copy_002dbuild_002dsystem) about copy-build-system and also appears similar to several official packages using copy-build-system (e.g. gcide, vim-neocomplete, neverball) that I looked to as examples. Clearly though, there is some nuance that I am missing.

Thanks in advance for any help you can provide.

-Cam Tindall

             reply	other threads:[~2020-12-24 10:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 23:23 Cameron [this message]
2020-12-24 12:07 ` help with copy-build-system Julien Lepiller
2020-12-24 18:00   ` Cameron
  -- strict thread matches above, loose matches on Subject: below --
2020-12-24  2:30 Help " Cameron
2021-03-10 11:23 Raghav Gururajan
2021-03-26  9:20 ` Pierre Neidhardt
2021-03-26  9:55   ` Raghav Gururajan
2021-03-26 11:11     ` Pierre Neidhardt
2021-03-26 11:53       ` Raghav Gururajan
2021-03-26 12:12         ` Pierre Neidhardt
2021-03-26 12:28           ` Raghav Gururajan

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=c01f3685-003e-4106-826a-afdc5deab587@www.fastmail.com \
    --to=cam@tindall.space \
    --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.
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).