Subject: Re: [bug#70494] [PATCH 06/23] store: Export protocol related constants.

From: Ludovic Courtès <[email-masked]>
Date: Mon, 13 May 2024 17:58:04 +0200

Christopher Baines <[email-masked]> skribis:

> * guix/store.scm (%protocol-version, %worker-magic-1, %worker-magic-2): Export
> variables.
> (protocol-major, protocol-minor, protocol-version): Export procedures.
> (%stderr-next, %stderr-read, %stderr-write, %stderr-last, %stderr-error):
> Move from process-stderr and export variables.
>
> Change-Id: Id0b1b5e6feeac5260875558f33aa5d923d5e0903
> ---
>  guix/store.scm | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/guix/store.scm b/guix/store.scm
> index c3b58090e5..578e46507e 100644
> --- a/guix/store.scm
> +++ b/guix/store.scm
> @@ -206,18 +206,25 @@ (define-module (guix store)
>              derivation-log-file
>              log-file))
>  
> -(define %protocol-version #x164)
> +(define-public %protocol-version #x164)
>  
> -(define %worker-magic-1 #x6e697863)               ; "nixc"
> -(define %worker-magic-2 #x6478696f)               ; "dxio"
> +(define-public %worker-magic-1 #x6e697863)               ; "nixc"
> +(define-public %worker-magic-2 #x6478696f)               ; "dxio"

Two things:

  1. This is a case for a new (guix store protocol) module.  Preferably
     I would keep those constants local to that module and instead
     expose higher-level facilities, but we can start by just exporting
     these constants.

  2. From a cosmetic viewpoint, please use #:export rather than
     ‘define-public’, for clarity (package modules are the exception).

Ludo’.