all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2
@ 2021-06-06 18:52 Ryan Sundberg via Guix-patches via
  2021-06-06 18:52 ` [bug#48889] [PATCH 2/4] Ceph: patch rbd to use $PATH lookups for modprobe Ryan Sundberg via Guix-patches via
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Ryan Sundberg via Guix-patches via @ 2021-06-06 18:52 UTC (permalink / raw)
  To: 48889; +Cc: Ryan Sundberg

Adds the bird BGP daemon to gnu/packages/bird.scm
---
 gnu/packages/bird.scm | 74 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 gnu/packages/bird.scm

diff --git a/gnu/packages/bird.scm b/gnu/packages/bird.scm
new file mode 100644
index 0000000000..5fac395906
--- /dev/null
+++ b/gnu/packages/bird.scm
@@ -0,0 +1,74 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages bird)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages flex)
+  #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages readline)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix licenses))
+
+(define-public bird-1
+  (package
+    (name "bird")
+    (version "1.6.7")
+    (source 
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://gitlab.nic.cz/labs/bird.git")
+               (commit (string-append "v" version))))
+        (sha256 (base32 "0vbjp42c2zqmcrqcwm4g4fq1v93l6rlk0c27i0k08f3v07w75cih"))))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:configure-flags '("--enable-ipv6")
+        #:tests? #f
+        #:phases (modify-phases %standard-phases
+                                ; Fix "cc not found" in tools/mergedirs
+                                (add-after 'bootstrap 'set-cc
+                                           (lambda _ 
+                                             (setenv "CPP" "gcc -E")
+                                             #t)))))
+    (inputs
+      `(("autoconf" ,autoconf)
+        ("bison" ,bison)
+        ("flex" ,flex)
+        ("ncurses" ,ncurses)
+        ("readline" ,readline)))
+    (home-page "http://bird.network.cz/")
+    (synopsis "BIRD Internet Routing Daemon")
+    (description "The BIRD project aims to develop a dynamic IP routing daemon with full support of all modern routing protocols, easy to use configuration interface and powerful route filtering language, primarily targeted on (but not limited to) Linux and other UNIX-like systems and distributed under the GNU General Public License.")
+    (license gpl2+)))
+
+(define-public bird
+  (package
+    (inherit bird-1)
+    (version "2.0.8")
+    (source 
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://gitlab.nic.cz/labs/bird.git")
+               (commit (string-append "v" version))))
+        (sha256 (base32 "07mh41hsmkcpf6f6lnygzp6g59jma542pcqdkl54ysiqnjmi5zz1"))))
+    (arguments
+      `(#:configure-flags '("--enable-ipv6")))))
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 2/4] Ceph: patch rbd to use $PATH lookups for modprobe
  2021-06-06 18:52 [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Ryan Sundberg via Guix-patches via
@ 2021-06-06 18:52 ` Ryan Sundberg via Guix-patches via
  2021-06-07  9:40   ` Maxime Devos
  2021-06-06 18:52 ` [bug#48889] [PATCH 3/4] Ceph: upgrade minor version to latest stable release (14.2.21) Ryan Sundberg via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Ryan Sundberg via Guix-patches via @ 2021-06-06 18:52 UTC (permalink / raw)
  To: 48889; +Cc: Ryan Sundberg

Removes hardcoded paths assumed in /sbin and /bin compiled into the
`rbd` tool.

Patch originally discussed at https://github.com/ceph/ceph/pull/20938
and rejected by upstream for ambiguous security concerns related to
relative paths.
---
 .../patches/ceph-relative-paths.patch         | 22 +++++++++++++++++++
 gnu/packages/storage.scm                      |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/ceph-relative-paths.patch

diff --git a/gnu/packages/patches/ceph-relative-paths.patch b/gnu/packages/patches/ceph-relative-paths.patch
new file mode 100644
index 0000000000..e1b1d3599f
--- /dev/null
+++ b/gnu/packages/patches/ceph-relative-paths.patch
@@ -0,0 +1,22 @@
+diff --git a/src/common/module.c b/src/common/module.c
+index f19f74324c..53355b8185 100644
+--- a/src/common/module.c
++++ b/src/common/module.c
+@@ -66,7 +66,7 @@ int module_has_param(const char *module, const char *param)
+ 	char command[128];
+ 
+ 	snprintf(command, sizeof(command),
+-		 "/sbin/modinfo -F parm %s | /bin/grep -q ^%s:",
++		 "modinfo -F parm %s | grep -q ^%s:",
+ 		 module, param);
+ 
+ 	return run_command(command) == 0;
+@@ -76,7 +76,7 @@ int module_load(const char *module, const char *options)
+ {
+ 	char command[128];
+ 
+-	snprintf(command, sizeof(command), "/sbin/modprobe %s %s",
++	snprintf(command, sizeof(command), "modprobe %s %s",
+ 		 module, (options ? options : ""));
+ 
+ 	return run_command(command);
diff --git a/gnu/packages/storage.scm b/gnu/packages/storage.scm
index d53327df75..b4f7d5e301 100644
--- a/gnu/packages/storage.scm
+++ b/gnu/packages/storage.scm
@@ -64,7 +64,7 @@
                (base32
                 "0lmdri415hqczc9565s5m5568pnj97ipqxgnw6085kps0flwq5zh"))
               (patches
-               (search-patches "ceph-disable-cpu-optimizations.patch"))
+               (search-patches "ceph-disable-cpu-optimizations.patch" "ceph-relative-paths.patch"))
               (modules '((guix build utils)))
               (snippet
                '(begin
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 3/4] Ceph: upgrade minor version to latest stable release (14.2.21)
  2021-06-06 18:52 [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Ryan Sundberg via Guix-patches via
  2021-06-06 18:52 ` [bug#48889] [PATCH 2/4] Ceph: patch rbd to use $PATH lookups for modprobe Ryan Sundberg via Guix-patches via
@ 2021-06-06 18:52 ` Ryan Sundberg via Guix-patches via
  2021-06-06 18:52 ` [bug#48889] [PATCH 4/4] bpftool: new package Ryan Sundberg via Guix-patches via
  2021-06-07  9:35 ` [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Maxime Devos
  3 siblings, 0 replies; 10+ messages in thread
From: Ryan Sundberg via Guix-patches via @ 2021-06-06 18:52 UTC (permalink / raw)
  To: 48889; +Cc: Ryan Sundberg

---
 gnu/packages/storage.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/storage.scm b/gnu/packages/storage.scm
index b4f7d5e301..9e64b9417f 100644
--- a/gnu/packages/storage.scm
+++ b/gnu/packages/storage.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -55,14 +56,14 @@
 (define-public ceph
   (package
     (name "ceph")
-    (version "14.2.16")
+    (version "14.2.21")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://download.ceph.com/tarballs/ceph-"
                                   version ".tar.gz"))
               (sha256
                (base32
-                "0lmdri415hqczc9565s5m5568pnj97ipqxgnw6085kps0flwq5zh"))
+                "1hhdxrmp7a8n00kmx9s4bib84dvfal98x7i9c65p4q6nknlcdvdw"))
               (patches
                (search-patches "ceph-disable-cpu-optimizations.patch" "ceph-relative-paths.patch"))
               (modules '((guix build utils)))
@@ -76,7 +77,6 @@
                               ;"src/zstd"
                               ;"src/civetweb"
                               ;"src/seastar/fmt"
-                              "src/test/downloads"
                               "src/c-ares"
                               "src/googletest"
                               "src/rapidjson"
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 4/4] bpftool: new package
  2021-06-06 18:52 [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Ryan Sundberg via Guix-patches via
  2021-06-06 18:52 ` [bug#48889] [PATCH 2/4] Ceph: patch rbd to use $PATH lookups for modprobe Ryan Sundberg via Guix-patches via
  2021-06-06 18:52 ` [bug#48889] [PATCH 3/4] Ceph: upgrade minor version to latest stable release (14.2.21) Ryan Sundberg via Guix-patches via
@ 2021-06-06 18:52 ` Ryan Sundberg via Guix-patches via
  2021-06-07  9:50   ` Maxime Devos
  2021-06-07  9:35 ` [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Maxime Devos
  3 siblings, 1 reply; 10+ messages in thread
From: Ryan Sundberg via Guix-patches via @ 2021-06-06 18:52 UTC (permalink / raw)
  To: 48889; +Cc: Ryan Sundberg

Adds the bpftool package from the Linux kernel source tree.
---
 gnu/packages/linux.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c8ec310665..06bb344475 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -54,6 +54,7 @@
 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8108,3 +8109,42 @@ Availability and Serviceability} reports from Linux kernel trace events.
 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
 through standard log mechanisms like syslog.")
     (license license:gpl2)))
+
+(define-public bpftool
+  (package
+    (name "bpftool")
+    (version (package-version linux-libre))
+    (source (package-source linux-libre))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:tests? #f
+        #:phases 
+        (modify-phases %standard-phases
+          (add-before 'configure 'chdir 
+            (lambda _ (chdir "tools/bpf") #t))
+          (delete 'configure)
+          (replace 'build 
+            (lambda _ (invoke "make" "CC=gcc" "bpftool") #t))
+          (replace 'install 
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))) 
+                (mkdir-p (string-append out "/sbin"))
+                (mkdir-p (string-append out "/share/bash-completion/completions"))
+                (invoke "make" 
+                        (string-append "prefix=" out)
+                        (string-append "bash_compdir=" out "/share/bash-completion/completions")
+                        "-C" "bpftool"
+                        "install")
+                #t))))))
+    (inputs
+      `(("bison" ,bison)
+        ("python" ,python-3)
+        ("readline" ,readline)))
+    (propagated-inputs
+      `(("libcap" ,libcap)
+        ("libelf" ,libelf)
+        ("zlib" ,zlib)))
+    (home-page (package-home-page linux-libre))
+    (synopsis "bpftool is a tool for inspection and simple manipulation of eBPF programs and maps")
+    (description "*bpftool* allows for inspection and simple modification of BPF objects on the system.  Note that format of the output of all tools is not guaranteed to be stable and should not be depended upon.")
+    (license (package-license linux-libre))))
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2
  2021-06-06 18:52 [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Ryan Sundberg via Guix-patches via
                   ` (2 preceding siblings ...)
  2021-06-06 18:52 ` [bug#48889] [PATCH 4/4] bpftool: new package Ryan Sundberg via Guix-patches via
@ 2021-06-07  9:35 ` Maxime Devos
  2021-06-09  6:50   ` Ryan Sundberg via Guix-patches via
  3 siblings, 1 reply; 10+ messages in thread
From: Maxime Devos @ 2021-06-07  9:35 UTC (permalink / raw)
  To: Ryan Sundberg, 48889

[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]

Hi,

Ryan Sundberg via Guix-patches via schreef op zo 06-06-2021 om 11:52 [-0700]:
> Adds the bird BGP daemon to gnu/packages/bird.scm

See commits (e.g. git log -n9) for how to format commit messages.

> ---
>  gnu/packages/bird.scm | 74 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 74 insertions(+)
>  create mode 100644 gnu/packages/bird.scm
> 
> diff --git a/gnu/packages/bird.scm b/gnu/packages/bird.scm
> new file mode 100644
> index 0000000000..5fac395906
> --- /dev/null
> +++ b/gnu/packages/bird.scm

Maybe gnu/packages/networking.scm, instead of creating a new
module for a single package.

> +        #:phases (modify-phases %standard-phases
> +                                ; Fix "cc not found" in tools/mergedirs
> +                                (add-after 'bootstrap 'set-cc
> +                                           (lambda _ 
> +                                             (setenv "CPP" "gcc -E")
> +                                             #t)))))

This most likely should be ,(string-append (cc-for-target) " -E"), to
make sure cross-compiling works. Also, the more declarative #:make-flags
is preferred above imperative setenv.

> +    (inputs
> +      `(("autoconf" ,autoconf)
> +        ("bison" ,bison)
> +        ("flex" ,flex)

autoconf, bison & flex most likely should be native inputs.

> +        ("ncurses" ,ncurses)
> +        ("readline" ,readline)))
> +    (home-page "http://bird.network.cz/")
> +    (synopsis "BIRD Internet Routing Daemon")
> +    (description "The BIRD project aims to develop a dynamic IP routing daemon with full support of all modern routing protocols, easy to use configuration interface and powerful route filtering language, primarily targeted on (but not limited to) Linux and other UNIX-like systems and distributed under the GNU General Public License.")
> +    (license gpl2+)))

The description line is too long.
./pre-inst-env guix lint bird@1.6.7 should detect that.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 2/4] Ceph: patch rbd to use $PATH lookups for modprobe
  2021-06-06 18:52 ` [bug#48889] [PATCH 2/4] Ceph: patch rbd to use $PATH lookups for modprobe Ryan Sundberg via Guix-patches via
@ 2021-06-07  9:40   ` Maxime Devos
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Devos @ 2021-06-07  9:40 UTC (permalink / raw)
  To: Ryan Sundberg, 48889

[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]

Ryan Sundberg via Guix-patches via schreef op zo 06-06-2021 om 11:52 [-0700]:
> Removes hardcoded paths assumed in /sbin and /bin compiled into the
> `rbd` tool.
> 
> Patch originally discussed at https://github.com/ceph/ceph/pull/20938
> and rejected by upstream for ambiguous security concerns related to
> relative paths.
> ---
>  .../patches/ceph-relative-paths.patch         | 22 +++++++++++++++++++
>  gnu/packages/storage.scm                      |  2 +-
>  2 files changed, 23 insertions(+), 1 deletion(-)
>  create mode 100644 gnu/packages/patches/ceph-relative-paths.patch
> 
> diff --git a/gnu/packages/patches/ceph-relative-paths.patch b/gnu/packages/patches/ceph-relative-paths.patch
> new file mode 100644
> index 0000000000..e1b1d3599f
> --- /dev/null
> +++ b/gnu/packages/patches/ceph-relative-paths.patch
> @@ -0,0 +1,22 @@
> +diff --git a/src/common/module.c b/src/common/module.c
> +index f19f74324c..53355b8185 100644
> +--- a/src/common/module.c
> ++++ b/src/common/module.c
> +@@ -66,7 +66,7 @@ int module_has_param(const char *module, const char *param)
> + 	char command[128];
> + 
> + 	snprintf(command, sizeof(command),
> +-		 "/sbin/modinfo -F parm %s | /bin/grep -q ^%s:",
> ++		 "modinfo -F parm %s | grep -q ^%s:",

modinfo is not necessarily in the profile. I'd recommend
using substitute* from a build phase to replace
/sbin/modinfo with the appropriate /gnu/store path.
((string-append (assoc-ref inputs "???") "/sbin/modinfo")
or something like that, were you'll need to replace "???")

> +-	snprintf(command, sizeof(command), "/sbin/modprobe %s %s",
> ++	snprintf(command, sizeof(command), "modprobe %s %s",
> + 		 module, (options ? options : ""));

Likewise.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 4/4] bpftool: new package
  2021-06-06 18:52 ` [bug#48889] [PATCH 4/4] bpftool: new package Ryan Sundberg via Guix-patches via
@ 2021-06-07  9:50   ` Maxime Devos
  2021-06-09  7:06     ` Ryan Sundberg via Guix-patches via
  0 siblings, 1 reply; 10+ messages in thread
From: Maxime Devos @ 2021-06-07  9:50 UTC (permalink / raw)
  To: Ryan Sundberg, 48889

[-- Attachment #1: Type: text/plain, Size: 3698 bytes --]

Ryan Sundberg via Guix-patches via schreef op zo 06-06-2021 om 11:52 [-0700]:
> Adds the bpftool package from the Linux kernel source tree.
> ---
>  gnu/packages/linux.scm | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index c8ec310665..06bb344475 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -54,6 +54,7 @@
>  ;;; Copyright © 2020 David Dashyan <mail@davie.li>
>  ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
>  ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
> +;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -8108,3 +8109,42 @@ Availability and Serviceability} reports from Linux kernel trace events.
>  These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
>  through standard log mechanisms like syslog.")
>      (license license:gpl2)))
> +
> +(define-public bpftool
> +  (package
> +    (name "bpftool")
> +    (version (package-version linux-libre))
> +    (source (package-source linux-libre))
> +    (build-system gnu-build-system)
> +    (arguments
> +      `(#:tests? #f

Why are tests disabled?

> +        #:phases 
> +        (modify-phases %standard-phases
> +          (add-before 'configure 'chdir 
> +            (lambda _ (chdir "tools/bpf") #t))
> +          (delete 'configure)
> +          (replace 'build 
> +            (lambda _ (invoke "make" "CC=gcc" "bpftool") #t))

Use ,(string-append "CC=" (cc-for-target)), to make sure cross-compiling bpftools
works.

> +          (replace 'install 
> +            (lambda* (#:key outputs #:allow-other-keys)
> +              (let* ((out (assoc-ref outputs "out"))) 
> +                (mkdir-p (string-append out "/sbin"))
> +                (mkdir-p (string-append out "/share/bash-completion/completions"))
> +                (invoke "make" 
> +                        (string-append "prefix=" out)
> +                        (string-append "bash_compdir=" out "/share/bash-completion/completions")
> +                        "-C" "bpftool"
> +                        "install")
> +                #t))))))
> +    (inputs
> +      `(("bison" ,bison)

Bison looks like a native input to me.

> +        ("python" ,python-3)

Could be input, could be native-input. I don't know what's appropriate for bpftools.

You can check with
  ./pre-inst-env guix build bpftools --target=aarch64-linux-gnu

If there is "command not found: python" or something like that,
you'll need to move python to native-inputs.

> +        ("readline" ,readline)))
> +    (propagated-inputs
> +      `(("libcap" ,libcap)
> +        ("libelf" ,libelf)
> +        ("zlib" ,zlib)))

bpftool is a tool, and not a library, right?
Then these libraries should be in inputs, not propagated-inputs,
to avoid polluting the profile.

bpftool should still have access to these libraries by ELF's RPATH
or something like that.

> +    (home-page (package-home-page linux-libre))

I don't see anything about bpftools on <https://www.gnu.org/software/linux-libre/>.
Maybe bpftools has a wiki somewhere?

> +    (synopsis "bpftool is a tool for inspection and simple manipulation of eBPF programs and maps")
> +    (description "*bpftool* allows for inspection and simple modification of BPF objects on the system.  Note that format of the output of all tools is not guaranteed to be stable and should not be depended upon.")

Line is too long. Also, what's up with surrounding bpftools with *asterisks*?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2
  2021-06-07  9:35 ` [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Maxime Devos
@ 2021-06-09  6:50   ` Ryan Sundberg via Guix-patches via
  2021-06-18 15:40     ` Ryan Sundberg via Guix-patches via
  0 siblings, 1 reply; 10+ messages in thread
From: Ryan Sundberg via Guix-patches via @ 2021-06-09  6:50 UTC (permalink / raw)
  To: Maxime Devos, 48889


[-- Attachment #1.1.1: Type: text/plain, Size: 2264 bytes --]

Hi Maxime, thanks for the good feedback. Please see the revised patch here.

--
Sincerely,
Ryan Sundberg

On 6/7/21 2:35 AM, Maxime Devos wrote:
> Hi,
> 
> Ryan Sundberg via Guix-patches via schreef op zo 06-06-2021 om 11:52 [-0700]:
>> Adds the bird BGP daemon to gnu/packages/bird.scm
> 
> See commits (e.g. git log -n9) for how to format commit messages.
> 
>> ---
>>  gnu/packages/bird.scm | 74 +++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 74 insertions(+)
>>  create mode 100644 gnu/packages/bird.scm
>>
>> diff --git a/gnu/packages/bird.scm b/gnu/packages/bird.scm
>> new file mode 100644
>> index 0000000000..5fac395906
>> --- /dev/null
>> +++ b/gnu/packages/bird.scm
> 
> Maybe gnu/packages/networking.scm, instead of creating a new
> module for a single package.
> 
>> +        #:phases (modify-phases %standard-phases
>> +                                ; Fix "cc not found" in tools/mergedirs
>> +                                (add-after 'bootstrap 'set-cc
>> +                                           (lambda _ 
>> +                                             (setenv "CPP" "gcc -E")
>> +                                             #t)))))
> 
> This most likely should be ,(string-append (cc-for-target) " -E"), to
> make sure cross-compiling works. Also, the more declarative #:make-flags
> is preferred above imperative setenv.
> 
>> +    (inputs
>> +      `(("autoconf" ,autoconf)
>> +        ("bison" ,bison)
>> +        ("flex" ,flex)
> 
> autoconf, bison & flex most likely should be native inputs.
> 
>> +        ("ncurses" ,ncurses)
>> +        ("readline" ,readline)))
>> +    (home-page "http://bird.network.cz/")
>> +    (synopsis "BIRD Internet Routing Daemon")
>> +    (description "The BIRD project aims to develop a dynamic IP routing daemon with full support of all modern routing protocols, easy to use configuration interface and powerful route filtering language, primarily targeted on (but not limited to) Linux and other UNIX-like systems and distributed under the GNU General Public License.")
>> +    (license gpl2+)))
> 
> The description line is too long.
> ./pre-inst-env guix lint bird@1.6.7 should detect that.
> 
> Greetings,
> Maxime.
> 

[-- Attachment #1.1.2: 0001-gnu-Add-bird-versions-1.6.7-and-2.0.8.patch --]
[-- Type: text/x-patch, Size: 3043 bytes --]

From 4cff7f7e80dd2e46705675aa14d14d95a7ee9a9d Mon Sep 17 00:00:00 2001
From: Ryan Sundberg <ryan@arctype.co>
Date: Fri, 4 Jun 2021 20:53:11 -0700
Subject: [PATCH 1/5] gnu: Add bird versions 1.6.7 and 2.0.8

* gnu/packages/networking.scm (bird): New variable.
{bird-1}: New variable.

Signed-off-by: Ryan Sundberg <ryan@arctype.co>
---
 gnu/packages/networking.scm | 52 +++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 462215c0f1..6ab23f4ae3 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -43,6 +43,7 @@
 ;;; Copyright © 2020 Hamzeh Nasajpour <h.nasajpour@pantherx.org>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4196,3 +4197,54 @@ IPv6 Internet connectivity - it also works over IPv4.")
      ;; version. This exception does not (and cannot) modify any license 
terms
      ;; which apply to the Application, with which you must still comply
      license:lgpl3)))
+
+(define-public bird-1
+  (package
+    (name "bird")
+    (version "1.6.7")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://gitlab.nic.cz/labs/bird.git")
+               (commit (string-append "v" version))))
+        (sha256 (base32 "0vbjp42c2zqmcrqcwm4g4fq1v93l6rlk0c27i0k08f3v07w75cih"))))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:configure-flags '("--enable-ipv6")
+        #:tests? #f ; No tests defined for bird 1
+        #:phases
+        (modify-phases
+          %standard-phases
+          ; Fix "cc not found" in tools/mergedirs
+          (add-after 'bootstrap 'set-cc
+                     (lambda _
+                       (setenv "CPP" ,(string-append (cc-for-target) " -E"))
+                       #t)))))
+    (inputs
+      `(("ncurses" ,ncurses)
+        ("readline" ,readline)))
+    (native-inputs
+      `(("autoconf" ,autoconf)
+        ("bison" ,bison)
+        ("flex" ,flex)))
+    (home-page "http://bird.network.cz/")
+    (synopsis "BIRD Internet Routing Daemon")
+    (description "The BIRD project aims to develop a dynamic IP routing daemon
+with full support of all modern routing protocols, easy to use configuration
+interface and powerful route filtering language.")
+    (license license:gpl2+)))
+
+(define-public bird
+  (package
+    (inherit bird-1)
+    (version "2.0.8")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://gitlab.nic.cz/labs/bird.git")
+               (commit (string-append "v" version))))
+        (sha256 (base32 "07mh41hsmkcpf6f6lnygzp6g59jma542pcqdkl54ysiqnjmi5zz1"))))
+    (arguments
+      `(#:configure-flags '("--enable-ipv6")))))
-- 
2.31.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 4/4] bpftool: new package
  2021-06-07  9:50   ` Maxime Devos
@ 2021-06-09  7:06     ` Ryan Sundberg via Guix-patches via
  0 siblings, 0 replies; 10+ messages in thread
From: Ryan Sundberg via Guix-patches via @ 2021-06-09  7:06 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 48889


[-- Attachment #1.1.1: Type: text/plain, Size: 4410 bytes --]

Here is the revised bpftool patch. Responses below.

--
Sincerely,
Ryan Sundberg

On 6/7/21 2:50 AM, Maxime Devos wrote:
> Ryan Sundberg via Guix-patches via schreef op zo 06-06-2021 om 11:52 [-0700]:
>> Adds the bpftool package from the Linux kernel source tree.
>> ---
>>  gnu/packages/linux.scm | 40 ++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 40 insertions(+)
>>
>> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
>> index c8ec310665..06bb344475 100644
>> --- a/gnu/packages/linux.scm
>> +++ b/gnu/packages/linux.scm
>> @@ -54,6 +54,7 @@
>>  ;;; Copyright © 2020 David Dashyan <mail@davie.li>
>>  ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
>>  ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
>> +;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -8108,3 +8109,42 @@ Availability and Serviceability} reports from Linux kernel trace events.
>>  These trace events are logged in @file{/sys/kernel/debug/tracing} and 
reported
>>  through standard log mechanisms like syslog.")
>>      (license license:gpl2)))
>> +
>> +(define-public bpftool
>> +  (package
>> +    (name "bpftool")
>> +    (version (package-version linux-libre))
>> +    (source (package-source linux-libre))
>> +    (build-system gnu-build-system)
>> +    (arguments
>> +      `(#:tests? #f
> 
> Why are tests disabled?
This program has no tests. I commented as such in the new patch.
> 
>> +        #:phases 
>> +        (modify-phases %standard-phases
>> +          (add-before 'configure 'chdir 
>> +            (lambda _ (chdir "tools/bpf") #t))
>> +          (delete 'configure)
>> +          (replace 'build 
>> +            (lambda _ (invoke "make" "CC=gcc" "bpftool") #t))
> 
> Use ,(string-append "CC=" (cc-for-target)), to make sure cross-compiling bpftools
> works.
> 
>> +          (replace 'install 
>> +            (lambda* (#:key outputs #:allow-other-keys)
>> +              (let* ((out (assoc-ref outputs "out"))) 
>> +                (mkdir-p (string-append out "/sbin"))
>> +                (mkdir-p (string-append out "/share/bash-completion/completions"))
>> +                (invoke "make" 
>> +                        (string-append "prefix=" out)
>> +                        (string-append "bash_compdir=" out "/share/bash-completion/completions")
>> +                        "-C" "bpftool"
>> +                        "install")
>> +                #t))))))
>> +    (inputs
>> +      `(("bison" ,bison)
> 
> Bison looks like a native input to me.
> 
>> +        ("python" ,python-3)
> 
> Could be input, could be native-input. I don't know what's appropriate for bpftools.
You are right, python should be a native-input.

> 
> You can check with
>   ./pre-inst-env guix build bpftools --target=aarch64-linux-gnu
Cross-compiling produced this linker error I'm not sure how to deal with
right now:

ld: staticobjs/libbpf.o: error adding symbols: file in wrong format

> 
> If there is "command not found: python" or something like that,
> you'll need to move python to native-inputs.
> 
>> +        ("readline" ,readline)))
>> +    (propagated-inputs
>> +      `(("libcap" ,libcap)
>> +        ("libelf" ,libelf)
>> +        ("zlib" ,zlib)))
> 
> bpftool is a tool, and not a library, right?
> Then these libraries should be in inputs, not propagated-inputs,
> to avoid polluting the profile.
> 
> bpftool should still have access to these libraries by ELF's RPATH
> or something like that.
> 
>> +    (home-page (package-home-page linux-libre))
> 
> I don't see anything about bpftools on <https://www.gnu.org/software/linux-libre/>.
> Maybe bpftools has a wiki somewhere?
I linked https://lwn.net/Articles/739357/ as the new home-page, which is
the closest this program gets to online documentation that I could find.

> 
>> +    (synopsis "bpftool is a tool for inspection and simple manipulation of eBPF programs and maps")
>> +    (description "*bpftool* allows for inspection and simple modification of BPF objects on the system.  Note that format of the output of all 
tools is not guaranteed to be stable and should not be depended upon.")
> 
> Line is too long. Also, what's up with surrounding bpftools with *asterisks*?
Copy-paste error
> 
> Greetings,
> Maxime.
> 

[-- Attachment #1.1.2: 0001-gnu-Add-bpftool-in-sync-with-the-Linux-kernel-versio.patch --]
[-- Type: text/x-patch, Size: 2999 bytes --]

From 87104ca47671801f34848326a17f4eb453dc3c9a Mon Sep 17 00:00:00 2001
From: Ryan Sundberg <ryan@arctype.co>
Date: Sun, 6 Jun 2021 09:53:43 -0700
Subject: [PATCH] gnu: Add bpftool in sync with the Linux kernel version.

* gnu/packages/linux.scm (bpftool): New variable

Signed-off-by: Ryan Sundberg <ryan@arctype.co>
---
 gnu/packages/linux.scm | 46 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c8ec310665..5d4d1669c2 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -54,6 +54,7 @@
 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8108,3 +8109,48 @@ Availability and Serviceability} reports from Linux kernel trace events.
 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
 through standard log mechanisms like syslog.")
     (license license:gpl2)))
+
+(define-public bpftool
+  (package
+    (name "bpftool")
+    (version (package-version linux-libre))
+    (source (package-source linux-libre))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:tests? #f ; This package has no tests.
+        #:phases
+        (modify-phases %standard-phases
+          (add-before 'configure 'chdir
+            (lambda _ (chdir "tools/bpf") #t))
+          (delete 'configure)
+          (replace 'build
+            (lambda _ (invoke "make"
+                              ,(string-append "CC=" (cc-for-target))
+                              "bpftool")
+              #t))
+          (replace 'install
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out")))
+                (mkdir-p (string-append out "/sbin"))
+                (mkdir-p (string-append out "/share/bash-completion/completions"))
+                (invoke "make"
+                        (string-append "prefix=" out)
+                        (string-append "bash_compdir=" out
+                                       "/share/bash-completion/completions")
+                        "-C" "bpftool"
+                        "install")
+                #t))))))
+    (inputs
+      `(("readline" ,readline)
+        ("libcap" ,libcap)
+        ("libelf" ,libelf)
+        ("zlib" ,zlib)))
+    (native-inputs
+      `(("bison" ,bison)
+        ("python" ,python-3)))
+    ; This tool does not have a proper web page.
+    (home-page "https://lwn.net/Articles/739357/")
+    (synopsis "Tool for inspection and simple manipulation of eBPF programs and maps")
+    (description "bpftool allows for inspection and simple modification of BPF
+objects on the system.")
+    (license (package-license linux-libre))))
-- 
2.31.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2
  2021-06-09  6:50   ` Ryan Sundberg via Guix-patches via
@ 2021-06-18 15:40     ` Ryan Sundberg via Guix-patches via
  0 siblings, 0 replies; 10+ messages in thread
From: Ryan Sundberg via Guix-patches via @ 2021-06-18 15:40 UTC (permalink / raw)
  To: 48889


[-- Attachment #1.1.1: Type: text/plain, Size: 2676 bytes --]

Hello Guix, here is one more version of this patch to add the bird
daemon. This time it builds both bird and bird6 individually for bird
version 1.x, since --enable-ipv6 is a mutually exclusive config
option,the binaries have to be built separately.



--
Sincerely,
Ryan Sundberg

On 6/8/21 11:50 PM, Ryan Sundberg via Guix-patches via wrote:
> Hi Maxime, thanks for the good feedback. Please see the revised patch here.
> 
> --
> Sincerely,
> Ryan Sundberg
> 
> On 6/7/21 2:35 AM, Maxime Devos wrote:
>> Hi,
>>
>> Ryan Sundberg via Guix-patches via schreef op zo 06-06-2021 om 11:52 [-0700]:
>>> Adds the bird BGP daemon to gnu/packages/bird.scm
>>
>> See commits (e.g. git log -n9) for how to format commit messages.
>>
>>> ---
>>>  gnu/packages/bird.scm | 74 +++++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 74 insertions(+)
>>>  create mode 100644 gnu/packages/bird.scm
>>>
>>> diff --git a/gnu/packages/bird.scm b/gnu/packages/bird.scm
>>> new file mode 100644
>>> index 0000000000..5fac395906
>>> --- /dev/null
>>> +++ b/gnu/packages/bird.scm
>>
>> Maybe gnu/packages/networking.scm, instead of creating a new
>> module for a single package.
>>
>>> +        #:phases (modify-phases %standard-phases
>>> +                                ; Fix "cc not found" in tools/mergedirs
>>> +                                (add-after 'bootstrap 'set-cc
>>> +                                           (lambda _ 
>>> +                                             (setenv "CPP" "gcc -E")
>>> +                                             #t)))))
>>
>> This most likely should be ,(string-append (cc-for-target) " -E"), to
>> make sure cross-compiling works. Also, the more declarative #:make-flags
>> is preferred above imperative setenv.
>>
>>> +    (inputs
>>> +      `(("autoconf" ,autoconf)
>>> +        ("bison" ,bison)
>>> +        ("flex" ,flex)
>>
>> autoconf, bison & flex most likely should be native inputs.
>>
>>> +        ("ncurses" ,ncurses)
>>> +        ("readline" ,readline)))
>>> +    (home-page "http://bird.network.cz/")
>>> +    (synopsis "BIRD Internet Routing Daemon")
>>> +    (description "The BIRD project aims to develop a dynamic IP routing daemon with full support of all modern routing protocols, easy to use 
configuration interface and powerful route filtering language, primarily targeted on (but not limited to) Linux and other UNIX-like systems and distributed under the GNU General Public License.")
>>> +    (license gpl2+)))
>>
>> The description line is too long.
>> ./pre-inst-env guix lint bird@1.6.7 should detect that.
>>
>> Greetings,
>> Maxime.
>>

[-- Attachment #1.1.2: 0001-gnu-Add-bird-versions-1.6.7-and-2.0.8.patch --]
[-- Type: text/x-patch, Size: 3524 bytes --]

From ed01b4254a54e43ce66d910c780b5a1ee885e243 Mon Sep 17 00:00:00 2001
From: Ryan Sundberg <ryan@arctype.co>
Date: Fri, 4 Jun 2021 20:53:11 -0700
Subject: [PATCH] gnu: Add bird versions 1.6.7 and 2.0.8

* gnu/packages/networking.scm (bird): New variable.
{bird-1}: New variable.
---
 gnu/packages/networking.scm | 63 +++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index f7357a263b..0c14331a5b 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -43,6 +43,7 @@
 ;;; Copyright © 2020 Hamzeh Nasajpour <h.nasajpour@pantherx.org>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4199,3 +4200,65 @@ IPv6 Internet connectivity - it also works over IPv4.")
      ;; version. This exception does not (and cannot) modify any license 
terms
      ;; which apply to the Application, with which you must still comply
      license:lgpl3)))
+
+(define configure-bird6
+  `(lambda* (#:key #:allow-other-keys #:rest args)
+     (let ((configure-phase (assoc-ref %standard-phases 'configure)))
+       (apply 
+         configure-phase 
+         (append args '(#:configure-flags ("--enable-ipv6")))))))
+
+(define-public bird-1
+  (package
+    (name "bird")
+    (version "1.6.7")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://gitlab.nic.cz/labs/bird.git")
+               (commit (string-append "v" version))))
+        (sha256 (base32 "0vbjp42c2zqmcrqcwm4g4fq1v93l6rlk0c27i0k08f3v07w75cih"))))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:tests? #f ;; No tests defined for bird 1
+        #:phases
+        (modify-phases
+          %standard-phases
+          ;; Fix "cc not found" in tools/mergedirs
+          (add-after 'bootstrap 'set-cc
+            (lambda _
+              (setenv "CPP" ,(string-append (cc-for-target) " -E"))))
+          ;; Build bird6 after building bird.
+          ;; bird6 and bird are configured independently.
+          (add-after 'install 'configure-bird6 ,configure-bird6)
+          (add-after 'configure-bird6 'build-bird6 
+                     (assoc-ref %standard-phases 'build))
+          (add-after 'build-bird6 'install-bird6 
+                     (assoc-ref %standard-phases 'install)))))
+    (inputs
+      `(("ncurses" ,ncurses)
+        ("readline" ,readline)))
+    (native-inputs
+      `(("autoconf" ,autoconf)
+        ("bison" ,bison)
+        ("flex" ,flex)))
+    (home-page "http://bird.network.cz/")
+    (synopsis "BIRD Internet Routing Daemon")
+    (description "The BIRD project aims to develop a dynamic IP routing daemon
+with full support of all modern routing protocols, easy to use configuration
+interface and powerful route filtering language.")
+    (license license:gpl2+)))
+
+(define-public bird
+  (package
+    (inherit bird-1)
+    (version "2.0.8")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://gitlab.nic.cz/labs/bird.git")
+               (commit (string-append "v" version))))
+        (sha256 (base32 "07mh41hsmkcpf6f6lnygzp6g59jma542pcqdkl54ysiqnjmi5zz1"))))
+    (arguments `())))
-- 
2.31.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-18 15:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06 18:52 [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Ryan Sundberg via Guix-patches via
2021-06-06 18:52 ` [bug#48889] [PATCH 2/4] Ceph: patch rbd to use $PATH lookups for modprobe Ryan Sundberg via Guix-patches via
2021-06-07  9:40   ` Maxime Devos
2021-06-06 18:52 ` [bug#48889] [PATCH 3/4] Ceph: upgrade minor version to latest stable release (14.2.21) Ryan Sundberg via Guix-patches via
2021-06-06 18:52 ` [bug#48889] [PATCH 4/4] bpftool: new package Ryan Sundberg via Guix-patches via
2021-06-07  9:50   ` Maxime Devos
2021-06-09  7:06     ` Ryan Sundberg via Guix-patches via
2021-06-07  9:35 ` [bug#48889] [PATCH 1/4] New package: bird bgp daemon, versions 1 and 2 Maxime Devos
2021-06-09  6:50   ` Ryan Sundberg via Guix-patches via
2021-06-18 15:40     ` Ryan Sundberg via Guix-patches via

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.