From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id cLhBCTHgJGYfUwAAe85BDQ:P1 (envelope-from ) for ; Sun, 21 Apr 2024 11:45:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cLhBCTHgJGYfUwAAe85BDQ (envelope-from ) for ; Sun, 21 Apr 2024 11:45:21 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713692721; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=8cPT4S89T94z2HMWIeH9DIMW4h7/IC2N/VdrOSZUnY8=; b=EKcR8OeCJJ7EzV2LwlCwpwhZiCQK+4IvTD1pR+7g3lFInrrKySlCjJEigjkvxciQ9kxSan u+bfqPwt2rZPe6qd0khvXcV9uVZfkdZbDcTVWSp9QiOQg8A9gcbNlB1T3ozf1thx9PT43c c6+uWj3gTbpkQOw3BDvju0FRBDZQM/uYT958K5gDUrtPayPR2wt0UDC86kevNFM1GNBwiv oRuAjZECOQX78GfHP3an0AqJkPBtMJ0qcEEQ23qlSFrPU6iKYAFXlzDZ72VxrNtkOsD5Mk iVzpauPeBvD+gODQRTtVADVCh2LiExO99l0R6kCPS8A7gorv6ifCgcsxSh5XpA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713692721; a=rsa-sha256; cv=none; b=nRl3VK2hDGUY+XxFw/CtffQxIw5u+dc8ueBHxEzQazTL+GA5ppU8CaqZS3FTxH2QBFcw0n MuFxHZN4AeK8iyIbRJ3SPFY7H4dlsOqPsv+yssUAiKD0qqCe/pjaapz3w5EMI77Zwz8mLD y0QFW4p5VSNpwG4xAdypN5IZyqvDCq1czy5VPVQaBpCjUmjDpsVmBY1fjuH6oe6Uux93au CabfnSrME24RF10fE9oZym/FgTONrBfprVEJvByYw7qU2LtyqJyiLuPcbXn8NUpfde57G/ iFhlZHDn4UEkHs5ywLwTaYbiToeEE4TctgrAMeXTVpJLgDru0qRT6PVdn5YycA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0518B1F65A for ; Sun, 21 Apr 2024 11:45:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryTk8-0005qY-3B; Sun, 21 Apr 2024 05:44:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryTjj-0005PG-EH for guix-patches@gnu.org; Sun, 21 Apr 2024 05:43:51 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ryTji-0002kB-7A; Sun, 21 Apr 2024 05:43:50 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ryTjw-0006Tj-PV; Sun, 21 Apr 2024 05:44:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70494] [PATCH 06/23] store: Export protocol related constants. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sun, 21 Apr 2024 09:44:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70494 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70494@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 70494-submit@debbugs.gnu.org id=B70494.171369260324436 (code B ref 70494); Sun, 21 Apr 2024 09:44:04 +0000 Received: (at 70494) by debbugs.gnu.org; 21 Apr 2024 09:43:23 +0000 Received: from localhost ([127.0.0.1]:41762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryTjG-0006Ly-TR for submit@debbugs.gnu.org; Sun, 21 Apr 2024 05:43:23 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryTix-0006Hz-KG for 70494@debbugs.gnu.org; Sun, 21 Apr 2024 05:43:05 -0400 Received: from localhost (unknown [212.132.255.10]) by mira.cbaines.net (Postfix) with ESMTPSA id 59ED627BBED for <70494@debbugs.gnu.org>; Sun, 21 Apr 2024 10:42:47 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 7d2b5572 for <70494@debbugs.gnu.org>; Sun, 21 Apr 2024 09:42:46 +0000 (UTC) From: Christopher Baines Date: Sun, 21 Apr 2024 10:42:24 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <87bk632h36.fsf@cbaines.net> References: <87bk632h36.fsf@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.38 X-Spam-Score: -3.38 X-Migadu-Queue-Id: 0518B1F65A X-Migadu-Scanner: mx12.migadu.com X-TUID: waQV6S8xwrDN * 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" -(define (protocol-major magic) +(define-public (protocol-major magic) (logand magic #xff00)) -(define (protocol-minor magic) +(define-public (protocol-minor magic) (logand magic #x00ff)) -(define (protocol-version major minor) +(define-public (protocol-version major minor) (logior major minor)) +;; magic cookies from worker-protocol.hh +(define-public %stderr-next #x6f6c6d67) ; "olmg", build log +(define-public %stderr-read #x64617461) ; "data", data needed from source +(define-public %stderr-write #x64617416) ; "dat\x16", data for sink +(define-public %stderr-last #x616c7473) ; "alts", we're done +(define-public %stderr-error #x63787470) ; "cxtp", error reporting + (define-syntax define-enumerate-type (syntax-rules () ((_ name->int (name id) ...) @@ -709,13 +716,6 @@ (define* (process-stderr server #:optional user-port) (define p (store-connection-socket server)) - ;; magic cookies from worker-protocol.hh - (define %stderr-next #x6f6c6d67) ; "olmg", build log - (define %stderr-read #x64617461) ; "data", data needed from source - (define %stderr-write #x64617416) ; "dat\x16", data for sink - (define %stderr-last #x616c7473) ; "alts", we're done - (define %stderr-error #x63787470) ; "cxtp", error reporting - (let ((k (read-int p))) (cond ((= k %stderr-write) ;; Write a byte stream to USER-PORT. -- 2.41.0