unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 30355@debbugs.gnu.org
Subject: [bug#30355] [PATCH] services: agetty: Make tty optional and add agetty instance to base services.
Date: Tue, 13 Feb 2018 23:04:10 +0100	[thread overview]
Message-ID: <87bmgsv95x.fsf@gnu.org> (raw)
In-Reply-To: <20180210230711.693d1452@scratchpost.org> (Danny Milosavljevic's message of "Sat, 10 Feb 2018 23:07:11 +0100")

Heya,

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> I tried this now:
>
> (define (default-serial-port)
>  "Return a gexp that determines a reasonable default serial port
> to use as the tty.  This is primarily useful for headless systems."
>   #~(begin
>       ;; console=device,options
>       ;; device: can be tty0, ttyS0, lp0, ttyUSB0 (serial).
>       ;; options: BBBBPNF. P n|o|e, N number of bits,
>       ;; F flow control (r RTS)
>       (use-modules (gnu build linux-boot) (ice-9 match))

[...]

>         (match specs
>          (() #f)
>          ((spec _ ...)
>           ;; Extract device name from first spec.
>           (match (string-tokenize spec not-comma)
>            ((device-name _ ...)
>             device-name)))))))
>
> I get 
>
> $ ./pre-inst-env guix system reconfigure /etc/config.scm --fallback
> ...
> guix system: error: exception caught while executing 'eval' on service 'root':
> ERROR: Syntax error:
> unknown location: unexpected syntax in form ()

That’s a sign that the outermost ‘match’ wasn’t macro-expanded, hence
the error about ().

I got it: that’s because this gexp is spliced in a non-top-level
context.  The end result is something like:

  (let ((foo bar)
        (baz (begin (use-modules …) …)))
    …)

and the ‘use-modules’ there doesn’t have the desired effect.

The fix is to remove this ‘use-modules’ form and instead to pass the
modules as the ‘modules’ field of ‘shepherd-service’:

  (shepherd-service
    (modules '((ice-9 match) …))
    ;; …
    )

Does that work for you?

Sorry for overlooking this before!

Ludo’.

      reply	other threads:[~2018-02-13 22:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05  8:15 [bug#30355] [PATCH] services: agetty: Make tty optional and add agetty instance to base services Danny Milosavljevic
2018-02-09 13:51 ` Ludovic Courtès
2018-02-09 19:49   ` Danny Milosavljevic
2018-02-09 22:00     ` Ludovic Courtès
2018-02-10 22:07       ` Danny Milosavljevic
2018-02-13 22:04         ` Ludovic Courtès [this message]

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=87bmgsv95x.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=30355@debbugs.gnu.org \
    --cc=dannym@scratchpost.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).