From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Guix to participate in the Google Summer of Code Date: Wed, 21 Feb 2018 10:10:05 +0100 Message-ID: <87fu5ur9n6.fsf@mdc-berlin.de> References: <87h8qjp20e.fsf@gnu.org> <871shircab.fsf@gmail.com> <874lmey4ki.fsf@elephly.net> <87vaetnf1d.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]:56767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoRgW-0003iK-JY for guix-devel@gnu.org; Wed, 21 Feb 2018 05:31:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoRgU-0002wy-B2 for guix-devel@gnu.org; Wed, 21 Feb 2018 05:31:36 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21082) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eoRgU-0002wn-4T for guix-devel@gnu.org; Wed, 21 Feb 2018 05:31:34 -0500 In-reply-to: <87vaetnf1d.fsf@gmail.com> 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: Alex Vong Cc: Guix-devel Hi Alex, >> The reference scanner is already implemented in the form of grafts. The >> code opens each file and searches efficiently for store references. >> > Does this mean we have procedure to do a single find-reference and the > remaining work is to build a recursive find-reference? The current way to obtain references is through the daemon. In (guix store) there is a procedure =E2=80=9Creferences=E2=80=9D that is used whene= ver we want to get a list of references for a store item. But how does the daemon itself obtain those references in the first place? =E2=80=9Cnix/libstore/references.cc=E2=80=9D implements a reference scanner= and it is quite similar to how =E2=80=9Creplace-store-references=E2=80=9D in (guix bu= ild graft) works. So a first step towards an implementation of the reference scanner would be to liberate =E2=80=9Creplace-store-references=E2=80=9D from its grafting= context; possibly turn it into a higher order function that finds references and optionally invokes a function when a reference is found. Then it could be used for grafting as well as for collecting references in the daemon. But I would recommend to revive the work from the last GSoC first. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net