From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6JOmCl21CF9NHgAA0tVLHw (envelope-from ) for ; Fri, 10 Jul 2020 18:37:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WLR+Bl21CF+zHAAA1q6Kng (envelope-from ) for ; Fri, 10 Jul 2020 18:37:17 +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 9187294071B for ; Fri, 10 Jul 2020 18:37:16 +0000 (UTC) Received: from localhost ([::1]:56590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtxtb-0006ym-J4 for larch@yhetil.org; Fri, 10 Jul 2020 14:37:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtxtO-0006vc-Er for bug-guix@gnu.org; Fri, 10 Jul 2020 14:37:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jtxtO-0006yM-63 for bug-guix@gnu.org; Fri, 10 Jul 2020 14:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jtxtO-0001x9-3q for bug-guix@gnu.org; Fri, 10 Jul 2020 14:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#42151: [PATCH v3 1/2] gnu: sqlite: Add locking-mode fix for the Hurd. References: <20200701142929.26919-1-janneke@gnu.org> In-Reply-To: <20200701142929.26919-1-janneke@gnu.org> Resent-From: "Jan (janneke) Nieuwenhuizen" Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 10 Jul 2020 18:37:02 +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: 42151@debbugs.gnu.org Received: via spool by 42151-submit@debbugs.gnu.org id=B42151.15944061767446 (code B ref 42151); Fri, 10 Jul 2020 18:37:02 +0000 Received: (at 42151) by debbugs.gnu.org; 10 Jul 2020 18:36:16 +0000 Received: from localhost ([127.0.0.1]:43433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jtxsX-0001vp-Hp for submit@debbugs.gnu.org; Fri, 10 Jul 2020 14:36:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jtxsO-0001v6-Q9 for 42151@debbugs.gnu.org; Fri, 10 Jul 2020 14:36:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40178) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtxsH-0006t1-Ru; Fri, 10 Jul 2020 14:35:55 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=44692 helo=dundal.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.82) (envelope-from ) id 1jtxsG-0006le-IZ; Fri, 10 Jul 2020 14:35:53 -0400 From: "Jan (janneke) Nieuwenhuizen" Date: Fri, 10 Jul 2020 20:35:50 +0200 Message-Id: <20200710183551.12807-1-janneke@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.01 X-TUID: 6q3N9LTnyOQl * gnu/packages/patches/sqlite-hurd.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/sqlite.scm (sqlite)[native-inputs]: Add it when building for the Hurd. [arguments]: Apply it when building for the Hurd. --- gnu/local.mk | 1 + gnu/packages/patches/sqlite-hurd.patch | 58 ++++++++++++++++++++++++++ gnu/packages/sqlite.scm | 19 +++++++++ 3 files changed, 78 insertions(+) create mode 100644 gnu/packages/patches/sqlite-hurd.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5c3b391960..42c9d0f379 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1370,6 +1370,7 @@ dist_patch_DATA = \ %D%/packages/patches/sdl-pango-header-guard.patch \ %D%/packages/patches/sdl-pango-matrix_declarations.patch \ %D%/packages/patches/sdl-pango-sans-serif.patch \ + %D%/packages/patches/sqlite-hurd.patch \ %D%/packages/patches/patchutils-test-perms.patch \ %D%/packages/patches/patch-hurd-path-max.patch \ %D%/packages/patches/perl-autosplit-default-time.patch \ diff --git a/gnu/packages/patches/sqlite-hurd.patch b/gnu/packages/patches/sqlite-hurd.patch new file mode 100644 index 0000000000..d80a2c5be8 --- /dev/null +++ b/gnu/packages/patches/sqlite-hurd.patch @@ -0,0 +1,58 @@ +Adapted from Debian: https://sources.debian.org/patches/sqlite3/3.32.3-1/20-hurd-locking-style.patch +Upstream status: Not upstreamed. + +This patch is needed to get offloading to work. + +Sqlite can use simple file locking mode, but that does not work for the Hurd; +a second sqlite process fails with a "locking protocol" error. + +See also: https://bugs.debian.org/529734. + +diff -purN sqlite-autoconf-3310100/sqlite3.c sqlite-autoconf-3310100-/sqlite3.c +--- sqlite-autoconf-3310100/sqlite3.c 2020-01-27 21:25:19.000000000 +0100 ++++ sqlite-autoconf-3310100-/sqlite3.c 2020-07-01 11:50:13.768333806 +0200 +@@ -33189,7 +33189,7 @@ SQLITE_PRIVATE const char *sqlite3Opcode + # include + #endif + +-#if SQLITE_ENABLE_LOCKING_STYLE ++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__) + /* # include */ + # include + # include +@@ -35676,7 +35676,7 @@ static int dotlockClose(sqlite3_file *id + ** + ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off + */ +-#if SQLITE_ENABLE_LOCKING_STYLE ++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__) + + /* + ** Retry flock() calls that fail with EINTR +@@ -38586,7 +38586,7 @@ IOMETHODS( + 0 /* xShmMap method */ + ) + +-#if SQLITE_ENABLE_LOCKING_STYLE ++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__) + IOMETHODS( + flockIoFinder, /* Finder function name */ + flockIoMethods, /* sqlite3_io_methods object name */ +@@ -41142,6 +41142,8 @@ SQLITE_API int sqlite3_os_init(void){ + UNIXVFS("unix", autolockIoFinder ), + #elif OS_VXWORKS + UNIXVFS("unix", vxworksIoFinder ), ++#elif defined(__GNU__) ++ UNIXVFS("unix", flockIoFinder ), + #else + UNIXVFS("unix", posixIoFinder ), + #endif +@@ -41151,7 +41153,7 @@ SQLITE_API int sqlite3_os_init(void){ + #if OS_VXWORKS + UNIXVFS("unix-namedsem", semIoFinder ), + #endif +-#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS ++#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__) + UNIXVFS("unix-posix", posixIoFinder ), + #endif + #if SQLITE_ENABLE_LOCKING_STYLE diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm index 8468131ddf..eeb77749d8 100644 --- a/gnu/packages/sqlite.scm +++ b/gnu/packages/sqlite.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2017 Jelle Licht ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018 Alex Vong +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,6 +30,7 @@ (define-module (gnu packages sqlite) #:use-module (gnu packages) + #:use-module (gnu packages hurd) #:use-module (gnu packages readline) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) @@ -65,6 +67,11 @@ "1bj936svd8i5g25xd1bj52hj4zca01fgl3sqkj86z9q5pkz4wa32")))) (build-system gnu-build-system) (inputs `(("readline" ,readline))) + (native-inputs (if (hurd-target?) + ;; TODO move into origin on the next rebuild cycle. + `(("hurd-locking-mode.patch" + ,@(search-patches "sqlite-hurd.patch"))) + '())) (outputs '("out" "static")) (arguments `(#:configure-flags @@ -79,6 +86,18 @@ ;; Column metadata is required by GNU Jami and Qt, et.al. "-DSQLITE_ENABLE_COLUMN_METADATA")) #:phases (modify-phases %standard-phases + ;; TODO: remove in the next rebuild cycle + ,@(if (hurd-target?) + `((add-after 'unpack 'patch-sqlite/hurd + (lambda* (#:key inputs native-inputs + #:allow-other-keys) + (let ((patch (assoc-ref + (if ,(%current-target-system) + native-inputs + inputs) + "hurd-locking-mode.patch"))) + (invoke "patch" "-p1" "--force" "-i" patch))))) + '()) (add-after 'install 'move-static-library (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) -- Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com