guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gexps and ‘with-imported-modules’


From: Ludovic Courtès
Subject: gexps and ‘with-imported-modules’
Date: Mon, 04 Jul 2016 00:20:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hello!

The ‘wip-gexp-imported-modules’ branch changes gexps so that each gexp
embeds information about which modules need to be imported into its
execution environment.

Before you would do:

  (gexp->derivation "foo"
                    #~(begin
                        (use-modules (guix build utils))
                        …)
                    #:modules '((guix build utils)))

to specify that (guix build utils) must be imported in the build
environment of “foo”.  After, it becomes:

  (gexp->derivation "foo"
                    (with-imported-modules '((guix build utils))
                      #~(begin
                          (use-modules (guix build utils))
                          …)))

The gain (not visible here) is that when you nest gexps, the outermost
gexp now contains all the info about modules that need to be imported.
That way, no side channel is needed to carry the imported module info
(by “side channel”, I mean things like the ‘imported-modules’ field
currently found in <shepherd-service> and several other places.)  Thus,
it should be easier to compose gexps.

I plan to merge it within a day or two.

Comments welcome!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]