[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guix, Hydra & Nix
From: |
Sree Harsha Totakura |
Subject: |
Re: Guix, Hydra & Nix |
Date: |
Mon, 31 Mar 2014 10:36:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 |
Hi Ludo,
Thank you very much. Please ACK my understanding.
On 03/28/2014 10:26 PM, Ludovic Courtès wrote:
> Sree Harsha Totakura <address@hidden> 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