From patchwork Wed Jun 7 08:38:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 50742 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 34D5A27BBE9; Wed, 7 Jun 2023 09:40:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 824A627BBEA for ; Wed, 7 Jun 2023 09:40:23 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6oi3-0004cz-TL; Wed, 07 Jun 2023 04:40:03 -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 1q6oi2-0004av-Dx for guix-patches@gnu.org; Wed, 07 Jun 2023 04:40:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q6oi2-0004Ec-3h for guix-patches@gnu.org; Wed, 07 Jun 2023 04:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q6oi1-0000df-Ku for guix-patches@gnu.org; Wed, 07 Jun 2023 04:40:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63942] [PATCH 1/5] gnu: guile-fibers: Add 1.3.1. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Jun 2023 08:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63942 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63942@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16861271502370 (code B ref -1); Wed, 07 Jun 2023 08:40:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jun 2023 08:39:10 +0000 Received: from localhost ([127.0.0.1]:53529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6ohB-0000c9-K4 for submit@debbugs.gnu.org; Wed, 07 Jun 2023 04:39:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:44988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6oh6-0000bz-DO for submit@debbugs.gnu.org; Wed, 07 Jun 2023 04:39:07 -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 1q6oh6-0003u0-3d for guix-patches@gnu.org; Wed, 07 Jun 2023 04:39:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6oh5-000475-25; Wed, 07 Jun 2023 04:39:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=WA1Bd7UAklboQB/AOX4y9llOcvQ0a+P9Wm4e4craD9g=; b=IAlKVmNIBhp6ExL3DCOk v4nYdWlPuYJpLSOZw6qbXY3gDp2CSR6fDGxFWAjNSwcEH99EIZKtSnNGjM9lX5/QlvXLQuymaIZlD ryeSAfVXiS3fhXeOPlgLErJnffTzCPcnpJYGXr1W0EabhifWiPu7IXj3QMVWqNQrNYksEl56YL+ny ObvBXUlr0ci7lkz/+Kyjzidyt+KghX9HFhLBTK0cW8r2n0+wxISsF1NX7ITG5tJSw6OtA7uB/xIHH Ip2dIHVphEOfTXMba7Kdcy2hSENy1bntTZRQxdqEiM5iGTjTd82SFTvXMVdDMIaQJjRHD3RZ1jDnH NkU0rYJRNKZ4PQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6oh4-000664-Le; Wed, 07 Jun 2023 04:39:02 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 7 Jun 2023 10:38:48 +0200 Message-Id: <3a86e6815a5d5d160e17105095546f6c3ff0d95a.1686126946.git.ludo@gnu.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/guile-xyz.scm (guile-fibers-1.3): New variable. (guile-fibers-1.1): Inherit from it. * gnu/packages/patches/guile-fibers-libevent-32-bit.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/guile-xyz.scm | 53 ++++++++++++++----- .../guile-fibers-libevent-32-bit.patch | 18 +++++++ 3 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 gnu/packages/patches/guile-fibers-libevent-32-bit.patch diff --git a/gnu/local.mk b/gnu/local.mk index f9afb433e6..f466f91746 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1317,6 +1317,7 @@ dist_patch_DATA = \ %D%/packages/patches/guile-fibers-epoll-instance-is-dead.patch \ %D%/packages/patches/guile-fibers-fd-finalizer-leak.patch \ %D%/packages/patches/guile-fibers-wait-for-io-readiness.patch \ + %D%/packages/patches/guile-fibers-libevent-32-bit.patch \ %D%/packages/patches/guile-fix-invalid-unicode-handling.patch \ %D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch \ %D%/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch \ diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index d8684bb818..43334eea0c 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -92,6 +92,7 @@ (define-module (gnu packages guile-xyz) #:use-module (gnu packages hurd) #:use-module (gnu packages image) #:use-module (gnu packages imagemagick) + #:use-module (gnu packages libevent) #:use-module (gnu packages libffi) #:use-module (gnu packages libunistring) #:use-module (gnu packages linux) @@ -788,10 +789,10 @@ (define-public guile2.2-dsv (inputs (list guile-2.2)) (propagated-inputs `(("guile-lib" ,guile2.2-lib))))) -(define-public guile-fibers-1.1 +(define-public guile-fibers-1.3 (package (name "guile-fibers") - (version "1.1.1") + (version "1.3.1") (source (origin (method git-fetch) (uri (git-reference @@ -800,11 +801,9 @@ (define-public guile-fibers-1.1 (file-name (git-file-name name version)) (sha256 (base32 - "0ll63d7202clapg1k4bilbnlmfa4qvpjnsd7chbkka4kxf5klilc")) + "0wvdi4l58f9a5c9wi3cdc9l1bniscsixb6w2zj86mch7j7j814lc")) (patches - (search-patches "guile-fibers-wait-for-io-readiness.patch" - "guile-fibers-epoll-instance-is-dead.patch" - "guile-fibers-fd-finalizer-leak.patch")))) + (search-patches "guile-fibers-libevent-32-bit.patch")))) (build-system gnu-build-system) (arguments (list #:make-flags @@ -822,17 +821,15 @@ (define-public guile-fibers-1.1 (substitute* "Makefile" (("tests/speedup.scm") "")))))))) (native-inputs - (list texinfo pkg-config autoconf automake libtool + (list texinfo pkg-config autoconf-2.71 automake libtool guile-3.0 ;for 'guild compile ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS' gettext-minimal)) (inputs - (list guile-3.0)) ;for libguile-3.0.so - (supported-systems - ;; This version requires 'epoll' and is thus limited to Linux-based - ;; systems, but this may change soon: - ;; . - (filter (cut string-suffix? "-linux" <>) %supported-systems)) + (append (list guile-3.0) ;for libguile-3.0.so + (if (hurd-target?) + (list libevent) + '()))) (synopsis "Lightweight concurrency facility for Guile") (description "Fibers is a Guile library that implements a a lightweight concurrency @@ -849,6 +846,36 @@ (define-public guile-fibers-1.1 (properties '((upstream-name . "fibers"))) (license license:lgpl3+))) +(define-public guile-fibers-1.1 + (package + (inherit guile-fibers-1.3) + (version "1.1.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wingo/fibers") + (commit (string-append "v" version)))) + (file-name (git-file-name "guile-fibers" version)) + (sha256 + (base32 + "0ll63d7202clapg1k4bilbnlmfa4qvpjnsd7chbkka4kxf5klilc")) + (patches + (search-patches "guile-fibers-wait-for-io-readiness.patch" + "guile-fibers-epoll-instance-is-dead.patch" + "guile-fibers-fd-finalizer-leak.patch")))) + (native-inputs + (list texinfo pkg-config autoconf automake libtool + guile-3.0 ;for 'guild compile + ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS' + gettext-minimal)) + (inputs + (list guile-3.0)) ;for libguile-3.0.so + (supported-systems + ;; This version requires 'epoll' and is thus limited to Linux-based + ;; systems, which is fixed in 1.2.0: + ;; . + (filter (cut string-suffix? "-linux" <>) %supported-systems)))) + (define-public guile-fibers-next (let ((commit "99fc3e38048f732de67c43fde52e949fa294aa7d") (revision "1")) diff --git a/gnu/packages/patches/guile-fibers-libevent-32-bit.patch b/gnu/packages/patches/guile-fibers-libevent-32-bit.patch new file mode 100644 index 0000000000..a1cc99fdbe --- /dev/null +++ b/gnu/packages/patches/guile-fibers-libevent-32-bit.patch @@ -0,0 +1,18 @@ +This fixes a bug with the libevent backend on 32-bit platforms: + + https://github.com/wingo/fibers/issues/86 + +diff --git a/extensions/libevent.c b/extensions/libevent.c +index 4f44de9..52c9d73 100644 +--- a/extensions/libevent.c ++++ b/extensions/libevent.c +@@ -215,7 +215,8 @@ run_event_loop (void *p) + microsec = -1; + else if (data->timeout >= 0) + { +- microsec = data->timeout / time_units_per_microsec; ++ microsec = (time_units_per_microsec == 0) ++ ? 0 : data->timeout / time_units_per_microsec; + tv.tv_sec = 0; + tv.tv_usec = microsec; + }