From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YOUPDztZCF8MdQAA0tVLHw (envelope-from ) for ; Fri, 10 Jul 2020 12:04:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aC/WCjtZCF9EPQAAB5/wlQ (envelope-from ) for ; Fri, 10 Jul 2020 12:04:11 +0000 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 B7FE3940418 for ; Fri, 10 Jul 2020 12:04:10 +0000 (UTC) Received: from localhost ([::1]:47342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtrlA-00023x-0z for larch@yhetil.org; Fri, 10 Jul 2020 08:04:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtrl4-00023j-Co for bug-guix@gnu.org; Fri, 10 Jul 2020 08:04:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59053) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jtrl4-00009V-3y for bug-guix@gnu.org; Fri, 10 Jul 2020 08:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jtrl3-0000tM-Uq for bug-guix@gnu.org; Fri, 10 Jul 2020 08:04:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#42151: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 10 Jul 2020 12:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42151 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Jan Nieuwenhuizen Received: via spool by 42151-submit@debbugs.gnu.org id=B42151.15943826023382 (code B ref 42151); Fri, 10 Jul 2020 12:04:01 +0000 Received: (at 42151) by debbugs.gnu.org; 10 Jul 2020 12:03:22 +0000 Received: from localhost ([127.0.0.1]:42366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jtrkP-0000sU-M0 for submit@debbugs.gnu.org; Fri, 10 Jul 2020 08:03:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jtrkN-0000sH-Fv for 42151@debbugs.gnu.org; Fri, 10 Jul 2020 08:03:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59742) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtrkH-0008SY-GK; Fri, 10 Jul 2020 08:03:13 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=53732 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jtrkG-0003Jd-P1; Fri, 10 Jul 2020 08:03:13 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200701142929.26919-1-janneke@gnu.org> <87imf6rsir.fsf@gnu.org> <873668zzip.fsf@gnu.org> <87fta8ogf2.fsf@gnu.org> <87sge8wrdf.fsf@gnu.org> <87y2nzr94w.fsf_-_@gnu.org> Date: Fri, 10 Jul 2020 14:03:08 +0200 In-Reply-To: <87y2nzr94w.fsf_-_@gnu.org> (Jan Nieuwenhuizen's message of "Sat, 04 Jul 2020 10:12:47 +0200") Message-ID: <87v9iv1ssj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 42151@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.49 X-TUID: n6TZxEDrRRZs Hi! Jan Nieuwenhuizen skribis: >>>From dc6f96fc7de50602fb28d7ad7b8cbff09e55f538 Mon Sep 17 00:00:00 2001 > From: "Jan (janneke) Nieuwenhuizen" > Date: Fri, 3 Jul 2020 23:45:20 +0200 > Subject: [PATCH 4/3] database: Do not use journal_model=3DWAL for the Hur= d. > Content-Transfer-Encoding: 8bit > Content-Type: text/plain; charset=3DUTF-8 > > This fixes . > > * guix/store/database.scm (call-with-database): When building for the Hur= d, > do not set journal_model=3DWAL. > --- > guix/store/database.scm | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/guix/store/database.scm b/guix/store/database.scm > index a38e4d7e52..da46b0abce 100644 > --- a/guix/store/database.scm > +++ b/guix/store/database.scm > @@ -1,6 +1,7 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2017, 2019 Caleb Ristvedt > ;;; Copyright =C2=A9 2018, 2020 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2020 Jan (janneke) Nieuwenhuizen > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -20,6 +21,7 @@ > (define-module (guix store database) > #:use-module (sqlite3) > #:use-module (guix config) > + #:use-module (guix gexp) > #:use-module (guix serialization) > #:use-module (guix store deduplication) > #:use-module (guix base16) > @@ -27,6 +29,7 @@ > #:use-module (guix build syscalls) > #:use-module ((guix build utils) > #:select (mkdir-p executable-file?)) > + #:use-module (guix utils) > #:use-module (guix build store-copy) > #:use-module (srfi srfi-1) > #:use-module (srfi srfi-11) > @@ -105,9 +108,12 @@ create it and initialize it as a new database." > (mkdir-p (dirname file)) > #t))) > (db (sqlite-open file))) > - ;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCK= ED > - ;; errors when we have several readers: . > - (sqlite-exec db "PRAGMA journal_mode=3DWAL;") > + ;; Using WAL breaks for the Hurd . > + (unless (let-system (system target) > + (equal? target "i586-pc-gnu")) > + ;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LO= CKED > + ;; errors when we have several readers: . > + (sqlite-exec db "PRAGMA journal_mode=3DWAL;")) I think this has the same effect as: (unless #t (sqlite-exec db "PRAGMA journal_mode=3DWAL;")) because this code is not in a gexp, so =E2=80=98let-system=E2=80=99 evaluat= es to an object (not #f), and that=E2=80=99s it, it=E2=80=99s never lowered and the = =E2=80=98equal?=E2=80=99 call is never made. You want to disable WAL mode not just when running this code natively on GNU/Hurd, but also when building a database that will eventually be used on GNU/Hurd, right? In that case, I think you=E2=80=99ll have to add, say, a #:wal-mode? parame= ter to =E2=80=98call-with-database=E2=80=99 (defaulting to #true), and change t= he caller to set it appropriately. The caller, directly or indirectly, is in a gexp, where you can use the =E2=80=98let-system=E2=80=99 expression above. Does that make sense? Thanks, and apologies for the delay! Ludo=E2=80=99.