From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: 'guix build' and garbage collection Date: Mon, 03 Apr 2017 10:53:08 +0200 Message-ID: <87shlprhxn.fsf@gnu.org> References: <878tnjk489.fsf@gmail.com> <87inmnb1ha.fsf@gnu.org> <871stakn8v.fsf@gmail.com> 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]:54393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuxjf-00029l-JB for guix-devel@gnu.org; Mon, 03 Apr 2017 04:53:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuxja-0001kn-P0 for guix-devel@gnu.org; Mon, 03 Apr 2017 04:53:15 -0400 In-Reply-To: <871stakn8v.fsf@gmail.com> (Chris Marusich's message of "Sun, 02 Apr 2017 23:40:16 -0700") 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" To: Chris Marusich Cc: guix-devel@gnu.org Hi Chris, Chris Marusich skribis: > My understanding is that Nix builds derivations in a temporary > directory. My understanding is that eventually, we copy the results of > the build into the final, content-addressed store path. Since we don't > know the final, content-addressed store path until after we calculate > the hash of the output, how do we prevent that final store path from > being garbage collected while the build process is running? Do we use > addTempRoot to add the final, content-addressed store path as a > temporary root, too? I looked in the code but couldn't figure this out. Store items are not content-addressed, except for fixed-output derivations and things added with =E2=80=98add-to-store=E2=80=99 and =E2=80=98add-text-to-store=E2=80=99. Leaving these two special cases aside, store file names are computed as a function of the build inputs of a derivation. In Eelco Dolstra=E2=80=99s thesis, both models are described: the =E2=80=9Cextensional model=E2=80=9D = (the one Nix and Guix use) and the =E2=80=9Cintensional model=E2=80=9D (content-addressa= bility, which has never been deployed, and which is challenging in many ways.) HTH! Ludo=E2=80=99.