store: 'GUIX_DAEMON_SOCKET' can now be a URI.

* guix/store.scm (%daemon-socket-file): Rename to...
(%daemon-socket-uri): ... this.
(connect-to-daemon): New procedure.
(open-connection): Rename 'file' to 'uri'.  Use 'connect-to-daemon'
instead of 'open-unix-domain-socket'.
* guix/tests.scm (open-connection-for-tests): Rename 'file' to 'uri'.
* tests/guix-build.sh: Add tests.
* tests/store.scm ("open-connection with file:// URI"): New tests.
This commit is contained in:
Ludovic Courtès 2017-04-21 11:39:49 +02:00 committed by Ludovic Courtès
parent 031e6087c4
commit 1397b422e2
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
5 changed files with 70 additions and 14 deletions

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@ -56,13 +56,13 @@
(or (and=> (getenv "GUIX_BINARY_SUBSTITUTE_URL") list)
'())))
(define* (open-connection-for-tests #:optional (file (%daemon-socket-file)))
(define* (open-connection-for-tests #:optional (uri (%daemon-socket-uri)))
"Open a connection to the build daemon for tests purposes and return it."
(guard (c ((nix-error? c)
(format (current-error-port)
"warning: build daemon error: ~s~%" c)
#f))
(let ((store (open-connection file)))
(let ((store (open-connection uri)))
;; Make sure we build everything by ourselves.
(set-build-options store
#:use-substitutes? #f