unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 516e2c1eeaa563b6641487d4f8352bb0ddf7c980 2351 bytes (raw)
name: doc/substituters.texi 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
@node Defining Substituters
@section Defining Substituters

@cindex substitutes, implementation
Guix currently only supports downloading substitutes via the HTTP and
HTTPS protocols, and substitutes over IPFS and GNUnet are planned.
An implementation of substitutes over some protocol is called a
‘substituter’.

The API described here is implemented by the @code{(guix scripts substitute)}
module. In order to let the daemon actually find the substituter, the
substituter should be defined in a module @code{(guix scripts substitute name)},
as a variable @var{name}-substituter.

@deffn {Scheme Procedure} make-substituter @var{name} @var{nar-downloader} @
  @var{fetch-narinfos} @var{recognised-uri-schemes}
Return a substituter for the protocols in @var{recognised-uri-schemes},
a list of URI schemes.  @var{fetch-narinfos} will be used finding narinfos
and @var{nar-downloader} to download a substitute.

The procedure @var{nar-downloader} must be a keyword procedure
(@pxref{Optional Arguments, keyword arguments in Guile,, guile, GNU
Guile Reference Manual}).  It accepts two positional arguments
@var{destination} and @var{narinfo}.  @var{destination} is the location
in the file system where the store item should be written to,
and @var{narinfo} is the narinfo describing the substitute to download.

It should return @code{#f} if the substitute is not available
via this method.  If the substitute was available, it should either
return an input port to read the nar from.

@c TODO currently unimplemented, but will be used by the IPFS substituter:
@c or the symbol @code{unpacked}
@c if the substituter wrote the store item to @var{destination} by itself.

The procedure @var{fetch-narinfos} must accept two arguments
@var{url} and @var{paths}, where @var{url} is the URL (as a string)
of a substitute server and @var{paths} is a list of store item names
for which to find a narinfo.

This procedure should return a list of narinfos pertaining to
@var{paths} (possibly empty).  It can be assumed @var{url}
has an URI scheme in @var{recognised-uri-schemes}.

A substituter does not have to verify whether the narinfo and nar
are correctly signed and have a correct hash; this is handled
by @code{(guix scripts substitute)}.  @var{nar-downloader} and
@var{fetch-narinfos} can be @code{#f} if unimplemented by this
substituter.
@end deffn

debug log:

solving 516e2c1eea ...
found 516e2c1eea in https://yhetil.org/guix-patches/c9f5535b93c0e0e832017e8f6f4ec3182fdad971.camel@telenet.be/
found f86a1cb26c in https://yhetil.org/guix-patches/c9f5535b93c0e0e832017e8f6f4ec3182fdad971.camel@telenet.be/

applying [1/2] https://yhetil.org/guix-patches/c9f5535b93c0e0e832017e8f6f4ec3182fdad971.camel@telenet.be/
diff --git a/doc/substituters.texi b/doc/substituters.texi
new file mode 100644
index 0000000000..f86a1cb26c


applying [2/2] https://yhetil.org/guix-patches/c9f5535b93c0e0e832017e8f6f4ec3182fdad971.camel@telenet.be/
diff --git a/doc/substituters.texi b/doc/substituters.texi
index f86a1cb26c..516e2c1eea 100644

Checking patch doc/substituters.texi...
Applied patch doc/substituters.texi cleanly.
Checking patch doc/substituters.texi...
Applied patch doc/substituters.texi cleanly.

index at:
100644 516e2c1eeaa563b6641487d4f8352bb0ddf7c980	doc/substituters.texi

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).