From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 26 16:17:56 2022 Received: (at 54997) by debbugs.gnu.org; 26 Apr 2022 20:17:56 +0000 Received: from localhost ([127.0.0.1]:40621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njRdE-00087T-Af for submit@debbugs.gnu.org; Tue, 26 Apr 2022 16:17:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njRdB-00087E-Nc for 54997@debbugs.gnu.org; Tue, 26 Apr 2022 16:17:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njRd5-00088A-DE; Tue, 26 Apr 2022 16:17:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Vq/HzkxHuh1q9r5D+G5dNUMfsvOFNZg/beXmqq7DyGk=; b=mVnWnILQVRbq+UO+Qs5X 0ZYlEAGC5dfRvfeitaSzRIveLZSeoEHyFdbfwhM0X/zPGfiaCN8VR19TbVXcJ1k2JmPh/Vs6f3rJl 2PCxbx+ZyV/84UP379Vd37hInZDtgldFIQOrZHHe2uy61RcQNEV3uNqdlwHBIyxcbLyF3li7tEv+r wgWForJSI7kRi6QLlObK/Ynejq14N2pigeyNA9rGTWu8siQn7sCTTTbSpL7jkoGA9YsrU9PbSRNkU 5s9BtpkmpGbRRs46efrByJXqxdH2FITJPnnUwUYkW+PXjOkkbOY6ZCzwdGmkbxDK1yPoTSYJUZWgE lqJoVTEU+blQ3g==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:64923 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njRd5-0003kb-1H; Tue, 26 Apr 2022 16:17:47 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Thiago Jung Bauermann Subject: Re: bug#54997: [PATCH 00/12] Add "least authority" program wrapper References: <20220417210107.27263-1-ludo@gnu.org> <20220417210453.27884-1-ludo@gnu.org> <871qxpvh04.fsf@kolabnow.com> Date: Tue, 26 Apr 2022 22:17:44 +0200 In-Reply-To: <871qxpvh04.fsf@kolabnow.com> (Thiago Jung Bauermann's message of "Fri, 22 Apr 2022 02:01:39 -0300") Message-ID: <874k2flhuf.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54997 Cc: 54997@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Thiago, Thiago Jung Bauermann skribis: > This is an awesome series! It will be yet another strength of Guix to > have many services as possible (and even desktop apps, hopefully) > isolated. Thanks. :-) > Ludovic Court=C3=A8s writes: > >> + (define (read-graph port) >> + ;; Return the list of references read fr= om >> + ;; PORT. This is a stripped-down versio= n of >> + ;; 'read-reference-graph'. >> + (let loop ((items '())) >> + (match (read-line port) >> + ((? eof-object?) >> + items) >> + ((? string? item) >> + (let ((deriver (read-line port)) >> + (count >> + (string->number (read-line p= ort)))) >> + (drop-lines port count) >> + (loop (cons item items))))))) > > I'm sure I'm being dense, but I don't see how =E2=80=98item=E2=80=99 can = change between > iterations of this loop. Each iteration reads a new line from PORT, an input port on a text file. The file is created by guix-daemon and has a format like this: FILE DERIVER NUMBER-OF-REFERENCES REF1 ... REFN where each FILE is a store item (see store-copy.scm for details). Here we only care about FILE and REF*. > Which in my mind means that =E2=80=98read-graph=E2=80=99 can only return = a list where > the original =E2=80=98item=E2=80=99 argument from =E2=80=98references-fil= e=E2=80=99 is repeated many > times over. I ran the tests/gexp.scm test and all tests pass, so this > code must be working... I think it does! :-) It wouldn=E2=80=99t hurt to add a call to =E2=80=98delete-duplicates=E2=80=99 though. Ludo=E2=80=99.