unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andy Wingo <wingo@igalia.com>
To: Chris Marusich <cmmarusich@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Mysterious error while refactoring guix/scripts/system.scm
Date: Thu, 04 Aug 2016 09:56:44 +0200	[thread overview]
Message-ID: <87poppq85f.fsf@igalia.com> (raw)
In-Reply-To: <87wpjxhx7z.fsf@gmail.com> (Chris Marusich's message of "Wed, 03 Aug 2016 23:20:00 -0700")

On Thu 04 Aug 2016 08:20, Chris Marusich <cmmarusich@gmail.com> writes:

> 1038: 3 [thunk]
> In gnu/packages/bootstrap.scm:
>  191: 2 [raw-build #<build-daemon 256.15 43c72c0> "guile-bootstrap-2.0" ...]
> In gnu/packages.scm:
>   91: 1 [search-bootstrap-binary "tar" #<procedure system (#:optional _)>]
> In unknown file:
>    ?: 0 [string-append #<procedure system (#:optional _)> "/" "tar"]
>
> ERROR: In procedure string-append:
> ERROR: In procedure string-append: Wrong type (expecting string): #<procedure system (#:optional _)>

This is because you moved some code around:

> --- a/guix/scripts/system.scm
> +++ b/guix/scripts/system.scm
> @@ -785,47 +785,46 @@ resulting from command-line parsing."
>                          (grub-configuration-device
>                           (operating-system-bootloader os)))))
>  
> -    (with-store store
> -      (set-build-options-from-command-line store opts)
> -
> -      (run-with-store store
> -        (mbegin %store-monad
> -          (set-guile-for-build (default-guile))
> -          (case action
> -            ((extension-graph)
> -             (export-extension-graph os (current-output-port)))
> -            ((shepherd-graph)
> -             (export-shepherd-graph os (current-output-port)))
> -            (else
> -             (perform-action action os
> -                             #:dry-run? dry?
> -                             #:derivations-only? (assoc-ref opts
> -                                                            'derivations-only?)
> -                             #:use-substitutes? (assoc-ref opts 'substitutes?)
> -                             #:image-size (assoc-ref opts 'image-size)
> -                             #:full-boot? (assoc-ref opts 'full-boot?)
> -                             #:mappings (filter-map (match-lambda
> -                                                      (('file-system-mapping . m)
> -                                                       m)
> -                                                      (_ #f))
> -                                                    opts)
> -                             #:grub? grub?
> -                             #:target target #:device device))))
> -        #:system system))))
> +    (case action
> +      ((extension-graph)
> +       (export-extension-graph os (current-output-port)))
> +      ((shepherd-graph)
> +       (export-shepherd-graph os (current-output-port)))
> +      (else
> +       (perform-action action os
> +                       #:dry-run? dry?
> +                       #:derivations-only? (assoc-ref opts
> +                                                      'derivations-only?)
> +                       #:use-substitutes? (assoc-ref opts 'substitutes?)
> +                       #:image-size (assoc-ref opts 'image-size)
> +                       #:full-boot? (assoc-ref opts 'full-boot?)
> +                       #:mappings (filter-map (match-lambda
> +                                                (('file-system-mapping . m)
> +                                                 m)
> +                                                (_ #f))
> +                                              opts)
> +                       #:grub? grub?
> +                       #:target target #:device device)))))

Here the #:system system was taking the `system' binding from within the
function -- it was lexically bound.

>  (define (process-command command args opts)
>    "Process COMMAND, one of the 'guix system' sub-commands.  ARGS is its
>  argument list and OPTS is the option alist."
> -  (case command
> -    ((list-generations)
> -     ;; List generations.  No need to connect to the daemon, etc.
> -     (let ((pattern (match args
> -                      (() "")
> -                      ((pattern) pattern)
> -                      (x (leave (_ "wrong number of arguments~%"))))))
> -       (list-generations pattern)))
> -    (else
> -     (process-action command args opts))))
> +  (with-store store
> +    (set-build-options-from-command-line store opts)
> +
> +    (run-with-store store
> +      (mbegin %store-monad
> +        (set-guile-for-build (default-guile))
> +        (case command
> +          ((list-generations)
> +           (let ((pattern (match args
> +                            (() "")
> +                            ((pattern) pattern)
> +                            (x (leave (_ "wrong number of arguments~%"))))))
> +             (list-generations pattern)))
> +          (else
> +           (process-action command args opts))))
> +      #:system system)))

Here it's not bound in the function so we take the top-level binding,
which is the `system' library call, a function.

Andy

  reply	other threads:[~2016-08-04  7:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04  6:20 Mysterious error while refactoring guix/scripts/system.scm Chris Marusich
2016-08-04  7:56 ` Andy Wingo [this message]
2016-08-10  7:23   ` Chris Marusich
2016-08-29 15:53     ` Ludovic Courtès
2016-09-24 19:54       ` Chris Marusich
2016-09-30 20:36         ` Ludovic Courtès

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=87poppq85f.fsf@igalia.com \
    --to=wingo@igalia.com \
    --cc=cmmarusich@gmail.com \
    --cc=guix-devel@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 public inbox

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

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).