unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Including additional modules in dmd services
@ 2015-11-20  3:47 David Thompson
  2015-11-20 14:03 ` Ludovic Courtès
  2015-11-25 11:04 ` Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: David Thompson @ 2015-11-20  3:47 UTC (permalink / raw)
  To: guix-devel

Hello hackers,

I am finally getting up to speed on the new service API, and I believe
I've run into a limitation of dmd services.  I wanted to use 'match'
from (ice-9 match) in the "start" action for a dmd service, like so:

    (dmd-service
     (provision '(foo))
     (documentation "Foo service.")
     (requirement '(user-processes))
     (start #~(begin
                (use-modules (ice-9 match))
                (match #$something
                  (foo ...))))
     (stop #~(const #t)))

The problem is that, while the module is successfully imported, the
'match' form is not treated as syntax, and thus the service fails with
an unbound variable 'foo' exception.  I hacked 'dmd-configuration-file'
in gnu/services/dmd.scm to import (ice-9 match) in the top-most
'use-modules' form of the 'config' gexp and then my service worked as
intended.

Am I just doing it wrong?  If it's a real limitation, what would be the
best way to specify the additional modules needed?  I looked around at
the various dmd services and couldn't find any other examples of needing
macros from another module.  I would love to know how to resolve this so
that I can continue my quest of managing user SSH keys with a dmd
service.

Thanks,

-- 
David Thompson
GPG Key: 0FF1D807

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

* Re: Including additional modules in dmd services
  2015-11-20  3:47 Including additional modules in dmd services David Thompson
@ 2015-11-20 14:03 ` Ludovic Courtès
  2015-11-25 11:04 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2015-11-20 14:03 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

David Thompson <dthompson2@worcester.edu> skribis:

> Am I just doing it wrong?  If it's a real limitation, what would be the
> best way to specify the additional modules needed?  I looked around at
> the various dmd services and couldn't find any other examples of needing
> macros from another module.  I would love to know how to resolve this so
> that I can continue my quest of managing user SSH keys with a dmd
> service.

No you’re not doing it wrong!  It just happens that the current list of
modules visible to dmd code is hard-coded in ‘dmd-configuration-file’,
in (gnu services dmd).

Short-term workaround is to add (ice-9 match) there.

Longer-term, I’d like to have each service in its own file, with its own
set of modules.  ‘dmd-service’ would presumably have a new ‘modules’
field for that.

I’ll look into it.

Thanks,
Ludo’.

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

* Re: Including additional modules in dmd services
  2015-11-20  3:47 Including additional modules in dmd services David Thompson
  2015-11-20 14:03 ` Ludovic Courtès
@ 2015-11-25 11:04 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2015-11-25 11:04 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

With commit fae685b, <dmd-service> has a ‘modules’ and an
‘imported-modules’ field, following the same pattern used for <origin>.

Let me know what you think!

Ludo’.

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

end of thread, other threads:[~2015-11-25 11:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20  3:47 Including additional modules in dmd services David Thompson
2015-11-20 14:03 ` Ludovic Courtès
2015-11-25 11:04 ` Ludovic Courtès

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