Previously, before replying to a /nar/* request, 'guix publish' would first
build up the whole nar into memory (as a consequence of
<http://bugs.gnu.org/21093>), which obviously doesn't scale.
* guix/scripts/publish.scm (render-nar): Return STORE-PATH instead of a
procedure that calls 'write-file'.
(sans-content-length): New procedure.
(http-write): For 'x-nix-archive', don't call '%http-write'. Instead, call
'write-file' right from here, using BODY as the file name.
* guix/scripts/publish.scm (%http-write): New variable.
(http-write): New procedure.
(concurrent-http-server): New variable.
(run-publish-server): Use it.
* guix/scripts/publish.scm (show-help, %options): Add --listen.
(getaddrinfo*): New procedure.
(%default-options): Add 'address'.
(open-server-socket): Replace 'addr' and 'port' with 'address', a
sockaddr.
(guix-publish): Adjust accordingly. Augment "publishing" message with
the actual address.
* doc/guix.texi (Invoking guix publish): Document it.
* guix/scripts/publish.scm (show-help): Add --user.
(%options): Likewise.
(run-publish-server): Change 'port' parameter to 'socket'. Pass
#:socket instead of #:addr and #:port to 'run-server'. Update caller
accordingly.
(open-server-socket, gather-user-privileges): New procedures.
(guix-publish): Use them. Force %PRIVATE-KEY and %PUBLIC-KEY early
on. Warn when running as root.
* doc/guix.texi (Invoking guix publish): Document --user.