unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 65b1a929b00e276512191583223a5301496d866f 2476 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
51
52
53
54
 
@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.

Likewise, when returning @code{unpacked}, @var{nar-downloader}
does not need to normalize timestamps and file permissions.

@end deffn

debug log:

solving 65b1a929b0 ...
found 65b1a929b0 in https://yhetil.org/guix-patches/c9f5535b93c0e0e832017e8f6f4ec3182fdad971.camel@telenet.be/
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/3] 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/3] https://yhetil.org/guix-patches/c9f5535b93c0e0e832017e8f6f4ec3182fdad971.camel@telenet.be/
diff --git a/doc/substituters.texi b/doc/substituters.texi
index f86a1cb26c..516e2c1eea 100644


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

Checking patch doc/substituters.texi...
Applied patch doc/substituters.texi cleanly.
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 65b1a929b00e276512191583223a5301496d866f	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).