From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Guix, Hydra & Nix Date: Mon, 31 Mar 2014 13:58:25 +0200 Message-ID: <871txiinq6.fsf@gnu.org> References: <5335768A.3080702@totakura.in> <8738i2m2ur.fsf@gnu.org> <5339290E.8050208@totakura.in> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUarJ-0002Kk-2u for guix-devel@gnu.org; Mon, 31 Mar 2014 07:58:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUarE-0006Wn-P3 for guix-devel@gnu.org; Mon, 31 Mar 2014 07:58:33 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:53834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUarE-0006Wj-AY for guix-devel@gnu.org; Mon, 31 Mar 2014 07:58:28 -0400 In-Reply-To: <5339290E.8050208@totakura.in> (Sree Harsha Totakura's message of "Mon, 31 Mar 2014 10:36:30 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Sree Harsha Totakura Cc: guix-devel Hello! Sree Harsha Totakura skribis: > On 03/28/2014 10:26 PM, Ludovic Court=C3=A8s wrote: >> Sree Harsha Totakura skribis: >>=20 >>> From the sources, I found that build-aux/hydra/*.scm convert packages i= nto a >>> format hydra understands for building them. >>=20 >> Yes. Specifically, build-aux/hydra/*.scm return a list of =E2=80=9Cjobs= =E2=80=9D, where >> each job is represented as an alist with a number of compulsory items, >> such as =E2=80=98derivation=E2=80=99 (see =E2=80=98package->alist=E2=80= =99.) >>=20 > > OK, so the list of jobs is what is termed as a jobset in Hydra. Jobset i= s a > collection of jobs + configuration for when to rebuild the jobset and whe= re to > get the jobset's inputs (sources). > > The file build-aux/hydra/gnu-system.scm prepares the jobset which contain= s 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. Yes. >> The result of those scripts is then consumed by Hydra=E2=80=99s >> hydra-eval-guile-jobs: >>=20 >> https://github.com/NixOS/hydra/blob/master/src/script/hydra-eval-guile= -jobs.in >>=20 >> hydra-eval-guile-jobs is itself called by hydra-evaluator, from here: >>=20 >> https://github.com/NixOS/hydra/blob/master/src/lib/Hydra/Helper/AddBui= lds.pm >>=20 > > 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. Exactly (strictly speaking, it uses Guile, Guix being just a Guile library.) >>> 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 p= aths for >>> packages given to it. Is it true? >>=20 >> Yes. =E2=80=98nix-store=E2=80=99 is essentially a client of {guix,nix}-= daemon, just >> like =E2=80=98guix build=E2=80=99. Hydra passes =E2=80=98nix-store=E2= =80=99 a .drv file name, a >> low-level representation of the build process; =E2=80=98nix-store=E2=80= =99 doesn=E2=80=99t have >> to care whether it was produced by Guix or Nix, and can=E2=80=99t tell t= he >> difference. (Similarly, =E2=80=98guix build=E2=80=99 can be passed a .d= rv produced by >> Nix.) >>=20 >>> If so, how can hydra nix-store compile Guix packages? >>=20 >> Just like this. :-) > > Ah, so the derivations, when sent to {guix,nix}-daemon are expressed in t= he same > format? `guix build' converts our guile code into this format. Right. Try cat $(guix build -d emacs) to see what it looks like. Quoth the manual (info "(guix) Programming Interface"): Lower-level APIs are available to interact with the daemon and the store. To instruct the daemon to perform a build action, users actually provide it with a "derivation". A derivation is a low-level representation of the build actions to be taken, and the environment in which they should occur=E2=80=94derivations are to package definitions wh= at assembly is to C programs. > So, when Hydra sees a .scm file as input, it asks Guix to convert the job= set > into derivations which are then sent to the {guix,nix}-daemon via 'nix-st= ore'. Yes. > Does this mean that {guix,nix}-daemon are interchangeable? Yes and no. The core functionality is the same, but the command-line interface is different, and the default settings is different (for instance, guix-daemon uses chroot builds by default, with nothing in /bin, whereas nix-daemon uses non-chroot builds by default.) > Can Hydra run with the setup: guix clients, nix clients, guix-daemon, > Hydra? Or does it need a nix-daemon? No, no need for nix-daemon. On hydra.gnu.org, we have guix-daemon running, and Guix and Nix clients, the latter being there for Hydra. HTH! Ludo=E2=80=99.