From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GDs4KcUmJGNafgEAbAwnHQ (envelope-from ) for ; Fri, 16 Sep 2022 09:33:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sERVKcUmJGMRwQAA9RJhRA (envelope-from ) for ; Fri, 16 Sep 2022 09:33:25 +0200 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 4F1203C99 for ; Fri, 16 Sep 2022 09:33:25 +0200 (CEST) Received: from localhost ([::1]:60902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZ5qm-0006Ks-CI for larch@yhetil.org; Fri, 16 Sep 2022 03:33:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ5qQ-0006JJ-Rh for guix-patches@gnu.org; Fri, 16 Sep 2022 03:33:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZ5qQ-0000i8-K0 for guix-patches@gnu.org; Fri, 16 Sep 2022 03:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZ5qQ-0003VB-Eo for guix-patches@gnu.org; Fri, 16 Sep 2022 03:33:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57850] [PATCH 2/2] marionette: Avoid read error when wait-for-file file is empty. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 16 Sep 2022 07:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57850 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 57850@debbugs.gnu.org Received: via spool by 57850-submit@debbugs.gnu.org id=B57850.166331356013405 (code B ref 57850); Fri, 16 Sep 2022 07:33:02 +0000 Received: (at 57850) by debbugs.gnu.org; 16 Sep 2022 07:32:40 +0000 Received: from localhost ([127.0.0.1]:41440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ5q3-0003U8-Ph for submit@debbugs.gnu.org; Fri, 16 Sep 2022 03:32:40 -0400 Received: from mira.cbaines.net ([212.71.252.8]:41466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ5q2-0003Tt-09 for 57850@debbugs.gnu.org; Fri, 16 Sep 2022 03:32:38 -0400 Received: from localhost (unknown [134.157.22.165]) by mira.cbaines.net (Postfix) with ESMTPSA id E787027BBEA for <57850@debbugs.gnu.org>; Fri, 16 Sep 2022 08:32:36 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 0b9036b4 for <57850@debbugs.gnu.org>; Fri, 16 Sep 2022 07:32:36 +0000 (UTC) From: Christopher Baines Date: Fri, 16 Sep 2022 09:32:36 +0200 Message-Id: <20220916073236.23634-2-mail@cbaines.net> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916073236.23634-1-mail@cbaines.net> References: <20220916073236.23634-1-mail@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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663313605; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=nkGUorOkVsn1Hzxt9CM2RpQFJYlv7Z0Q4GMfQHay0Tc=; b=OiUH2UGHx8l8qIWjOYfBcRQg9Ep8pmCne7R2Cg7qSDwO66BAgKZhbfHMmRN2SlUOzlqKH4 9XMdLO0LkFe/4QPffW3nSikNJyvh6H+lbw75EQp+Gz/yycRG/a0bGIsDpIxx67mLdOnjti eTrYCS8sAmcvBCTpILi3nDBgjPnTtWwPPZlDn1hzemU3nnlxaEXVDRIheb/rPmR5mgZ5R7 SVSXJf3FYWypX1OLhIPAHdPJC1RcuD0+hTCdjJLnzeLsEohKw2U3LPE4mKXXXb8K66WBpO D4uMvUrgKfmyYe5cxvWSOgEOaIvorY3CNXn8ckG898GnqwQ7jE+eQRY5+HiWnA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663313605; a=rsa-sha256; cv=none; b=NBj5Oyt5RvWOnaTlrz17ZDEYKpOcuz/3HUWbPfredvrd9nqYrofZtJHbU2fWpgfrrahHip x6UROJ5wByLRGUkHJeh+6LW0M6YStDaqka9Sm+5XPa2ZBQ2M7EubWQSTzOe12HuxuqjWxx gGXjtu2k4/y+Cdnd9hrv37RJTkA+KBDuAbO6VXtiGO1EbWAcE9k1zaMItVsaFZku2Ic+/N vwd7vO8oYPnSzGcurnPtb2sflWwS4ZxbNysnn0CJBS46mcb/LOgYyuUQyMxUdmZcShOUr6 fXQO0OoDj1eGRqcA/iHUNNXiSQFeGTM9cfoo9UMc2Z3+37JevtJuTxFJtSq2oA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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" X-Migadu-Spam-Score: 0.17 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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" X-Migadu-Queue-Id: 4F1203C99 X-Spam-Score: 0.17 X-Migadu-Scanner: scn1.migadu.com X-TUID: 32BhZZcQ1DN5 Since # can't be read. * gnu/build/marionette.scm (wait-for-file): Return "" if file is empty. --- gnu/build/marionette.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index fd59a4c72f..5ebf783892 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -198,7 +198,14 @@ (define* (wait-for-file file marionette (match (marionette-eval `(let loop ((i ,timeout)) (cond ((file-exists? ,file) - (cons 'success (call-with-input-file ,file ,read))) + (cons 'success + (let ((content + (call-with-input-file ,file ,read))) + (if (eof-object? content) + ;; # can't be read, so convert to the + ;; empty string + "" + content)))) ((> i 0) (sleep 1) (loop (- i 1))) -- 2.37.3