From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: =?utf-8?Q?=E2=80=98guix_publish=E2=80=99?= as a content-addressed file server Date: Wed, 20 Jul 2016 17:25:30 +0200 Message-ID: <87bn1s9vrp.fsf@gnu.org> 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]:42390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPtNT-0002Eq-JS for guix-devel@gnu.org; Wed, 20 Jul 2016 11:25:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPtNO-0007ec-BP for guix-devel@gnu.org; Wed, 20 Jul 2016 11:25:38 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPtNN-0007eY-Vk for guix-devel@gnu.org; Wed, 20 Jul 2016 11:25:34 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:55888 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPtNN-0008OG-64 for guix-devel@gnu.org; Wed, 20 Jul 2016 11:25:33 -0400 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: guix-devel Hi! Until now, if hydra.gnu.org had a source file in its store (the result of an =E2=80=98origin=E2=80=99), you could get it via substitutes. However= , with substitutes disabled, hydra.gnu.org was of no help, even though it did have the source file. Commit ff6638d112d794c9c433731643711932452fd2ff helps address that: it augments =E2=80=98guix publish=E2=80=99 such that it can be used as a conte= nt-addressed mirror for source files=C2=B9. If you run =E2=80=98guix publish -p 9999=E2=80=99 on your machine, and if hello-2.10.tar.gz is in the store, then this URL: http://localhost:9999/file/hello-2.10.tar.gz/sha256/0ssi1wpaf7plaswqqjwig= ppsg5fyh99vdlb9kzl7c9lng89ndq1i =E2=80=A6 gives you hello-2.10.tar.gz. This works by constructing the corresponding store file name, assuming the file being requested results from a fixed-output derivation using the same hash algorithm (SHA256 here) or was added with =E2=80=98add-to-sto= re=E2=80=99. That the hash algorithm must match is a limitation, but it=E2=80=99s probab= ly =E2=80=9Cgood enough=E2=80=9D for our purposes. Eventually I think we=E2=80=99ll run it on our build farm and add the URL to =E2=80=98%content-addressed-mirrors=E2=80=99 in (guix download). Feedback welcome. :-) Ludo=E2=80=99. =C2=B9 https://lists.gnu.org/archive/html/guix-devel/2016-05/msg00450.html