unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* <derivation> objects supplant ‘.drv’ file names in the API
@ 2013-09-18 21:03 Ludovic Courtès
  0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2013-09-18 21:03 UTC (permalink / raw)
  To: guix-devel

Commit 59688fc introduces notable changes: ‘derivation’,
‘build-expression->derivation’, ‘package-derivation’ and similar
procedures now return a single value, which is a <derivation> object
(previously they would return two values: the .drv file name, and the
<derivation> object.)  The <derivation> object embeds its .drv file name
now:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(gnu packages emacs)
scheme@(guile-user)> ,use(guix store)
scheme@(guile-user)> ,use(guix packages)
scheme@(guile-user)> (define s (open-connection))
scheme@(guile-user)> (package-derivation s emacs)
$2 = #<derivation /nix/store/2lfkipm8ydbv3wmj5ryk49nh4hbmwj6w-emacs-24.3.drv => /nix/store/1hkq0q72bki73aa21rakzcffq81vihs1-emacs-24.3 2b2db40>
scheme@(guile-user)> (package-cross-derivation s emacs "mips64el-linux-gnuabi64")
$3 = #<derivation /nix/store/fc2i5f4kdr3af1h05xjpc7j4h7zqp6k0-emacs-24.3.drv => /nix/store/r478bpdq3mjpci7gsxchjs31xcpgw4f3-emacs-24.3 3af9aa0>
--8<---------------cut here---------------end--------------->8---

So the API only sees <derivation> objects now, with the exception of a
few RPCs (defined in (guix store)), which still pass .drv file names to
the daemon.

I think that makes the API much nicer, as can be seen in the tests/*
files changed in this patch.  It also avoids costs that we previously
had, such as repeated calls ‘derivation-path->output-path’, which has to
parse a .drv file entirely just to extract its output paths (though the
costs were hidden through memoization.)

Comments welcome, and please report any problems you may have!

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-18 21:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-18 21:03 <derivation> objects supplant ‘.drv’ file names in the API 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).