unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sree Harsha Totakura <sreeharsha@totakura.in>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Guix, Hydra & Nix
Date: Mon, 31 Mar 2014 10:36:30 +0200	[thread overview]
Message-ID: <5339290E.8050208@totakura.in> (raw)
In-Reply-To: <8738i2m2ur.fsf@gnu.org>

Hi Ludo,

Thank you very much.  Please ACK my understanding.

On 03/28/2014 10:26 PM, Ludovic Courtès wrote:
> Sree Harsha Totakura <sreeharsha@totakura.in> skribis:
> 
>> From the sources, I found that build-aux/hydra/*.scm convert packages into a
>> format hydra understands for building them.
> 
> Yes.  Specifically, build-aux/hydra/*.scm return a list of “jobs”, where
> each job is represented as an alist with a number of compulsory items,
> such as ‘derivation’ (see ‘package->alist’.)
> 

OK, so the list of jobs is what is termed as a jobset in Hydra.  Jobset is a
collection of jobs + configuration for when to rebuild the jobset and where to
get the jobset's inputs (sources).

The file build-aux/hydra/gnu-system.scm prepares the jobset which contains all
packages currently in Guix.  This jobset is configured in hydra.gnu.org to
initiate a build whenever there is a new commit in Guix source repository.

The file build-aux/hydra/guix.scm is a jobset to build Guix iteself.

> The result of those scripts is then consumed by Hydra’s
> hydra-eval-guile-jobs:
> 
>   https://github.com/NixOS/hydra/blob/master/src/script/hydra-eval-guile-jobs.in
> 
> hydra-eval-guile-jobs is itself called by hydra-evaluator, from here:
> 
>   https://github.com/NixOS/hydra/blob/master/src/lib/Hydra/Helper/AddBuilds.pm
> 

Aye, this is where the magic happens.  So it looks at the file extension of the
jobset's recipe and if it is .scm, then it uses Guix.

>> Hydra refuses to install without nix-store.  So Nix has to be installed as well.
>> I'm guessing Hydra uses nix-store command to build and retrieve store paths for
>> packages given to it.  Is it true?
> 
> Yes.  ‘nix-store’ is essentially a client of {guix,nix}-daemon, just
> like ‘guix build’.  Hydra passes ‘nix-store’ a .drv file name, a
> low-level representation of the build process; ‘nix-store’ doesn’t have
> to care whether it was produced by Guix or Nix, and can’t tell the
> difference.  (Similarly, ‘guix build’ can be passed a .drv produced by
> Nix.)
> 
>> If so, how can hydra nix-store compile Guix packages?
> 
> Just like this.  :-)

Ah, so the derivations, when sent to {guix,nix}-daemon are expressed in the same
format?  `guix build' converts our guile code into this format.

So, when Hydra sees a .scm file as input, it asks Guix to convert the jobset
into derivations which are then sent to the {guix,nix}-daemon via 'nix-store'.

Does this mean that {guix,nix}-daemon are interchangeable?  Can Hydra run with
the setup: guix clients, nix clients, guix-daemon, Hydra?  Or does it need a
nix-daemon?

Sree

  reply	other threads:[~2014-03-31  8:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 13:18 Guix, Hydra & Nix Sree Harsha Totakura
2014-03-28 21:26 ` Ludovic Courtès
2014-03-31  8:36   ` Sree Harsha Totakura [this message]
2014-03-31 11:58     ` 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=5339290E.8050208@totakura.in \
    --to=sreeharsha@totakura.in \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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).