[PATCH 0/2] gnu: knot-resolver: Update to 5.2.0; add "doc" output

  • Done
  • quality assurance status badge
Details
2 participants
  • ???
  • Simon South
Owner
unassigned
Submitted by
Simon South
Severity
normal
S
S
Simon South wrote on 12 Nov 2020 17:46
(address . guix-patches@gnu.org)(address . simon@simonsouth.net)
cover.1605198478.git.simon@simonsouth.net
These patches

- Update Knot Resolver, a resolving DNS server, to 5.2.0. Two inputs are
added to support new functionality in this release:

- Texinfo, to enable generating the manual in Info format; and

- libnghttp2, to enable a new implementation in C of DNS-over-HTTPS. From
the Knot Resolver manual:

Knot Resolver currently offers two DoH implementations. It is
recommended to use this new implementation, which is more reliable,
scalable and has fewer dependencies. Make sure to use doh2 kind in
net.listen() to select this implementation.[0]

- Move the Knot Resolver manual to a separate "doc" output, allowing it to be
installed on its own by a user responsible for configuring the
service. (This also helps align this package with the one for Knot, its
sibling authoritative name server.)


--
Simon South
simon@simonsouth.net


Simon South (2):
gnu: knot-resolver: Update to 5.2.0.
gnu: knot-resolver: Move manual, examples to separate "doc" output

gnu/packages/dns.scm | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)

--
2.29.2
S
S
Simon South wrote on 12 Nov 2020 17:48
[PATCH 1/2] gnu: knot-resolver: Update to 5.2.0.
(address . 44596@debbugs.gnu.org)(address . simon@simonsouth.net)
2df165db376e6d21f8657ceabc3836ea46255d22.1605198478.git.simon@simonsouth.net
* gnu/packages/dns.scm (knot-resolver): Update to 5.2.0.
[native-inputs]: Add texinfo, to enable generating the manual in Info format.
[inputs]: Add nghttp2:lib, to enable the new implementation of DNS-over-HTTPS.
---
gnu/packages/dns.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

