From 132250beff32fd199c65eae11a040f6ec0046a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 20 Nov 2025 17:38:00 +0100 Subject: [PATCH] =?UTF-8?q?serialization:=20Rename=20=E2=80=98string?= =?UTF-8?q?=E2=80=99=20to=20=E2=80=98utf8-string=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids name clash with the ‘string’ binding of core Guile. * guix/serialization.scm : Change ‘string’ to ‘utf8-string’. * guix/store.scm (valid-path?, hash-part->path): (add-data-to-store, add-indirect-root): Adjust operation specification accordingly. Change-Id: Ibf7c571ac46689c2870a2c6db6a3632405d47544 Signed-off-by: Ludovic Courtès --- guix/serialization.scm | 2 +- guix/store.scm | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/guix/serialization.scm b/guix/serialization.scm index d6ebc27833..dfeb7a9bf1 100644 --- a/guix/serialization.scm +++ b/guix/serialization.scm @@ -353,7 +353,7 @@ value." (long-long read-long-long write-long-long) (boolean read-boolean write-boolean) (bytevector read-byte-string write-bytevector) - (string read-string write-string) + (utf8-string read-string write-string) ;avoid name clash with 'string' (string-list read-string-list write-string-list) (string-pairs read-string-pairs write-string-pairs) (store-path read-store-path write-store-path) diff --git a/guix/store.scm b/guix/store.scm index 45dc275ab1..e8aed4a4e7 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -942,7 +942,7 @@ bytevector) as its internal buffer, and a thunk to flush this output port." (define name (operation (name args ...) docstring return ...))) -(define-operation (valid-path? (string path)) +(define-operation (valid-path? (utf8-string path)) "Return #t when PATH designates a valid store item and #f otherwise (an invalid item may exist on disk but still be invalid, for instance because it is the result of an aborted or failed build.) @@ -957,7 +957,7 @@ store directory (/gnu/store)." (define hash-part->path (let ((query-path-from-hash-part - (operation (query-path-from-hash-part (string hash)) + (operation (query-path-from-hash-part (utf8-string hash)) #f store-path))) (lambda (server hash-part) @@ -975,7 +975,7 @@ string). Return the empty string if no such path exists." ;; A memoizing version of `add-to-store', to avoid repeated RPCs with ;; the very same arguments during a given session. (let ((add-text-to-store - (operation (add-text-to-store (string name) (bytevector text) + (operation (add-text-to-store (utf8-string name) (bytevector text) (string-list references)) #f store-path)) @@ -1054,10 +1054,10 @@ path." (let ((port (store-connection-socket server)) (buffered (store-connection-output-port server))) (write-value integer (operation-id add-to-store) buffered) - (write-value string basename buffered) + (write-value utf8-string basename buffered) (write-value integer 1 buffered) ;obsolete, must be #t (write-value boolean recursive? buffered) - (write-value string hash-algo buffered) + (write-value utf8-string hash-algo buffered) (write-file file-name buffered #:select? select?) (write-buffered-output server) (let loop ((done? (process-stderr server))) @@ -1168,10 +1168,10 @@ an arbitrary directory layout in the store without creating a derivation." (let ((port (store-connection-socket server)) (buffered (store-connection-output-port server))) (write-value integer (operation-id add-to-store) buffered) - (write-value string basename buffered) + (write-value utf8-string basename buffered) (write-value integer 1 buffered) ;obsolete, must be #t (write-value integer (if recursive? 1 0) buffered) - (write-value string hash-algo buffered) + (write-value utf8-string hash-algo buffered) (write-file-tree basename buffered #:file-type+size file-type+size #:file-port file-port @@ -1415,7 +1415,7 @@ potential roots that do not point to store items." Return #t." boolean) -(define-operation (add-indirect-root (string file-name)) +(define-operation (add-indirect-root (utf8-string file-name)) "Make the symlink FILE-NAME an indirect root for the garbage collector: whatever store item FILE-NAME points to will not be collected. Return #t on success.