diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2019-01-21 15:32:35 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-01-21 23:09:55 +0100 |
| commit | de9fbe9cdcf5f8deb08becfc54b523084fd67bda (patch) | |
| tree | 92922d56823c6c7ade981915081e1c69939c6697 | |
| parent | 3a0b2c6c6efd221341def2adf17279a9566555f7 (diff) | |
store: Rename <nix-server> to <store-connection>.
* guix/store.scm (<nix-server>): Rename to...
(<store-connection>): ... this. Adjust users accordingly.
(nix-server?, nix-server-major-version)
(nix-server-minor-version, nix-server-socket)
(nix-server-version): Define as deprecated aliases.
* guix/inferior.scm: Adjust accordingly.
* guix/ssh.scm: Likewise.
| -rw-r--r-- | guix/inferior.scm | 12 | ||||
| -rw-r--r-- | guix/ssh.scm | 6 | ||||
| -rw-r--r-- | guix/store.scm | 153 |
3 files changed, 95 insertions, 76 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm index 9f19e7d3166..6cfa146029b 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm | |||
| @@ -26,9 +26,9 @@ | |||
| 26 | version>? version-prefix? | 26 | version>? version-prefix? |
| 27 | cache-directory)) | 27 | cache-directory)) |
| 28 | #:use-module ((guix store) | 28 | #:use-module ((guix store) |
| 29 | #:select (nix-server-socket | 29 | #:select (store-connection-socket |
| 30 | nix-server-major-version | 30 | store-connection-major-version |
| 31 | nix-server-minor-version | 31 | store-connection-minor-version |
| 32 | store-lift)) | 32 | store-lift)) |
| 33 | #:use-module ((guix derivations) | 33 | #:use-module ((guix derivations) |
| 34 | #:select (read-derivation-from-file)) | 34 | #:select (read-derivation-from-file)) |
| @@ -424,8 +424,8 @@ thus be the code of a one-argument procedure that accepts a store." | |||
| 424 | (chmod directory #o700) | 424 | (chmod directory #o700) |
| 425 | (let* ((name (string-append directory "/inferior")) | 425 | (let* ((name (string-append directory "/inferior")) |
| 426 | (socket (socket AF_UNIX SOCK_STREAM 0)) | 426 | (socket (socket AF_UNIX SOCK_STREAM 0)) |
| 427 | (major (nix-server-major-version store)) | 427 | (major (store-connection-major-version store)) |
| 428 | (minor (nix-server-minor-version store)) | 428 | (minor (store-connection-minor-version store)) |
| 429 | (proto (logior major minor))) | 429 | (proto (logior major minor))) |
| 430 | (bind socket AF_UNIX name) | 430 | (bind socket AF_UNIX name) |
| 431 | (listen socket 1024) | 431 | (listen socket 1024) |
| @@ -451,7 +451,7 @@ thus be the code of a one-argument procedure that accepts a store." | |||
| 451 | inferior) | 451 | inferior) |
| 452 | (match (accept socket) | 452 | (match (accept socket) |
| 453 | ((client . address) | 453 | ((client . address) |
| 454 | (proxy client (nix-server-socket store)))) | 454 | (proxy client (store-connection-socket store)))) |
| 455 | (close-port socket) | 455 | (close-port socket) |
| 456 | (read-inferior-response inferior))))) | 456 | (read-inferior-response inferior))))) |
| 457 | 457 | ||
diff --git a/guix/ssh.scm b/guix/ssh.scm index d90cb77be04..77329618d56 100644 --- a/guix/ssh.scm +++ b/guix/ssh.scm | |||
| @@ -180,7 +180,7 @@ right away." | |||
| 180 | (socket-name | 180 | (socket-name |
| 181 | "/var/guix/daemon-socket/socket")) | 181 | "/var/guix/daemon-socket/socket")) |
| 182 | "Connect to the remote build daemon listening on SOCKET-NAME over SESSION, | 182 | "Connect to the remote build daemon listening on SOCKET-NAME over SESSION, |
| 183 | an SSH session. Return a <nix-server> object." | 183 | an SSH session. Return a <store-connection> object." |
| 184 | (open-connection #:port (remote-daemon-channel session socket-name))) | 184 | (open-connection #:port (remote-daemon-channel session socket-name))) |
| 185 | 185 | ||
| 186 | 186 | ||
| @@ -288,7 +288,7 @@ REMOTE, a remote store. When RECURSIVE? is true, send the closure of FILES. | |||
| 288 | Return the list of store items actually sent." | 288 | Return the list of store items actually sent." |
| 289 | ;; Compute the subset of FILES missing on SESSION and send them. | 289 | ;; Compute the subset of FILES missing on SESSION and send them. |
| 290 | (let* ((files (if recursive? (requisites local files) files)) | 290 | (let* ((files (if recursive? (requisites local files) files)) |
| 291 | (session (channel-get-session (nix-server-socket remote))) | 291 | (session (channel-get-session (store-connection-socket remote))) |
| 292 | (missing (inferior-remote-eval | 292 | (missing (inferior-remote-eval |
| 293 | `(begin | 293 | `(begin |
| 294 | (use-modules (guix) | 294 | (use-modules (guix) |
| @@ -345,7 +345,7 @@ Return the list of store items actually sent." | |||
| 345 | (define (remote-store-session remote) | 345 | (define (remote-store-session remote) |
| 346 | "Return the SSH channel beneath REMOTE, a remote store as returned by | 346 | "Return the SSH channel beneath REMOTE, a remote store as returned by |
| 347 | 'connect-to-remote-daemon', or #f." | 347 | 'connect-to-remote-daemon', or #f." |
| 348 | (channel-get-session (nix-server-socket remote))) | 348 | (channel-get-session (store-connection-socket remote))) |
| 349 | 349 | ||
| 350 | (define (remote-store-host remote) | 350 | (define (remote-store-host remote) |
| 351 | "Return the name of the host REMOTE is connected to, where REMOTE is a | 351 | "Return the name of the host REMOTE is connected to, where REMOTE is a |
diff --git a/guix/store.scm b/guix/store.scm index 1f88eb2b33f..f8c79788b85 100644 --- a/guix/store.scm +++ b/guix/store.scm | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | (define-module (guix store) | 20 | (define-module (guix store) |
| 21 | #:use-module (guix utils) | 21 | #:use-module (guix utils) |
| 22 | #:use-module (guix config) | 22 | #:use-module (guix config) |
| 23 | #:use-module (guix deprecation) | ||
| 23 | #:use-module (guix memoization) | 24 | #:use-module (guix memoization) |
| 24 | #:use-module (guix serialization) | 25 | #:use-module (guix serialization) |
| 25 | #:use-module (guix monads) | 26 | #:use-module (guix monads) |
| @@ -51,11 +52,19 @@ | |||
| 51 | %gc-roots-directory | 52 | %gc-roots-directory |
| 52 | %default-substitute-urls | 53 | %default-substitute-urls |
| 53 | 54 | ||
| 55 | store-connection? | ||
| 56 | store-connection-version | ||
| 57 | store-connection-major-version | ||
| 58 | store-connection-minor-version | ||
| 59 | store-connection-socket | ||
| 60 | |||
| 61 | ;; Deprecated forms for 'store-connection'. | ||
| 54 | nix-server? | 62 | nix-server? |
| 55 | nix-server-version | 63 | nix-server-version |
| 56 | nix-server-major-version | 64 | nix-server-major-version |
| 57 | nix-server-minor-version | 65 | nix-server-minor-version |
| 58 | nix-server-socket | 66 | nix-server-socket |
| 67 | |||
| 59 | current-store-protocol-version ;for internal use | 68 | current-store-protocol-version ;for internal use |
| 60 | mcached | 69 | mcached |
| 61 | 70 | ||
| @@ -335,31 +344,39 @@ | |||
| 335 | 344 | ||
| 336 | ;; remote-store.cc | 345 | ;; remote-store.cc |
| 337 | 346 | ||
| 338 | (define-record-type* <nix-server> nix-server %make-nix-server | 347 | (define-record-type* <store-connection> store-connection %make-store-connection |
| 339 | nix-server? | 348 | store-connection? |
| 340 | (socket nix-server-socket) | 349 | (socket store-connection-socket) |
| 341 | (major nix-server-major-version) | 350 | (major store-connection-major-version) |
| 342 | (minor nix-server-minor-version) | 351 | (minor store-connection-minor-version) |
| 343 | 352 | ||
| 344 | (buffer nix-server-output-port) ;output port | 353 | (buffer store-connection-output-port) ;output port |
| 345 | (flush nix-server-flush-output) ;thunk | 354 | (flush store-connection-flush-output) ;thunk |
| 346 | 355 | ||
| 347 | ;; Caches. We keep them per-connection, because store paths build | 356 | ;; Caches. We keep them per-connection, because store paths build |
| 348 | ;; during the session are temporary GC roots kept for the duration of | 357 | ;; during the session are temporary GC roots kept for the duration of |
| 349 | ;; the session. | 358 | ;; the session. |
| 350 | (ats-cache nix-server-add-to-store-cache) | 359 | (ats-cache store-connection-add-to-store-cache) |
| 351 | (atts-cache nix-server-add-text-to-store-cache) | 360 | (atts-cache store-connection-add-text-to-store-cache) |
| 352 | (object-cache nix-server-object-cache | 361 | (object-cache store-connection-object-cache |
| 353 | (default vlist-null))) ;vhash | 362 | (default vlist-null))) ;vhash |
| 354 | 363 | ||
| 355 | (set-record-type-printer! <nix-server> | 364 | (set-record-type-printer! <store-connection> |
| 356 | (lambda (obj port) | 365 | (lambda (obj port) |
| 357 | (format port "#<build-daemon ~a.~a ~a>" | 366 | (format port "#<store-connection ~a.~a ~a>" |
| 358 | (nix-server-major-version obj) | 367 | (store-connection-major-version obj) |
| 359 | (nix-server-minor-version obj) | 368 | (store-connection-minor-version obj) |
| 360 | (number->string (object-address obj) | 369 | (number->string (object-address obj) |
| 361 | 16)))) | 370 | 16)))) |
| 362 | 371 | ||
| 372 | (define-deprecated/alias nix-server? store-connection?) | ||
| 373 | (define-deprecated/alias nix-server-major-version | ||
| 374 | store-connection-major-version) | ||
| 375 | (define-deprecated/alias nix-server-minor-version | ||
| 376 | store-connection-minor-version) | ||
| 377 | (define-deprecated/alias nix-server-socket store-connection-socket) | ||
| 378 | |||
| 379 | |||
| 363 | (define-condition-type &nix-error &error | 380 | (define-condition-type &nix-error &error |
| 364 | nix-error?) | 381 | nix-error?) |
| 365 | 382 | ||
| @@ -515,13 +532,13 @@ for this connection will be pinned. Return a server object." | |||
| 515 | (write-int cpu-affinity port))) | 532 | (write-int cpu-affinity port))) |
| 516 | (when (>= (protocol-minor v) 11) | 533 | (when (>= (protocol-minor v) 11) |
| 517 | (write-int (if reserve-space? 1 0) port)) | 534 | (write-int (if reserve-space? 1 0) port)) |
| 518 | (let ((conn (%make-nix-server port | 535 | (let ((conn (%make-store-connection port |
| 519 | (protocol-major v) | 536 | (protocol-major v) |
| 520 | (protocol-minor v) | 537 | (protocol-minor v) |
| 521 | output flush | 538 | output flush |
| 522 | (make-hash-table 100) | 539 | (make-hash-table 100) |
| 523 | (make-hash-table 100) | 540 | (make-hash-table 100) |
| 524 | vlist-null))) | 541 | vlist-null))) |
| 525 | (let loop ((done? (process-stderr conn))) | 542 | (let loop ((done? (process-stderr conn))) |
| 526 | (or done? (process-stderr conn))) | 543 | (or done? (process-stderr conn))) |
| 527 | conn))))))))) | 544 | conn))))))))) |
| @@ -536,27 +553,29 @@ already taken place on PORT and that we're just continuing on this established | |||
| 536 | connection. Use with care." | 553 | connection. Use with care." |
| 537 | (let-values (((output flush) | 554 | (let-values (((output flush) |
| 538 | (buffering-output-port port (make-bytevector 8192)))) | 555 | (buffering-output-port port (make-bytevector 8192)))) |
| 539 | (%make-nix-server port | 556 | (%make-store-connection port |
| 540 | (protocol-major version) | 557 | (protocol-major version) |
| 541 | (protocol-minor version) | 558 | (protocol-minor version) |
| 542 | output flush | 559 | output flush |
| 543 | (make-hash-table 100) | 560 | (make-hash-table 100) |
| 544 | (make-hash-table 100) | 561 | (make-hash-table 100) |
| 545 | vlist-null))) | 562 | vlist-null))) |
| 546 | 563 | ||
| 547 | (define (nix-server-version store) | 564 | (define (store-connection-version store) |
| 548 | "Return the protocol version of STORE as an integer." | 565 | "Return the protocol version of STORE as an integer." |
| 549 | (protocol-version (nix-server-major-version store) | 566 | (protocol-version (store-connection-major-version store) |
| 550 | (nix-server-minor-version store))) | 567 | (store-connection-minor-version store))) |
| 568 | |||
| 569 | (define-deprecated/alias nix-server-version store-connection-version) | ||
| 551 | 570 | ||
| 552 | (define (write-buffered-output server) | 571 | (define (write-buffered-output server) |
| 553 | "Flush SERVER's output port." | 572 | "Flush SERVER's output port." |
| 554 | (force-output (nix-server-output-port server)) | 573 | (force-output (store-connection-output-port server)) |
| 555 | ((nix-server-flush-output server))) | 574 | ((store-connection-flush-output server))) |
| 556 | 575 | ||
| 557 | (define (close-connection server) | 576 | (define (close-connection server) |
| 558 | "Close the connection to SERVER." | 577 | "Close the connection to SERVER." |
| 559 | (close (nix-server-socket server))) | 578 | (close (store-connection-socket server))) |
| 560 | 579 | ||
| 561 | (define-syntax-rule (with-store store exp ...) | 580 | (define-syntax-rule (with-store store exp ...) |
| 562 | "Bind STORE to an open connection to the store and evaluate EXPs; | 581 | "Bind STORE to an open connection to the store and evaluate EXPs; |
| @@ -566,7 +585,7 @@ automatically close the store when the dynamic extent of EXP is left." | |||
| 566 | (const #f) | 585 | (const #f) |
| 567 | (lambda () | 586 | (lambda () |
| 568 | (parameterize ((current-store-protocol-version | 587 | (parameterize ((current-store-protocol-version |
| 569 | (nix-server-version store))) | 588 | (store-connection-version store))) |
| 570 | exp) ...) | 589 | exp) ...) |
| 571 | (lambda () | 590 | (lambda () |
| 572 | (false-if-exception (close-connection store)))))) | 591 | (false-if-exception (close-connection store)))))) |
| @@ -622,7 +641,7 @@ Since the build process's output cannot be assumed to be UTF-8, we | |||
| 622 | conservatively consider it to be Latin-1, thereby avoiding possible | 641 | conservatively consider it to be Latin-1, thereby avoiding possible |
| 623 | encoding conversion errors." | 642 | encoding conversion errors." |
| 624 | (define p | 643 | (define p |
| 625 | (nix-server-socket server)) | 644 | (store-connection-socket server)) |
| 626 | 645 | ||
| 627 | ;; magic cookies from worker-protocol.hh | 646 | ;; magic cookies from worker-protocol.hh |
| 628 | (define %stderr-next #x6f6c6d67) ; "olmg", build log | 647 | (define %stderr-next #x6f6c6d67) ; "olmg", build log |
| @@ -666,7 +685,7 @@ encoding conversion errors." | |||
| 666 | (let ((error (read-maybe-utf8-string p)) | 685 | (let ((error (read-maybe-utf8-string p)) |
| 667 | ;; Currently the daemon fails to send a status code for early | 686 | ;; Currently the daemon fails to send a status code for early |
| 668 | ;; errors like DB schema version mismatches, so check for EOF. | 687 | ;; errors like DB schema version mismatches, so check for EOF. |
| 669 | (status (if (and (>= (nix-server-minor-version server) 8) | 688 | (status (if (and (>= (store-connection-minor-version server) 8) |
| 670 | (not (eof-object? (lookahead-u8 p)))) | 689 | (not (eof-object? (lookahead-u8 p)))) |
| 671 | (read-int p) | 690 | (read-int p) |
| 672 | 1))) | 691 | 1))) |
| @@ -734,7 +753,7 @@ encoding conversion errors." | |||
| 734 | ;; Must be called after `open-connection'. | 753 | ;; Must be called after `open-connection'. |
| 735 | 754 | ||
| 736 | (define socket | 755 | (define socket |
| 737 | (nix-server-socket server)) | 756 | (store-connection-socket server)) |
| 738 | 757 | ||
| 739 | (let-syntax ((send (syntax-rules () | 758 | (let-syntax ((send (syntax-rules () |
| 740 | ((_ (type option) ...) | 759 | ((_ (type option) ...) |
| @@ -744,22 +763,22 @@ encoding conversion errors." | |||
| 744 | (write-int (operation-id set-options) socket) | 763 | (write-int (operation-id set-options) socket) |
| 745 | (send (boolean keep-failed?) (boolean keep-going?) | 764 | (send (boolean keep-failed?) (boolean keep-going?) |
| 746 | (boolean fallback?) (integer verbosity)) | 765 | (boolean fallback?) (integer verbosity)) |
| 747 | (when (< (nix-server-minor-version server) #x61) | 766 | (when (< (store-connection-minor-version server) #x61) |
| 748 | (let ((max-build-jobs (or max-build-jobs 1)) | 767 | (let ((max-build-jobs (or max-build-jobs 1)) |
| 749 | (max-silent-time (or max-silent-time 3600))) | 768 | (max-silent-time (or max-silent-time 3600))) |
| 750 | (send (integer max-build-jobs) (integer max-silent-time)))) | 769 | (send (integer max-build-jobs) (integer max-silent-time)))) |
| 751 | (when (>= (nix-server-minor-version server) 2) | 770 | (when (>= (store-connection-minor-version server) 2) |
| 752 | (send (boolean use-build-hook?))) | 771 | (send (boolean use-build-hook?))) |
| 753 | (when (>= (nix-server-minor-version server) 4) | 772 | (when (>= (store-connection-minor-version server) 4) |
| 754 | (send (integer build-verbosity) (integer log-type) | 773 | (send (integer build-verbosity) (integer log-type) |
| 755 | (boolean print-build-trace))) | 774 | (boolean print-build-trace))) |
| 756 | (when (and (>= (nix-server-minor-version server) 6) | 775 | (when (and (>= (store-connection-minor-version server) 6) |
| 757 | (< (nix-server-minor-version server) #x61)) | 776 | (< (store-connection-minor-version server) #x61)) |
| 758 | (let ((build-cores (or build-cores (current-processor-count)))) | 777 | (let ((build-cores (or build-cores (current-processor-count)))) |
| 759 | (send (integer build-cores)))) | 778 | (send (integer build-cores)))) |
| 760 | (when (>= (nix-server-minor-version server) 10) | 779 | (when (>= (store-connection-minor-version server) 10) |
| 761 | (send (boolean use-substitutes?))) | 780 | (send (boolean use-substitutes?))) |
| 762 | (when (>= (nix-server-minor-version server) 12) | 781 | (when (>= (store-connection-minor-version server) 12) |
| 763 | (let ((pairs `(;; This option is honored by 'guix substitute' et al. | 782 | (let ((pairs `(;; This option is honored by 'guix substitute' et al. |
| 764 | ,@(if print-build-trace | 783 | ,@(if print-build-trace |
| 765 | `(("print-extended-build-trace" | 784 | `(("print-extended-build-trace" |
| @@ -884,8 +903,8 @@ bytevector) as its internal buffer, and a thunk to flush this output port." | |||
| 884 | ((_ (name (type arg) ...) docstring return ...) | 903 | ((_ (name (type arg) ...) docstring return ...) |
| 885 | (lambda (server arg ...) | 904 | (lambda (server arg ...) |
| 886 | docstring | 905 | docstring |
| 887 | (let* ((s (nix-server-socket server)) | 906 | (let* ((s (store-connection-socket server)) |
| 888 | (buffered (nix-server-output-port server))) | 907 | (buffered (store-connection-output-port server))) |
| 889 | (record-operation 'name) | 908 | (record-operation 'name) |
| 890 | (write-int (operation-id name) buffered) | 909 | (write-int (operation-id name) buffered) |
| 891 | (write-arg type arg buffered) | 910 | (write-arg type arg buffered) |
| @@ -944,7 +963,7 @@ string). Raise an error if no such path exists." | |||
| 944 | REFERENCES is the list of store paths referred to by the resulting store | 963 | REFERENCES is the list of store paths referred to by the resulting store |
| 945 | path." | 964 | path." |
| 946 | (let* ((args `(,bytes ,name ,references)) | 965 | (let* ((args `(,bytes ,name ,references)) |
| 947 | (cache (nix-server-add-text-to-store-cache server))) | 966 | (cache (store-connection-add-text-to-store-cache server))) |
| 948 | (or (hash-ref cache args) | 967 | (or (hash-ref cache args) |
| 949 | (let ((path (add-text-to-store server name bytes references))) | 968 | (let ((path (add-text-to-store server name bytes references))) |
| 950 | (hash-set! cache args path) | 969 | (hash-set! cache args path) |
| @@ -973,7 +992,7 @@ path." | |||
| 973 | ;; We don't use the 'operation' macro so we can pass SELECT? to | 992 | ;; We don't use the 'operation' macro so we can pass SELECT? to |
| 974 | ;; 'write-file'. | 993 | ;; 'write-file'. |
| 975 | (record-operation 'add-to-store) | 994 | (record-operation 'add-to-store) |
| 976 | (let ((port (nix-server-socket server))) | 995 | (let ((port (store-connection-socket server))) |
| 977 | (write-int (operation-id add-to-store) port) | 996 | (write-int (operation-id add-to-store) port) |
| 978 | (write-string basename port) | 997 | (write-string basename port) |
| 979 | (write-int 1 port) ;obsolete, must be #t | 998 | (write-int 1 port) ;obsolete, must be #t |
| @@ -999,7 +1018,7 @@ where FILE is the entry's absolute file name and STAT is the result of | |||
| 999 | ;; Note: We don't stat FILE-NAME at each call, and thus we assume that | 1018 | ;; Note: We don't stat FILE-NAME at each call, and thus we assume that |
| 1000 | ;; the file remains unchanged for the lifetime of SERVER. | 1019 | ;; the file remains unchanged for the lifetime of SERVER. |
| 1001 | (let* ((args `(,file-name ,basename ,recursive? ,hash-algo ,select?)) | 1020 | (let* ((args `(,file-name ,basename ,recursive? ,hash-algo ,select?)) |
| 1002 | (cache (nix-server-add-to-store-cache server))) | 1021 | (cache (store-connection-add-to-store-cache server))) |
| 1003 | (or (hash-ref cache args) | 1022 | (or (hash-ref cache args) |
| 1004 | (let ((path (add-to-store server basename recursive? | 1023 | (let ((path (add-to-store server basename recursive? |
| 1005 | hash-algo file-name | 1024 | hash-algo file-name |
| @@ -1078,14 +1097,14 @@ an arbitrary directory layout in the store without creating a derivation." | |||
| 1078 | ((_ 'directory (names . _) ...) names))) | 1097 | ((_ 'directory (names . _) ...) names))) |
| 1079 | 1098 | ||
| 1080 | (define cache | 1099 | (define cache |
| 1081 | (nix-server-add-to-store-cache server)) | 1100 | (store-connection-add-to-store-cache server)) |
| 1082 | 1101 | ||
| 1083 | (or (hash-ref cache tree) | 1102 | (or (hash-ref cache tree) |
| 1084 | (begin | 1103 | (begin |
| 1085 | ;; We don't use the 'operation' macro so we can use 'write-file-tree' | 1104 | ;; We don't use the 'operation' macro so we can use 'write-file-tree' |
| 1086 | ;; instead of 'write-file'. | 1105 | ;; instead of 'write-file'. |
| 1087 | (record-operation 'add-to-store/tree) | 1106 | (record-operation 'add-to-store/tree) |
| 1088 | (let ((port (nix-server-socket server))) | 1107 | (let ((port (store-connection-socket server))) |
| 1089 | (write-int (operation-id add-to-store) port) | 1108 | (write-int (operation-id add-to-store) port) |
| 1090 | (write-string basename port) | 1109 | (write-string basename port) |
| 1091 | (write-int 1 port) ;obsolete, must be #t | 1110 | (write-int 1 port) ;obsolete, must be #t |
| @@ -1117,8 +1136,8 @@ outputs, and return when the worker is done building them. Elements of THINGS | |||
| 1117 | that are not derivations can only be substituted and not built locally. | 1136 | that are not derivations can only be substituted and not built locally. |
| 1118 | Return #t on success." | 1137 | Return #t on success." |
| 1119 | (parameterize ((current-store-protocol-version | 1138 | (parameterize ((current-store-protocol-version |
| 1120 | (nix-server-version store))) | 1139 | (store-connection-version store))) |
| 1121 | (if (>= (nix-server-minor-version store) 15) | 1140 | (if (>= (store-connection-minor-version store) 15) |
| 1122 | (build store things mode) | 1141 | (build store things mode) |
| 1123 | (if (= mode (build-mode normal)) | 1142 | (if (= mode (build-mode normal)) |
| 1124 | (build/old store things) | 1143 | (build/old store things) |
| @@ -1334,9 +1353,9 @@ supported by STORE." | |||
| 1334 | ;; derivation builders in general, which appeared in Guix > 0.11.0. | 1353 | ;; derivation builders in general, which appeared in Guix > 0.11.0. |
| 1335 | ;; Return the empty list if it doesn't. Note that this RPC does not | 1354 | ;; Return the empty list if it doesn't. Note that this RPC does not |
| 1336 | ;; exist in 'nix-daemon'. | 1355 | ;; exist in 'nix-daemon'. |
| 1337 | (if (or (> (nix-server-major-version store) #x100) | 1356 | (if (or (> (store-connection-major-version store) #x100) |
| 1338 | (and (= (nix-server-major-version store) #x100) | 1357 | (and (= (store-connection-major-version store) #x100) |
| 1339 | (>= (nix-server-minor-version store) #x60))) | 1358 | (>= (store-connection-minor-version store) #x60))) |
| 1340 | (builders store) | 1359 | (builders store) |
| 1341 | '())))) | 1360 | '())))) |
| 1342 | 1361 | ||
| @@ -1366,14 +1385,14 @@ the list of store paths to delete. IGNORE-LIVENESS? should always be | |||
| 1366 | #f. MIN-FREED is the minimum amount of disk space to be freed, in | 1385 | #f. MIN-FREED is the minimum amount of disk space to be freed, in |
| 1367 | bytes, before the GC can stop. Return the list of store paths delete, | 1386 | bytes, before the GC can stop. Return the list of store paths delete, |
| 1368 | and the number of bytes freed." | 1387 | and the number of bytes freed." |
| 1369 | (let ((s (nix-server-socket server))) | 1388 | (let ((s (store-connection-socket server))) |
| 1370 | (write-int (operation-id collect-garbage) s) | 1389 | (write-int (operation-id collect-garbage) s) |
| 1371 | (write-int action s) | 1390 | (write-int action s) |
| 1372 | (write-store-path-list to-delete s) | 1391 | (write-store-path-list to-delete s) |
| 1373 | (write-arg boolean #f s) ; ignore-liveness? | 1392 | (write-arg boolean #f s) ; ignore-liveness? |
| 1374 | (write-long-long min-freed s) | 1393 | (write-long-long min-freed s) |
| 1375 | (write-int 0 s) ; obsolete | 1394 | (write-int 0 s) ; obsolete |
| 1376 | (when (>= (nix-server-minor-version server) 5) | 1395 | (when (>= (store-connection-minor-version server) 5) |
| 1377 | ;; Obsolete `use-atime' and `max-atime' parameters. | 1396 | ;; Obsolete `use-atime' and `max-atime' parameters. |
| 1378 | (write-int 0 s) | 1397 | (write-int 0 s) |
| 1379 | (write-int 0 s)) | 1398 | (write-int 0 s)) |
| @@ -1389,8 +1408,8 @@ and the number of bytes freed." | |||
| 1389 | ;; To be on the safe side, completely invalidate both caches. | 1408 | ;; To be on the safe side, completely invalidate both caches. |
| 1390 | ;; Otherwise we could end up returning store paths that are no longer | 1409 | ;; Otherwise we could end up returning store paths that are no longer |
| 1391 | ;; valid. | 1410 | ;; valid. |
| 1392 | (hash-clear! (nix-server-add-to-store-cache server)) | 1411 | (hash-clear! (store-connection-add-to-store-cache server)) |
| 1393 | (hash-clear! (nix-server-add-text-to-store-cache server))) | 1412 | (hash-clear! (store-connection-add-text-to-store-cache server))) |
| 1394 | 1413 | ||
| 1395 | (values paths freed)))) | 1414 | (values paths freed)))) |
| 1396 | 1415 | ||
| @@ -1425,7 +1444,7 @@ collected, and the number of bytes freed." | |||
| 1425 | "Import the set of store paths read from PORT into SERVER's store. An error | 1444 | "Import the set of store paths read from PORT into SERVER's store. An error |
| 1426 | is raised if the set of paths read from PORT is not signed (as per | 1445 | is raised if the set of paths read from PORT is not signed (as per |
| 1427 | 'export-path #:sign? #t'.) Return the list of store paths imported." | 1446 | 'export-path #:sign? #t'.) Return the list of store paths imported." |
| 1428 | (let ((s (nix-server-socket server))) | 1447 | (let ((s (store-connection-socket server))) |
| 1429 | (write-int (operation-id import-paths) s) | 1448 | (write-int (operation-id import-paths) s) |
| 1430 | (let loop ((done? (process-stderr server port))) | 1449 | (let loop ((done? (process-stderr server port))) |
| 1431 | (or done? (loop (process-stderr server port)))) | 1450 | (or done? (loop (process-stderr server port)))) |
| @@ -1433,7 +1452,7 @@ is raised if the set of paths read from PORT is not signed (as per | |||
| 1433 | 1452 | ||
| 1434 | (define* (export-path server path port #:key (sign? #t)) | 1453 | (define* (export-path server path port #:key (sign? #t)) |
| 1435 | "Export PATH to PORT. When SIGN? is true, sign it." | 1454 | "Export PATH to PORT. When SIGN? is true, sign it." |
| 1436 | (let ((s (nix-server-socket server))) | 1455 | (let ((s (store-connection-socket server))) |
| 1437 | (write-int (operation-id export-path) s) | 1456 | (write-int (operation-id export-path) s) |
| 1438 | (write-store-path path s) | 1457 | (write-store-path path s) |
| 1439 | (write-arg boolean sign? s) | 1458 | (write-arg boolean sign? s) |
| @@ -1502,10 +1521,10 @@ OBJECT is typically a high-level object such as a <package> or an <origin>, | |||
| 1502 | and RESULT is typically its derivation." | 1521 | and RESULT is typically its derivation." |
| 1503 | (lambda (store) | 1522 | (lambda (store) |
| 1504 | (values result | 1523 | (values result |
| 1505 | (nix-server | 1524 | (store-connection |
| 1506 | (inherit store) | 1525 | (inherit store) |
| 1507 | (object-cache (vhash-consq object (cons result keys) | 1526 | (object-cache (vhash-consq object (cons result keys) |
| 1508 | (nix-server-object-cache store))))))) | 1527 | (store-connection-object-cache store))))))) |
| 1509 | 1528 | ||
| 1510 | (define record-cache-lookup! | 1529 | (define record-cache-lookup! |
| 1511 | (if (profiled? "object-cache") | 1530 | (if (profiled? "object-cache") |
| @@ -1540,7 +1559,7 @@ and KEYS. KEYS is a list of additional keys to match against, and which are | |||
| 1540 | compared with 'equal?'. Return #f on failure and the cached result | 1559 | compared with 'equal?'. Return #f on failure and the cached result |
| 1541 | otherwise." | 1560 | otherwise." |
| 1542 | (lambda (store) | 1561 | (lambda (store) |
| 1543 | (let* ((cache (nix-server-object-cache store)) | 1562 | (let* ((cache (store-connection-object-cache store)) |
| 1544 | 1563 | ||
| 1545 | ;; Escape as soon as we find the result. This avoids traversing | 1564 | ;; Escape as soon as we find the result. This avoids traversing |
| 1546 | ;; the whole vlist chain and significantly reduces the number of | 1565 | ;; the whole vlist chain and significantly reduces the number of |