Toggle diff (43 lines)
diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index 906333bb44..784473d85f 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -937,14 +937,14 @@ synthesis, and on-the-fly re-configuration.")
(define-public knot-resolver
(package
(name "knot-resolver")
- (version "5.1.3")
+ (version "5.2.0")
(source (origin
(method url-fetch)
(uri (string-append "https://secure.nic.cz/files/knot-resolver/"
"knot-resolver-" version ".tar.xz"))
(sha256
(base32
- "12s5070nqqf599s1mb6rjas2as481rjf751qk5yrz6p34y885k90"))))
+ "0cwlipib3x88dr6cijqv2aps13b4ijv524wc85ns07rkldy2c948"))))
(build-system meson-build-system)
(arguments
'(#:configure-flags '("-Ddoc=enabled")
@@ -982,7 +982,8 @@ synthesis, and on-the-fly re-configuration.")
("pkg-config" ,pkg-config)
("python-breathe" ,python-breathe)
("python-sphinx" ,python-sphinx)
- ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
+ ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
+ ("texinfo" ,texinfo)))
(inputs
`(("fstrm" ,fstrm)
("gnutls" ,gnutls)
@@ -991,7 +992,8 @@ synthesis, and on-the-fly re-configuration.")
("lmdb" ,lmdb)
("luajit" ,luajit)
;; TODO: Add optional lua modules: basexx and psl.
- ("lua-bitop" ,lua5.1-bitop)))
+ ("lua-bitop" ,lua5.1-bitop)
+ ("nghttp2" ,nghttp2 "lib")))
(home-page "https://www.knot-resolver.cz/")
(synopsis "Caching validating DNS resolver")
(description
--
2.29.2
S
S
Simon South wrote on 12 Nov 2020 17:48
[PATCH 2/2] gnu: knot-resolver: Move manual, examples to separate "doc" output
(address . 44596@debbugs.gnu.org)(address . simon@simonsouth.net)
16947e2029bd6bc38008f1019493365c403b0ee2.1605198478.git.simon@simonsouth.net
* gnu/packages/dns.scm (knot-resolver)[outputs]: Add "doc" output.
[arguments]<phases>: Add "move-doc" phase, which moves the manual (in both its
HTML and Info formats) and the example configuration files to the "doc"
output.
---
gnu/packages/dns.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index 784473d85f..6698bbf918 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -946,6 +946,7 @@ synthesis, and on-the-fly re-configuration.")
(base32
"0cwlipib3x88dr6cijqv2aps13b4ijv524wc85ns07rkldy2c948"))))
(build-system meson-build-system)
+ (outputs '("out" "doc"))
(arguments
'(#:configure-flags '("-Ddoc=enabled")
#:phases
@@ -960,6 +961,20 @@ synthesis, and on-the-fly re-configuration.")
(add-after 'build 'build-doc
(lambda _
(invoke "ninja" "doc")))
+ (add-after 'install 'move-doc
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Move the manual and the example configuration files to the
+ ;; "doc" output.
+ (let ((out (assoc-ref outputs "out"))
+ (doc (assoc-ref outputs "doc")))
+ (mkdir-p (string-append doc "/share/doc/knot-resolver"))
+ (for-each
+ (lambda (dir)
+ (rename-file (string-append out "/share/" dir)
+ (string-append doc "/share/" dir)))
+ '("doc/knot-resolver/examples"
+ "doc/knot-resolver/html"
+ "info")))))
(add-after 'install 'wrap-binary
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
--
2.29.2
S
S
Simon South wrote on 13 Nov 2020 17:00
Re: [PATCH 0/2] gnu: knot-resolver: Update to 5.2.0; add "doc" output
(address . 44596@debbugs.gnu.org)
87blg1tfg9.fsf@simonsouth.net
Simon South <simon@simonsouth.net> writes:
Toggle quote (4 lines)
> These patches
>
> - Update Knot Resolver, a resolving DNS server, to 5.2.0...

A bug has been found in this release that affects 32-bit systems[0], so
this should perhaps be set aside for the moment. Apparently a patch is
already being prepared[1].


--
Simon South
simon@simonsouth.net
S
S
Simon South wrote on 1 Dec 2020 15:45
[PATCH v2 0/2] gnu: knot-resolver: Update to 5.2.0; add "doc" output
(address . 44596@debbugs.gnu.org)(name . Simon South)(address . simon@simonsouth.net)
cover.1606831469.git.simon@simonsouth.net
I've been waiting to see whether the Knot Resolver team would issue a point
release with their fix[0] for the bug discovered in version 5.2.0, but as that
doesn't seem to be happening here is an updated patchset that applies the fix
directly.

The only changes from the initial set are

- The addition of a patch with the upstream commit that fixes an issue with
the internal map() function on 32-bit platforms, and

- Some gentle editing of the commit messages.

For convenience, here's my original cover letter:

These patches

- Update Knot Resolver, a resolving DNS server, to 5.2.0. Two inputs are
added to support new functionality in this release:

- Texinfo, to enable generating the manual in Info format; and

- libnghttp2, to enable a new implementation in C of DNS-over-HTTPS. From
the Knot Resolver manual:

Knot Resolver currently offers two DoH implementations. It is
recommended to use this new implementation, which is more reliable,
scalable and has fewer dependencies. Make sure to use doh2 kind in
net.listen() to select this implementation.[1]

- Move the Knot Resolver manual to a separate "doc" output, allowing it to be
installed on its own by a user responsible for configuring the
service. (This also helps align this package with the one for Knot, its
sibling authoritative name server.)


--
Simon South
simon@simonsouth.net


Simon South (2):
gnu: knot-resolver: Update to 5.2.0.
gnu: knot-resolver: Move manual, examples to separate "doc" output

gnu/local.mk | 1 +
gnu/packages/dns.scm | 27 +++-
...t-resolver-fix-map-command-on-32-bit.patch | 146 ++++++++++++++++++
3 files changed, 170 insertions(+), 4 deletions(-)
create mode 100644 gnu/packages/patches/knot-resolver-fix-map-command-on-32-bit.patch

--
2.29.2
S
S
Simon South wrote on 1 Dec 2020 15:45
[PATCH v2 2/2] gnu: knot-resolver: Move manual, examples to separate "doc" output
(address . 44596@debbugs.gnu.org)(name . Simon South)(address . simon@simonsouth.net)
b9a1f915cdb00219c20db681199b44463aee2983.1606831469.git.simon@simonsouth.net
* gnu/packages/dns.scm (knot-resolver)[outputs]: Add "doc" output.
[arguments]<phases>: Add "move-doc" phase, which moves the manual (in both
HTML and Info formats) and example configuration files to the "doc" output.
---
gnu/packages/dns.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index f0c3d6a602..16313df73f 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -948,6 +948,7 @@ synthesis, and on-the-fly re-configuration.")
(patches
(search-patches "knot-resolver-fix-map-command-on-32-bit.patch"))))
(build-system meson-build-system)
+ (outputs '("out" "doc"))
(arguments
'(#:configure-flags '("-Ddoc=enabled")
#:phases
@@ -962,6 +963,20 @@ synthesis, and on-the-fly re-configuration.")
(add-after 'build 'build-doc
(lambda _
(invoke "ninja" "doc")))
+ (add-after 'install 'move-doc
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Move the manual and the example configuration files to the
+ ;; "doc" output.
+ (let ((out (assoc-ref outputs "out"))
+ (doc (assoc-ref outputs "doc")))
+ (mkdir-p (string-append doc "/share/doc/knot-resolver"))
+ (for-each
+ (lambda (dir)
+ (rename-file (string-append out "/share/" dir)
+ (string-append doc "/share/" dir)))
+ '("doc/knot-resolver/examples"
+ "doc/knot-resolver/html"
+ "info")))))
(add-after 'install 'wrap-binary
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
--
2.29.2
S
S
Simon South wrote on 1 Dec 2020 15:45
[PATCH v2 1/2] gnu: knot-resolver: Update to 5.2.0.
(address . 44596@debbugs.gnu.org)(name . Simon South)(address . simon@simonsouth.net)
f2c773468965c5e29c00a327230f77a47fcbedf2.1606831469.git.simon@simonsouth.net
* gnu/packages/dns.scm (knot-resolver): Update to 5.2.0.
[source]: Add patch from upstream commit to fix the internal map() function on
32-bit platforms.
[native-inputs]: Add texinfo to enable generating the manual in Info format.
[inputs]: Add nghttp2:lib to enable the new DNS-over-HTTPS implementation.
* gnu/packages/patches/knot-resolver-fix-map-command-on-32-bit.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/dns.scm | 12 +-
...t-resolver-fix-map-command-on-32-bit.patch | 146 ++++++++++++++++++
3 files changed, 155 insertions(+), 4 deletions(-)
create mode 100644 gnu/packages/patches/knot-resolver-fix-map-command-on-32-bit.patch

Toggle diff (209 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 80f87691fe..e8d63c38df 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1221,6 +1221,7 @@ dist_patch_DATA = \
%D%/packages/patches/kmail-Fix-missing-link-libraries.patch \
%D%/packages/patches/kmod-module-directory.patch \
%D%/packages/patches/kmscon-runtime-keymap-switch.patch \
+ %D%/packages/patches/knot-resolver-fix-map-command-on-32-bit.patch \
%D%/packages/patches/kpackage-allow-external-paths.patch \
%D%/packages/patches/kpackage-fix-KF5PackageMacros.cmake.patch \
%D%/packages/patches/kmplayer-aarch64.patch \
diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index 3aa3cf3e8d..f0c3d6a602 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -937,14 +937,16 @@ synthesis, and on-the-fly re-configuration.")
(define-public knot-resolver
(package
(name "knot-resolver")
- (version "5.1.3")
+ (version "5.2.0")
(source (origin
(method url-fetch)
(uri (string-append "https://secure.nic.cz/files/knot-resolver/"
"knot-resolver-" version ".tar.xz"))
(sha256
(base32
- "12s5070nqqf599s1mb6rjas2as481rjf751qk5yrz6p34y885k90"))))
+ "0cwlipib3x88dr6cijqv2aps13b4ijv524wc85ns07rkldy2c948"))
+ (patches
+ (search-patches "knot-resolver-fix-map-command-on-32-bit.patch"))))
(build-system meson-build-system)
(arguments
'(#:configure-flags '("-Ddoc=enabled")
@@ -982,7 +984,8 @@ synthesis, and on-the-fly re-configuration.")
("pkg-config" ,pkg-config)
("python-breathe" ,python-breathe)
("python-sphinx" ,python-sphinx)
- ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
+ ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
+ ("texinfo" ,texinfo)))
(inputs
`(("fstrm" ,fstrm)
("gnutls" ,gnutls)
@@ -991,7 +994,8 @@ synthesis, and on-the-fly re-configuration.")
("lmdb" ,lmdb)
("luajit" ,luajit)
;; TODO: Add optional lua modules: basexx and psl.
- ("lua-bitop" ,lua5.1-bitop)))
+ ("lua-bitop" ,lua5.1-bitop)
+ ("nghttp2" ,nghttp2 "lib")))
(home-page "https://www.knot-resolver.cz/")
(synopsis "Caching validating DNS resolver")
(description
diff --git a/gnu/packages/patches/knot-resolver-fix-map-command-on-32-bit.patch b/gnu/packages/patches/knot-resolver-fix-map-command-on-32-bit.patch
new file mode 100644
index 0000000000..02c0fbcb70
--- /dev/null
+++ b/gnu/packages/patches/knot-resolver-fix-map-command-on-32-bit.patch
@@ -0,0 +1,146 @@
+commit e01979620025666633250b3e2d545fe59c629f73
+Author: Vladimír ?unát <vladimir.cunat@nic.cz>
+Date: Fri Nov 13 14:16:32 2020 +0100
+
+ fix map() command on 32-bit platforms; regressed in 5.2.0
+
+ LuaJIT FFI was using opendir() (etc.) variants with 32-bit inodes
+ but the C parts was using them as 64-bit inode variants.
+ Consequently the `struct dirent` layout didn't match and we were getting
+ filenames shifted by eight bytes.
+
+ Now the whole dir-listing lua function is written in C.
+
+diff --git a/.luacheckrc b/.luacheckrc
+index 0cf0b884..67bc18f6 100644
+--- a/.luacheckrc
++++ b/.luacheckrc
+@@ -20,6 +20,7 @@ new_read_globals = {
+ 'user',
+ 'verbose',
+ 'worker',
++ 'kluautil_list_dir',
+ -- Sandbox declarations
+ 'kB',
+ 'MB',
+diff --git a/NEWS b/NEWS
+index 2eae3082..9d8cde99 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,6 +1,10 @@
+ Knot Resolver X.Y.X (yyyy-mm-dd)
+ ================================
+
++Bugfixes
++--------
++- fix map() command on 32-bit platforms; regressed in 5.2.0 (!1093)
++
+
+ Knot Resolver 5.2.0 (2020-11-11)
+ ================================
+diff --git a/daemon/bindings/impl.c b/daemon/bindings/impl.c
+index d10f4525..d9ad0774 100644
+--- a/daemon/bindings/impl.c
++++ b/daemon/bindings/impl.c
+@@ -2,6 +2,7 @@
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
++#include <dirent.h>
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <string.h>
+@@ -29,6 +30,29 @@ const char * lua_table_checkindices(lua_State *L, const char *keys[])
+ return NULL;
+ }
+
++/** Return table listing filenames in a given directory (ls -A). */
++static int kluautil_list_dir(lua_State *L)
++{
++ lua_newtable(L); // empty table even on errors
++
++ const char *path = lua_tolstring(L, 1, NULL);
++ if (!path) return 1;
++ DIR *dir = opendir(path);
++ if (!dir) return 1;
++
++ struct dirent *entry;
++ int lua_i = 1;
++ while ((entry = readdir(dir)) != NULL) {
++ if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) {
++ lua_pushstring(L, entry->d_name);
++ lua_rawseti(L, -2, lua_i++);
++ }
++ }
++
++ closedir(dir);
++ return 1;
++}
++
+
+ /* Each of these just creates the correspondingly named lua table of functions. */
+ int kr_bindings_cache (lua_State *L); /* ./cache.c */
+@@ -44,6 +68,9 @@ void kr_bindings_register(lua_State *L)
+ kr_bindings_modules(L);
+ kr_bindings_net(L);
+ kr_bindings_worker(L);
++
++ /* Finally some lua utils *written in C*, not really a binding. */
++ lua_register(L, "kluautil_list_dir", kluautil_list_dir);
+ }
+
+ void lua_error_p(lua_State *L, const char *fmt, ...)
+diff --git a/daemon/lua/kluautil.lua b/daemon/lua/kluautil.lua
+index 57912e7b..e73e952c 100644
+--- a/daemon/lua/kluautil.lua
++++ b/daemon/lua/kluautil.lua
+@@ -1,6 +1,5 @@
+ -- SPDX-License-Identifier: GPL-3.0-or-later
+
+-local ffi = require('ffi')
+ local kluautil = {}
+
+ -- Get length of table
+@@ -28,14 +27,6 @@ function kluautil.kr_table_unpack(tab)
+ return unpack(tab, 1, tab.n)
+ end
+
+-ffi.cdef([[
+- typedef struct __dirstream DIR;
+- DIR *opendir(const char *name);
+- struct dirent *readdir(DIR *dirp);
+- int closedir(DIR *dirp);
+- char *strerror(int errnum);
+-]])
+-
+ -- Fetch over HTTPS
+ function kluautil.kr_https_fetch(url, out_file, ca_file)
+ local http_ok, http_request = pcall(require, 'http.request')
+@@ -88,26 +79,6 @@ function kluautil.kr_https_fetch(url, out_file, ca_file)
+ return true
+ end
+
+--- List directory
+-function kluautil.list_dir (path)
+- local results = {}
+- local dir = ffi.C.opendir(path)
+- if dir == nil then
+- return results
+- end
+-
+- local entry = ffi.C.readdir(dir)
+- while entry ~= nil do
+- local entry_name = ffi.string(ffi.C.kr_dirent_name(entry))
+- if entry_name ~= '.' and entry_name ~= '..' then
+- table.insert(results, entry_name)
+- end
+- entry = ffi.C.readdir(dir)
+- end
+-
+- ffi.C.closedir(dir)
+-
+- return results
+-end
++kluautil.list_dir = kluautil_list_dir
+
+ return kluautil
--
2.29.2
?
Re: [bug#44596] [PATCH v2 0/2] gnu: knot-resolver: Update to 5.2.0; add "doc" output
(name . Simon South)(address . simon@simonsouth.net)(address . 44596-done@debbugs.gnu.org)
TYAP286MB0185EC1E8470F9A80B1AEFA0A3CF0@TYAP286MB0185.JPNP286.PROD.OUTLOOK.COM
Simon South <simon@simonsouth.net> writes:

Toggle quote (6 lines)
> I've been waiting to see whether the Knot Resolver team would issue a point
> release with their fix[0] for the bug discovered in version 5.2.0, but as that
> doesn't seem to be happening here is an updated patchset that applies the fix
> directly.
>

Pushed, thank you for the patches and this fix!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 44596@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 44596
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch