GNU bug report logs - #41363
knot-resolver: Enable reloading of policy files (add lua-cqueues)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Simon South <simon@HIDDEN>; Keywords: patch; dated Sun, 17 May 2020 15:50:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 41363 <at> debbugs.gnu.org:


Received: (at 41363) by debbugs.gnu.org; 18 May 2020 12:32:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 18 08:32:27 2020
Received: from localhost ([127.0.0.1]:46193 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jaewU-0000d5-QT
	for submit <at> debbugs.gnu.org; Mon, 18 May 2020 08:32:27 -0400
Received: from mailout.easymail.ca ([64.68.200.34]:52236)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <simon@HIDDEN>) id 1jaewS-0000cn-Q1
 for 41363 <at> debbugs.gnu.org; Mon, 18 May 2020 08:32:25 -0400
Received: from localhost (localhost [127.0.0.1])
 by mailout.easymail.ca (Postfix) with ESMTP id 3608CBFA79
 for <41363 <at> debbugs.gnu.org>; Mon, 18 May 2020 12:32:19 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at emo04-pco.easydns.vpn
Received: from mailout.easymail.ca ([127.0.0.1])
 by localhost (emo04-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id N8pmp2OiGiEj for <41363 <at> debbugs.gnu.org>;
 Mon, 18 May 2020 12:32:18 +0000 (UTC)
Received: from mercury.simonsouth.net (unknown [108.162.141.195])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mailout.easymail.ca (Postfix) with ESMTPSA id D0E79BFA6C
 for <41363 <at> debbugs.gnu.org>; Mon, 18 May 2020 12:32:17 +0000 (UTC)
From: Simon South <simon@HIDDEN>
To: 41363 <at> debbugs.gnu.org
Subject: Re: [bug#41363] [PATCH 1/3] gnu: Add lua-ossl.
References: <878shqtyaa.fsf@HIDDEN>
 <20200517160940.5132-1-simon@HIDDEN>
Date: Mon, 18 May 2020 08:32:17 -0400
In-Reply-To: <20200517160940.5132-1-simon@HIDDEN> (Simon South's
 message of "Sun, 17 May 2020 12:09:38 -0400")
Message-ID: <87367xifu6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 41363
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

luaossl doesn't actually require M4 to build, unlike cqueues.

Here's a replacement patch that omits M4 from the package inputs.



--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline; filename=0001-gnu-Add-lua-ossl.patch
Content-Transfer-Encoding: quoted-printable
Content-Description: [PATCH 1/3] gnu: Add lua-ossl.

From 610918a771b84a081af24940ae94d35b1af7511e Mon Sep 17 00:00:00 2001
From: Simon South <simon@HIDDEN>
Date: Fri, 15 May 2020 11:18:44 -0400
Subject: [PATCH 1/3] gnu: Add lua-ossl.
To: 41363 <at> debbugs.gnu.org

* gnu/packages/lua.scm (make-lua-ossl): New function.
(lua-ossl, lua5.1-ossl, lua5.2-ossl): New variables.
---
 gnu/packages/lua.scm | 61 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 181ce76559..defb7b68e6 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -11,6 +11,7 @@
 ;;; Copyright =C2=A9 2018, 2019 Tobias Geerinckx-Rice <me@HIDDEN>
 ;;; Copyright =C2=A9 2018 Fis Trivial <ybbs.daans@HIDDEN>
 ;;; Copyright =C2=A9 2020 Nicolas Goaziou <mail@HIDDEN>
+;;; Copyright =C2=A9 2020 Simon South <simon@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +39,7 @@
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages m4)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages glib)
@@ -292,6 +294,65 @@ directory structure and file attributes.")
 (define-public lua5.2-filesystem
   (make-lua-filesystem "lua5.2-filesystem" lua-5.2))
=20
+(define (make-lua-ossl name lua)
+  (package
+    (name name)
+    (version "20170903")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://25thandclement.com/~william/"
+                                  "projects/releases/luaossl-" version ".t=
gz"))
+              (sha256
+               (base32
+                "10392bvd0lzyibipblgiss09zlqh3a5zgqg1b9lgbybpqb9cv2k3"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (let ((out (assoc-ref %outputs "out"))
+             (lua-api-version ,(version-major+minor (package-version lua))=
))
+         (list "CC=3Dgcc"
+               "CFLAGS=3D'-D HAVE_SYS_SYSCTL_H=3D0'" ; sys/sysctl.h is dep=
recated
+               (string-append "DESTDIR=3D" out)
+               (string-append "LUA_APIS=3D" lua-api-version)
+               "prefix=3D"))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (lua-version ,(version-major+minor (package-version lua=
))))
+               (setenv "LUA_CPATH"
+                       (string-append out "/lib/lua/" lua-version "/?.so;;=
"))
+               (setenv "LUA_PATH"
+                       (string-append out "/share/lua/" lua-version "/?.lu=
a;;"))
+               (with-directory-excursion "regress"
+                 (for-each (lambda (f)
+                             (invoke "lua" f))
+                           (find-files "." "^[0-9].*\\.lua$"))))
+             #t)))))
+    (inputs
+     `(("lua" ,lua)
+       ("openssl" ,openssl)))
+    (home-page "https://25thandclement.com/~william/projects/luaossl.html")
+    (synopsis "OpenSSL bindings for Lua")
+    (description "The luaossl extension module for Lua provides comprehens=
ive,
+low-level bindings to the OpenSSL library, including support for certifica=
te and
+key management, key generation, signature verification, and deep bindings =
to the
+distinguished name, alternative name, and X.509v3 extension interfaces.  I=
t also
+binds OpenSSL's bignum, message digest, HMAC, cipher, and CSPRNG interface=
s.")
+    (license license:expat)))
+
+(define-public lua-ossl
+  (make-lua-ossl "lua-ossl" lua))
+
+(define-public lua5.1-ossl
+  (make-lua-ossl "lua5.1-ossl" lua-5.1))
+
+(define-public lua5.2-ossl
+  (make-lua-ossl "lua5.2-ossl" lua-5.2))
+
 (define (make-lua-sec name lua)
   (package
     (name name)
--=20
2.26.2


--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#41363; Package guix-patches. Full text available.
Added tag(s) patch. Request was from Simon South <simon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 41363 <at> debbugs.gnu.org:


Received: (at 41363) by debbugs.gnu.org; 17 May 2020 16:10:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 17 12:10:07 2020
Received: from localhost ([127.0.0.1]:44433 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jaLra-00063a-Pu
	for submit <at> debbugs.gnu.org; Sun, 17 May 2020 12:10:07 -0400
Received: from mailout.easymail.ca ([64.68.200.34]:48896)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <simon@HIDDEN>) id 1jaLrV-00062E-I3
 for 41363 <at> debbugs.gnu.org; Sun, 17 May 2020 12:10:01 -0400
Received: from localhost (localhost [127.0.0.1])
 by mailout.easymail.ca (Postfix) with ESMTP id 74F14212E4
 for <41363 <at> debbugs.gnu.org>; Sun, 17 May 2020 16:09:56 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at emo06-pco.easydns.vpn
Received: from mailout.easymail.ca ([127.0.0.1])
 by localhost (emo06-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id qPR-JXAidmqP for <41363 <at> debbugs.gnu.org>;
 Sun, 17 May 2020 16:09:56 +0000 (UTC)
Received: from mercury.simonsouth.net (unknown [108.162.141.195])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mailout.easymail.ca (Postfix) with ESMTPSA id 3CB60211FB
 for <41363 <at> debbugs.gnu.org>; Sun, 17 May 2020 16:09:54 +0000 (UTC)
From: Simon South <simon@HIDDEN>
To: 41363 <at> debbugs.gnu.org
Subject: [PATCH 3/3] gnu: knot-resolver: Enable automatic reloading of policy
 files.
Date: Sun, 17 May 2020 12:09:40 -0400
Message-Id: <20200517160940.5132-3-simon@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200517160940.5132-1-simon@HIDDEN>
References: <20200517160940.5132-1-simon@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 41363
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/dns.scm (knot-resolver)[inputs]: Add lua5.1-cqueues.
---
 gnu/packages/dns.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index 469ef7605d..fdf9ed9dea 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -723,8 +723,9 @@ synthesis, and on-the-fly re-configuration.")
        ("libuv" ,libuv)
        ("lmdb" ,lmdb)
        ("luajit" ,luajit)
-       ;; TODO: Add optional lua modules: basexx, cqueues and psl.
+       ;; TODO: Add optional lua modules: basexx and psl.
        ("lua-bitop" ,lua5.1-bitop)
+       ("lua-cqueues" ,lua5.1-cqueues)
        ("lua-filesystem" ,lua5.1-filesystem)
        ("lua-sec" ,lua5.1-sec)
        ("lua-socket" ,lua5.1-socket)))
-- 
2.26.2





Information forwarded to guix-patches@HIDDEN:
bug#41363; Package guix-patches. Full text available.

Message received at 41363 <at> debbugs.gnu.org:


Received: (at 41363) by debbugs.gnu.org; 17 May 2020 16:10:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 17 12:10:01 2020
Received: from localhost ([127.0.0.1]:44428 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jaLrU-00062X-S8
	for submit <at> debbugs.gnu.org; Sun, 17 May 2020 12:10:01 -0400
Received: from mailout.easymail.ca ([64.68.200.34]:48880)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <simon@HIDDEN>) id 1jaLrT-00062B-Kh
 for 41363 <at> debbugs.gnu.org; Sun, 17 May 2020 12:10:00 -0400
Received: from localhost (localhost [127.0.0.1])
 by mailout.easymail.ca (Postfix) with ESMTP id 87A6E21218
 for <41363 <at> debbugs.gnu.org>; Sun, 17 May 2020 16:09:54 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at emo06-pco.easydns.vpn
Received: from mailout.easymail.ca ([127.0.0.1])
 by localhost (emo06-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id Iv3Zefq-ThAe for <41363 <at> debbugs.gnu.org>;
 Sun, 17 May 2020 16:09:54 +0000 (UTC)
Received: from mercury.simonsouth.net (unknown [108.162.141.195])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mailout.easymail.ca (Postfix) with ESMTPSA id 40D49211FB
 for <41363 <at> debbugs.gnu.org>; Sun, 17 May 2020 16:09:52 +0000 (UTC)
From: Simon South <simon@HIDDEN>
To: 41363 <at> debbugs.gnu.org
Subject: [PATCH 2/3] gnu: Add lua-cqueues.
Date: Sun, 17 May 2020 12:09:39 -0400
Message-Id: <20200517160940.5132-2-simon@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200517160940.5132-1-simon@HIDDEN>
References: <20200517160940.5132-1-simon@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 41363
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/lua.scm (make-lua-cqueues): New function.
(lua-cqueues, lua5.1-cqueues, lua5.2-cqueues): New variables.
---
 gnu/packages/lua.scm | 106 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 147ed8d9f7..958b317d62 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -403,6 +403,112 @@ secure session between the peers.")
 (define-public lua5.2-sec
   (make-lua-sec "lua5.2-sec" lua-5.2))
 
+(define (make-lua-cqueues name lua lua-ossl)
+  (package
+    (name name)
+    (version "20171014")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://25thandclement.com/~william/"
+                                  "projects/releases/cqueues-" version ".tgz"))
+              (sha256
+               (base32
+                "1dabhpn6r0hlln8vx9hxm34pfcm46qzgpb2apmziwg5z51fi4ksb"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (ice-9 string-fun))
+       #:make-flags
+       (let ((out (assoc-ref %outputs "out"))
+             (lua-api-version ,(version-major+minor (package-version lua))))
+         (list "CC=gcc"
+               (string-append "LUA_APIS=" lua-api-version)))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check)
+         (replace 'install
+           (lambda* (#:key make-flags outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (apply invoke "make" "install"
+                      (append make-flags
+                              (list (string-append "DESTDIR=" out)
+                                    "prefix="))))))
+         (add-after 'install 'check
+           (lambda* (#:key inputs outputs make-flags #:allow-other-keys)
+             (let*
+                 ((lua-version ,(version-major+minor (package-version lua)))
+                  (env-suffix (if (equal? lua-version "5.1")
+                                  ""
+                                  (string-append
+                                   "_"
+                                   (string-replace-substring lua-version "." "_"))))
+
+                  (lua-ossl (assoc-ref inputs "lua-ossl"))
+                  (out (assoc-ref outputs "out"))
+
+                  (lua-cpath (lambda (p)
+                               (string-append p "/lib/lua/" lua-version "/?.so")))
+                  (lua-path (lambda (p)
+                              (string-append p "/share/lua/" lua-version "/?.lua"))))
+               ;; The test suite sets Lua-version-specific search-path variables
+               ;; when available so we must do the same, as these take
+               ;; precedence over the generic "LUA_CPATH" and "LUA_PATH"
+               (setenv (string-append "LUA_CPATH" env-suffix)
+                       (string-append
+                        (string-join (map lua-cpath (list out lua-ossl)) ";")
+                        ";;"))
+               (setenv (string-append "LUA_PATH" env-suffix)
+                       (string-append
+                        (string-join (map lua-path (list out lua-ossl)) ";")
+                        ";;"))
+
+               ;; Skip regression tests we expect to fail
+               (with-directory-excursion "regress"
+                 (for-each (lambda (f)
+                             (rename-file f (string-append f ".skip")))
+                           (append
+                            ;; Regression tests that require network
+                            ;; connectivity
+                            '("22-client-dtls.lua"
+                              "30-starttls-completion.lua"
+                              "62-noname.lua"
+                              "153-dns-resolvers.lua")
+
+                            ;; Regression tests that require LuaJIT
+                            '("44-resolvers-gc.lua"
+                              "51-join-defunct-thread.lua")
+
+                            ;; Regression tests that require Lua 5.3
+                            (if (not (equal? lua-version "5.3"))
+                                '("152-thread-integer-passing.lua")
+                                '()))))
+
+               (apply invoke "make" "check" make-flags)))))))
+    (native-inputs
+     `(("m4" ,m4)))
+    (inputs
+     `(("lua" ,lua)
+       ("openssl" ,openssl)))
+    (propagated-inputs
+     `(("lua-ossl" ,lua-ossl)))
+    (home-page "https://25thandclement.com/~william/projects/cqueues.html")
+    (synopsis "Event loop for Lua using continuation queues")
+    (description "The cqueues extension module for Lua implements an event loop
+that operates through the yielding and resumption of coroutines.  It is designed
+to be non-intrusive, composable, and embeddable within existing applications.")
+    (license license:expat)))
+
+(define-public lua-cqueues
+  (make-lua-cqueues "lua-cqueues" lua lua-ossl))
+
+(define-public lua5.1-cqueues
+  (make-lua-cqueues "lua5.1-cqueues" lua-5.1 lua5.1-ossl))
+
+(define-public lua5.2-cqueues
+  (make-lua-cqueues "lua5.2-cqueues" lua-5.2 lua5.2-ossl))
+
 (define-public lua-penlight
   (package
     (name "lua-penlight")
-- 
2.26.2





Information forwarded to guix-patches@HIDDEN:
bug#41363; Package guix-patches. Full text available.

Message received at 41363 <at> debbugs.gnu.org:


Received: (at 41363) by debbugs.gnu.org; 17 May 2020 16:10:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 17 12:10:00 2020
Received: from localhost ([127.0.0.1]:44426 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jaLrU-00062V-Fs
	for submit <at> debbugs.gnu.org; Sun, 17 May 2020 12:10:00 -0400
Received: from mailout.easymail.ca ([64.68.200.34]:48866)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <simon@HIDDEN>) id 1jaLrS-000628-KW
 for 41363 <at> debbugs.gnu.org; Sun, 17 May 2020 12:09:59 -0400
Received: from localhost (localhost [127.0.0.1])
 by mailout.easymail.ca (Postfix) with ESMTP id 1AD2E211FF
 for <41363 <at> debbugs.gnu.org>; Sun, 17 May 2020 16:09:53 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at emo06-pco.easydns.vpn
Received: from mailout.easymail.ca ([127.0.0.1])
 by localhost (emo06-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id u0x4u2l3Yfx8 for <41363 <at> debbugs.gnu.org>;
 Sun, 17 May 2020 16:09:52 +0000 (UTC)
Received: from mercury.simonsouth.net (unknown [108.162.141.195])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mailout.easymail.ca (Postfix) with ESMTPSA id AD250211FB
 for <41363 <at> debbugs.gnu.org>; Sun, 17 May 2020 16:09:52 +0000 (UTC)
From: Simon South <simon@HIDDEN>
To: 41363 <at> debbugs.gnu.org
Subject: [PATCH 1/3] gnu: Add lua-ossl.
Date: Sun, 17 May 2020 12:09:38 -0400
Message-Id: <20200517160940.5132-1-simon@HIDDEN>
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-Debbugs-Envelope-To: 41363
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* gnu/packages/lua.scm (make-lua-ossl): New function.
(lua-ossl, lua5.1-ossl, lua5.2-ossl): New variables.
---
 gnu/packages/lua.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 181ce76559..147ed8d9f7 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@HIDDEN>
 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@HIDDEN>
 ;;; Copyright © 2020 Nicolas Goaziou <mail@HIDDEN>
+;;; Copyright © 2020 Simon South <simon@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +39,7 @@
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages m4)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages glib)
@@ -292,6 +294,67 @@ directory structure and file attributes.")
 (define-public lua5.2-filesystem
   (make-lua-filesystem "lua5.2-filesystem" lua-5.2))
 
+(define (make-lua-ossl name lua)
+  (package
+    (name name)
+    (version "20170903")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://25thandclement.com/~william/"
+                                  "projects/releases/luaossl-" version ".tgz"))
+              (sha256
+               (base32
+                "10392bvd0lzyibipblgiss09zlqh3a5zgqg1b9lgbybpqb9cv2k3"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (let ((out (assoc-ref %outputs "out"))
+             (lua-api-version ,(version-major+minor (package-version lua))))
+         (list "CC=gcc"
+               "CFLAGS='-D HAVE_SYS_SYSCTL_H=0'" ; sys/sysctl.h is deprecated
+               (string-append "DESTDIR=" out)
+               (string-append "LUA_APIS=" lua-api-version)
+               "prefix="))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (lua-version ,(version-major+minor (package-version lua))))
+               (setenv "LUA_CPATH"
+                       (string-append out "/lib/lua/" lua-version "/?.so;;"))
+               (setenv "LUA_PATH"
+                       (string-append out "/share/lua/" lua-version "/?.lua;;"))
+               (with-directory-excursion "regress"
+                 (for-each (lambda (f)
+                             (invoke "lua" f))
+                           (find-files "." "^[0-9].*\\.lua$"))))
+             #t)))))
+    (native-inputs
+     `(("m4", m4)))
+    (inputs
+     `(("lua" ,lua)
+       ("openssl" ,openssl)))
+    (home-page "https://25thandclement.com/~william/projects/luaossl.html")
+    (synopsis "OpenSSL bindings for Lua")
+    (description "The luaossl extension module for Lua provides comprehensive,
+low-level bindings to the OpenSSL library, including support for certificate and
+key management, key generation, signature verification, and deep bindings to the
+distinguished name, alternative name, and X.509v3 extension interfaces.  It also
+binds OpenSSL's bignum, message digest, HMAC, cipher, and CSPRNG interfaces.")
+    (license license:expat)))
+
+(define-public lua-ossl
+  (make-lua-ossl "lua-ossl" lua))
+
+(define-public lua5.1-ossl
+  (make-lua-ossl "lua5.1-ossl" lua-5.1))
+
+(define-public lua5.2-ossl
+  (make-lua-ossl "lua5.2-ossl" lua-5.2))
+
 (define (make-lua-sec name lua)
   (package
     (name name)
-- 
2.26.2





Information forwarded to guix-patches@HIDDEN:
bug#41363; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 May 2020 15:49:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 17 11:49:21 2020
Received: from localhost ([127.0.0.1]:44353 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jaLXV-0005OJ-4n
	for submit <at> debbugs.gnu.org; Sun, 17 May 2020 11:49:21 -0400
Received: from lists.gnu.org ([209.51.188.17]:33502)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <simon@HIDDEN>) id 1jaKYM-0003kC-Hp
 for submit <at> debbugs.gnu.org; Sun, 17 May 2020 10:46:11 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:44118)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <simon@HIDDEN>)
 id 1jaKYM-0003gb-A0
 for guix-patches@HIDDEN; Sun, 17 May 2020 10:46:10 -0400
Received: from mailout.easymail.ca ([64.68.200.34]:49564)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <simon@HIDDEN>)
 id 1jaKYK-0005Xu-RN
 for guix-patches@HIDDEN; Sun, 17 May 2020 10:46:10 -0400
Received: from localhost (localhost [127.0.0.1])
 by mailout.easymail.ca (Postfix) with ESMTP id 413A2A0364
 for <guix-patches@HIDDEN>; Sun, 17 May 2020 14:46:06 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at emo05-pco.easydns.vpn
Received: from mailout.easymail.ca ([127.0.0.1])
 by localhost (emo05-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id ZdyfWjHuJUZO for <guix-patches@HIDDEN>;
 Sun, 17 May 2020 14:46:06 +0000 (UTC)
Received: from mercury.simonsouth.net (unknown [108.162.141.195])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mailout.easymail.ca (Postfix) with ESMTPSA id 02DAFA033B
 for <guix-patches@HIDDEN>; Sun, 17 May 2020 14:46:05 +0000 (UTC)
From: Simon South <simon@HIDDEN>
To: guix-patches@HIDDEN
Subject: knot-resolver: Enable reloading of policy files (add lua-cqueues)
Date: Sun, 17 May 2020 10:46:05 -0400
Message-ID: <878shqtyaa.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=64.68.200.34; envelope-from=simon@HIDDEN;
 helo=mailout.easymail.ca
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 10:46:06
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -41
X-Spam_score: -4.2
X-Spam_bar: ----
X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3,
 SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 17 May 2020 11:49:20 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

This patch series enables the automatic reloading of response-policy
zone (RPZ) files by Knot Resolver. Specifically these patches

- Add package definitions for the cqueues Lua extension module and the
  luaossl module on which it relies, and

- Add lua5.1-cqueues as an input to knot-resolver.

With these changes applied, Knot Resolver can be configured with lines
like

    modules = { 'policy' }
    policy.add(policy.rpz(policy.DENY, '/etc/dns/blacklist.txt', true))

and it will automatically reload RPZ rules from /etc/dns/blacklist.txt
whenever that file changes. This makes it easy to use Knot Resolver to
block unwanted sites using a list of domains downloaded periodically
from the Internet.

I've tested these changes on x86-64 and aarch64. On x86-64 everything
works as expected.

On aarch64, the packages build and install fine but Knot Resolver fails
to load the configuration above with

    policy.lua:430: [poli] lua-cqueues required to watch and reload RPZ file

This is due to a known issue with LuaJIT on aarch64 (see e.g.
https://github.com/LuaJIT/LuaJIT/pull/230):

    $ ./pre-inst-env guix environment knot-resolver --ad-hoc knot-resolver
    $ $(head -n 3 `which kresd` | tail -n 2)  # set LUA_PATH, LUA_CPATH
    $ luajit -e 'require("cqueues")'
    luajit: bad light userdata pointer
    stack traceback:
            [C]: at 0xffffa556a960
            [C]: in function 'require'
            ...
    $

Otherwise (i.e. after changing "true" to "false" in the configuration
above) Knot Resolver continues to work as it did before, so I expect
existing users will not be affected.

I'll work on diagnosing the upstream bug but thought I'd submit these
patches in the meantime.

--
Simon South
simon@HIDDEN




Acknowledgement sent to Simon South <simon@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#41363; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 18 May 2020 12:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.