From f9c3893d220431af631aaf16f2df2ac538992eb8 Mon Sep 17 00:00:00 2001 From: Andrew Whatson Date: Fri, 20 Aug 2021 22:45:21 +1000 Subject: gnu: lxc: Update to 4.0.10. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/virtualization.scm (lxc): Update to 4.0.10. Signed-off-by: Ludovic Courtès --- gnu/packages/virtualization.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 675db49e5ce..588670b6d20 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1003,7 +1003,7 @@ all common programming languages. Vala bindings are also provided.") (define-public lxc (package (name "lxc") - (version "4.0.6") + (version "4.0.10") (source (origin (method url-fetch) (uri (string-append @@ -1011,7 +1011,7 @@ all common programming languages. Vala bindings are also provided.") version ".tar.gz")) (sha256 (base32 - "0qz4l7mlhq7hx53q606qgvkyzyr01glsw290v8ppzvxn1fydlrci")))) + "1sgsic9dzj3wv2k5bx2vhcgappivhp1glkqfc2yrgr6jas052351")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) -- cgit v1.3 From 9811a9d72556171218196709e8368b811407ee88 Mon Sep 17 00:00:00 2001 From: Andrew Whatson Date: Fri, 20 Aug 2021 22:45:22 +1000 Subject: gnu: lxcfs: Update to 4.0.9. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/virtualization.scm (lxcfs): Update to 4.0.9. Signed-off-by: Ludovic Courtès --- gnu/packages/virtualization.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 588670b6d20..c1c2044bd84 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1051,7 +1051,7 @@ manage system or application containers.") (define-public lxcfs (package (name "lxcfs") - (version "4.0.8") + (version "4.0.9") (home-page "https://github.com/lxc/lxcfs") (source (origin (method git-fetch) @@ -1060,7 +1060,7 @@ manage system or application containers.") (file-name (git-file-name name version)) (sha256 (base32 - "1f74wy88si2ia035pcvciq5821kc8jcb75w1f8vhbp0cd29rqdpi")))) + "0zx58lair8hwi4bxm5h7i8n1j5fcdgw5cr6f4wk9qhks0sr5dip5")))) (arguments '(#:configure-flags '("--localstatedir=/var"))) (native-inputs -- cgit v1.3 From 5edfa6d15e5bb92609ecff7e37e3985eced1dd4d Mon Sep 17 00:00:00 2001 From: Andrew Whatson Date: Fri, 20 Aug 2021 22:45:23 +1000 Subject: gnu: Add lxd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/virtualization.scm (lxd): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/virtualization.scm | 113 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index c1c2044bd84..f3b91cd83ab 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2021 Leo Famulari ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Dion Mendel +;;; Copyright © 2021 Andrew Whatson ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,6 +50,7 @@ #:use-module (gnu packages bison) #:use-module (gnu packages build-tools) #:use-module (gnu packages check) + #:use-module (gnu packages cluster) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages cross-base) @@ -102,6 +104,7 @@ #:use-module (gnu packages python-xyz) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages readline) + #:use-module (gnu packages rsync) #:use-module (gnu packages selinux) #:use-module (gnu packages sdl) #:use-module (gnu packages sphinx) @@ -1077,6 +1080,116 @@ of making Linux containers feel more like a virtual machine. It started as a side project of LXC but can be used by any run-time.") (license license:lgpl2.1+))) +(define-public lxd + (package + (name "lxd") + (version "4.17") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/lxc/lxd/releases/download/" + "lxd-" version "/lxd-" version ".tar.gz")) + (sha256 + (base32 + "1kzmgyg5kw3zw9qa6jabld6rmb53b6yy69h7y9znsdlf74jllljl")))) + (build-system go-build-system) + (arguments + `(#:import-path "github.com/lxc/lxd" + #:tests? #f ;; tests fail due to missing /var, cgroups, etc. + #:modules ((guix build go-build-system) + (guix build union) + (guix build utils) + (srfi srfi-1)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'unpack-dist + (lambda* (#:key import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + ;; remove the link back to the top level + (delete-file (string-append "_dist/src/" import-path)) + ;; move all the deps into the src directory + (copy-recursively "_dist/src" "../../..")) + #t)) + (replace 'build + (lambda* (#:key import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + (invoke "make" "build" "CC=gcc" "TAG_SQLITE3=libsqlite3") + #t))) + (replace 'check + (lambda* (#:key tests? import-path #:allow-other-keys) + (when tests? + (with-directory-excursion (string-append "src/" import-path) + (invoke "make" "check" "CC=gcc" "TAG_SQLITE3=libsqlite3"))) + #t)) + (replace 'install + (lambda* (#:key inputs outputs import-path #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin-dir + (string-append out "/bin/")) + (doc-dir + (string-append out "/share/doc/lxd-" ,version)) + (completions-dir + (string-append out "/share/bash-completion/completions"))) + (with-directory-excursion (string-append "src/" import-path) + ;; wrap lxd with runtime dependencies + (wrap-program (string-append bin-dir "lxd") + `("PATH" ":" prefix + ,(fold (lambda (input paths) + (let* ((in (assoc-ref inputs input)) + (bin (string-append in "/bin")) + (sbin (string-append in "/sbin"))) + (append (filter file-exists? + (list bin sbin)) paths))) + '() + '("bash" "acl" "rsync" "tar" "xz" "btrfs-progs" + "gzip" "dnsmasq" "squashfs-tools" "iproute2" + "criu" "iptables")))) + ;; remove unwanted binaries + (for-each (lambda (prog) + (delete-file (string-append bin-dir prog))) + '("deps" "macaroon-identity" "generate")) + ;; install documentation + (for-each (lambda (file) + (install-file file doc-dir)) + (find-files "doc")) + ;; install bash completion + (rename-file "scripts/bash/lxd-client" "scripts/bash/lxd") + (install-file "scripts/bash/lxd" completions-dir))) + #t))))) + (native-inputs + `(;; test dependencies: + ;; ("go-github-com-rogpeppe-godeps" ,go-github-com-rogpeppe-godeps) + ;; ("go-github-com-tsenart-deadcode" ,go-github-com-tsenart-deadcode) + ;; ("go-golang-org-x-lint" ,go-golang-org-x-lint) + ("pkg-config" ,pkg-config))) + (inputs + `(("acl" ,acl) + ("eudev" ,eudev) + ("libdqlite" ,libdqlite) + ("libraft" ,libraft) + ("libcap" ,libcap) + ("lxc" ,lxc) + ;; runtime dependencies: + ("bash" ,bash-minimal) + ("rsync" ,rsync) + ("tar" ,tar) + ("xz" ,xz) + ("btrfs-progs" ,btrfs-progs) + ("gzip" ,gzip) + ("dnsmasq" ,dnsmasq) + ("squashfs-tools" ,squashfs-tools) + ("iproute2" ,iproute) + ("criu" ,criu) + ("iptables" ,iptables))) + (synopsis "Daemon based on liblxc offering a REST API to manage containers") + (home-page "https://linuxcontainers.org/lxd/") + (description "LXD is a next generation system container manager. It +offers a user experience similar to virtual machines but using Linux +containers instead. It's image based with pre-made images available for a +wide number of Linux distributions and is built around a very powerful, yet +pretty simple, REST API.") + (license license:asl2.0))) + (define-public libvirt (package (name "libvirt") -- cgit v1.3 From 66df86a2733f763532b1569c48bf92c98835c4af Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Fri, 1 Oct 2021 17:59:00 -0400 Subject: gnu: Add libx86emu. * gnu/packages/virtualization.scm (libx86emu): New variable. Co-authored-by: Petr Hodina Co-authored-by: Vincent Legoll --- gnu/packages/virtualization.scm | 71 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index f3b91cd83ab..8a9da55e5fc 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -21,6 +21,9 @@ ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Dion Mendel ;;; Copyright © 2021 Andrew Whatson +;;; Copyright © 2021 Vincent Legoll +;;; Copyright © 2021 Petr Hodina +;;; Copyright © 2021 Raghav Gururajan ;;; ;;; This file is part of GNU Guix. ;;; @@ -437,6 +440,74 @@ server and embedded PowerPC, and S390 guests.") ((arch kernel) arch) (_ system)))))) +(define-public libx86emu + (package + (name "libx86emu") + (version "3.1") + (home-page "https://github.com/wfeldt/libx86emu") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url home-page) + (commit version))) + (file-name (git-file-name name version)) + (modules + '((guix build utils))) + (snippet + `(begin + ;; Remove git2log program file. + (delete-file "git2log") + ;; Remove variables that depends on git2log. + (substitute* "Makefile" + (("GIT2LOG.*=.*$") "") + (("GITDEPS.*=.*$") "") + (("BRANCH.*=.*$") "")) + #t)) + (sha256 + (base32 "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b")))) + (build-system gnu-build-system) + (arguments + `(#:test-target "test" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (include (string-append out "/include")) + (lib (string-append out "/lib"))) + ;; Correct the values of version and install directories. + (substitute* "Makefile" + (("VERSION.*=.*$") + (string-append "VERSION := " + ,version "\n")) + (("PREFIX.*=.*$") + (string-append "PREFIX := " out "\n")) + (("MAJOR_VERSION.*=.*$") + (string-append "MAJOR_VERSION := " + ,(version-major version) "\n")) + (("LIBDIR.*=.*$") + (string-append "LIBDIR = " lib "\n")) + (("/usr/include") include))))) + (delete 'configure)))) ; no configure script + (native-inputs + `(("nasm" ,nasm) + ("perl" ,perl))) + (synopsis "Library for x86 emulation") + (description "Libx86emu is a small library to emulate x86 instructions. The +focus here is not a complete emulation but to cover enough for typical +firmware blobs. You can +@enumerate +@item intercept any memory access or directly map real memory ranges +@item intercept any i/o access, map real i/o ports, or block any real i/o +@item intercept any interrupt +@item add a hook to run after each instruction +@item recognize a special x86 instruction that can trigger logging +@item use integrated logging +@end enumerate") + (license license:x11-style))) + (define-public ganeti (package (name "ganeti") -- cgit v1.3 From 53d67f46257693ff977658934483cc1c2da79969 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 4 Oct 2021 08:42:19 +0300 Subject: gnu: libx86emu: Adjust license field. * gnu/packages/virtualization.scm (libx86emu)[license]: Add text field pointing to license location. --- gnu/packages/virtualization.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 8a9da55e5fc..4c483663aa0 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020 Ludovic Courtès ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver -;;; Copyright © 2016, 2017, 2018. 2019, 2020 Efraim Flashner +;;; Copyright © 2016, 2017, 2018. 2019, 2020, 2021 Efraim Flashner ;;; Copyright © 2016, 2017 Ricardo Wurmus ;;; Copyright © 2017 Alex Vong ;;; Copyright © 2017 Andy Patterson @@ -506,7 +506,7 @@ firmware blobs. You can @item recognize a special x86 instruction that can trigger logging @item use integrated logging @end enumerate") - (license license:x11-style))) + (license (license:x11-style "file://LICENSE")))) (define-public ganeti (package -- cgit v1.3 From b4d02219da9c9d758db3d5ec83f45ad0c5b700ff Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 3 Oct 2021 23:32:03 +0200 Subject: gnu: criu: Update to 3.16. * gnu/packages/virtualization.scm (criu): Update to 3.16. [arguments]: Don't explicitly return #t from phases. --- gnu/packages/virtualization.scm | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 4c483663aa0..ca922ef410b 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1551,14 +1551,14 @@ domains, their live performance and resource utilization statistics.") (define-public criu (package (name "criu") - (version "3.15") + (version "3.16") (source (origin (method url-fetch) (uri (string-append "https://download.openvz.org/criu/criu-" version ".tar.bz2")) (sha256 (base32 - "09d0j24x0cyc7wkgi7cnxqgfjk7kbdlm79zxpj8d356sa3rw2z24")))) + "13x4s7nms3ckb016d03icdsrw4k6f7i33qz9n84fzhmibm0grj70")))) (build-system gnu-build-system) (arguments `(#:test-target "test" @@ -1579,8 +1579,7 @@ domains, their live performance and resource utilization statistics.") (setenv "C_INCLUDE_PATH" (string-append (assoc-ref inputs "libnl") "/include/libnl3:" - (or (getenv "C_INCLUDE_PATH") ""))) - #t)) + (or (getenv "C_INCLUDE_PATH") ""))))) (add-after 'configure 'fix-documentation (lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "Documentation/Makefile" @@ -1590,8 +1589,7 @@ domains, their live performance and resource utilization statistics.") (assoc-ref inputs "docbook-xsl") "/xml/xsl/" ,(package-name docbook-xsl) "-" ,(package-version docbook-xsl) - "/manpages/docbook.xsl"))) - #t)) + "/manpages/docbook.xsl"))))) (add-after 'unpack 'hardcode-variables (lambda* (#:key inputs #:allow-other-keys) ;; Hardcode arm version detection @@ -1603,8 +1601,7 @@ domains, their live performance and resource utilization statistics.") (substitute* "lib/Makefile" (("\\$\\(PYTHON\\)") (string-append (assoc-ref inputs "python") - "/bin/python"))) - #t)) + "/bin/python"))))) (add-before 'build 'fix-symlink (lambda* (#:key inputs #:allow-other-keys) ;; The file 'images/google/protobuf/descriptor.proto' points to @@ -1614,8 +1611,7 @@ domains, their live performance and resource utilization statistics.") (source (string-append (assoc-ref inputs "protobuf") "/include/" file))) (delete-file target) - (symlink source target) - #t))) + (symlink source target)))) (add-after 'install 'wrap (lambda* (#:key inputs outputs #:allow-other-keys) ;; Make sure 'crit' runs with the correct PYTHONPATH. @@ -1627,8 +1623,7 @@ domains, their live performance and resource utilization statistics.") "/site-packages:" (getenv "PYTHONPATH")))) (wrap-program (string-append out "/bin/crit") - `("PYTHONPATH" ":" prefix (,path)))) - #t))))) + `("PYTHONPATH" ":" prefix (,path))))))))) (inputs `(("protobuf" ,protobuf) ("python" ,python-2) -- cgit v1.3 From a47ce1e0e7d4c5aa3f954cb97f0c4cbb5a6039e2 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 3 Oct 2021 23:52:39 +0200 Subject: gnu: criu: Delete static libraries. * gnu/packages/virtualization.scm (criu)[arguments]: Add a new 'delete-static-libraries phase. --- gnu/packages/virtualization.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index ca922ef410b..5626eaab867 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1623,7 +1623,12 @@ domains, their live performance and resource utilization statistics.") "/site-packages:" (getenv "PYTHONPATH")))) (wrap-program (string-append out "/bin/crit") - `("PYTHONPATH" ":" prefix (,path))))))))) + `("PYTHONPATH" ":" prefix (,path)))))) + (add-after 'install 'delete-static-libraries + ;; Not building/installing these at all doesn't seem to be supported. + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each delete-file (find-files out "\\.a$")))))))) (inputs `(("protobuf" ,protobuf) ("python" ,python-2) -- cgit v1.3 From 814872d224ed7656c389c971ab0e216673871681 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 4 Oct 2021 00:56:24 +0200 Subject: gnu: osinfo-db: Update to 20210903. * gnu/packages/virtualization.scm (osinfo-db): Update to 20210903. [arguments]: Don't explicitly return #t from phases. --- gnu/packages/virtualization.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 5626eaab867..09f27461a9d 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -2264,14 +2264,14 @@ administrators and developers in managing the database.") (define-public osinfo-db (package (name "osinfo-db") - (version "20210809") + (version "20210903") (source (origin (method url-fetch) (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-" version ".tar.xz")) (sha256 (base32 - "16gas6ahxwim1vdjlc4p1gm6q5gfy25h82ngykcm94x69sl6qsan")))) + "0d08ffvwdzwr16gv7pz2r7brds5gciirz8ixs97s5ly03grd7rrh")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) @@ -2285,8 +2285,7 @@ administrators and developers in managing the database.") (string-append (assoc-ref %build-inputs "osinfo-db-tools") "/bin/osinfo-db-import"))) (mkdir-p osinfo-dir) - (invoke osinfo-db-import "--dir" osinfo-dir source) - #t)))) + (invoke osinfo-db-import "--dir" osinfo-dir source))))) (native-inputs `(("intltool" ,intltool) ("osinfo-db-tools" ,osinfo-db-tools))) -- cgit v1.3 From 93f69b02a290e0c82a4d166d84e1cbe056e6cc18 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 10 Oct 2021 13:54:07 +0200 Subject: gnu: ganeti: Update to 3.0.1. * gnu/packages/virtualization.scm (ganeti): Update to 3.0.1. [source](patches): Remove obsolete. * gnu/tests/ganeti.scm (%ganeti-os): Adjust network configuration so QEMU port forwarding can work. (run-ganeti-test): Remove unused port mapping. Adjust and enable previously failing test. * gnu/packages/patches/ganeti-deterministic-manual.patch, gnu/packages/patches/ganeti-drbd-compat.patch, gnu/packages/patches/ganeti-os-disk-size.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. --- gnu/local.mk | 3 - .../patches/ganeti-deterministic-manual.patch | 16 -- gnu/packages/patches/ganeti-drbd-compat.patch | 166 --------------------- gnu/packages/patches/ganeti-os-disk-size.patch | 17 --- gnu/packages/virtualization.scm | 9 +- gnu/tests/ganeti.scm | 33 ++-- 6 files changed, 19 insertions(+), 225 deletions(-) delete mode 100644 gnu/packages/patches/ganeti-deterministic-manual.patch delete mode 100644 gnu/packages/patches/ganeti-drbd-compat.patch delete mode 100644 gnu/packages/patches/ganeti-os-disk-size.patch (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 502f198c5e8..068cdb6730e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1063,11 +1063,8 @@ dist_patch_DATA = \ %D%/packages/patches/fuse-overlapping-headers.patch \ %D%/packages/patches/fxdiv-system-libraries.patch \ %D%/packages/patches/gajim-honour-GAJIM_PLUGIN_PATH.patch \ - %D%/packages/patches/ganeti-deterministic-manual.patch \ %D%/packages/patches/ganeti-disable-version-symlinks.patch \ - %D%/packages/patches/ganeti-drbd-compat.patch \ %D%/packages/patches/ganeti-haskell-pythondir.patch \ - %D%/packages/patches/ganeti-os-disk-size.patch \ %D%/packages/patches/ganeti-preserve-PYTHONPATH.patch \ %D%/packages/patches/ganeti-shepherd-master-failover.patch \ %D%/packages/patches/ganeti-shepherd-support.patch \ diff --git a/gnu/packages/patches/ganeti-deterministic-manual.patch b/gnu/packages/patches/ganeti-deterministic-manual.patch deleted file mode 100644 index 2d90aa740e7..00000000000 --- a/gnu/packages/patches/ganeti-deterministic-manual.patch +++ /dev/null @@ -1,16 +0,0 @@ -Sort the ecode list in the gnt-cluster manual for deterministic results. - -Submitted upstream: . - -diff --git a/lib/build/sphinx_ext.py b/lib/build/sphinx_ext.py ---- a/lib/build/sphinx_ext.py -+++ b/lib/build/sphinx_ext.py -@@ -108,7 +108,7 @@ CV_ECODES_DOC = "ecodes" - # pylint: disable=W0621 - CV_ECODES_DOC_LIST = [(name, doc) for (_, name, doc) in constants.CV_ALL_ECODES] - DOCUMENTED_CONSTANTS = { -- CV_ECODES_DOC: CV_ECODES_DOC_LIST, -+ CV_ECODES_DOC: sorted(CV_ECODES_DOC_LIST, key=lambda tup: tup[0]), - } - - diff --git a/gnu/packages/patches/ganeti-drbd-compat.patch b/gnu/packages/patches/ganeti-drbd-compat.patch deleted file mode 100644 index 32f46bc7edc..00000000000 --- a/gnu/packages/patches/ganeti-drbd-compat.patch +++ /dev/null @@ -1,166 +0,0 @@ -This patch adds support for newer versions of DRBD. - -Submitted upstream: . - -diff --git a/lib/storage/drbd.py b/lib/storage/drbd.py ---- a/lib/storage/drbd.py -+++ b/lib/storage/drbd.py -@@ -315,6 +315,13 @@ class DRBD8Dev(base.BlockDev): - """ - return self._show_info_cls.GetDevInfo(self._GetShowData(minor)) - -+ @staticmethod -+ def _NeedsLocalSyncerParams(): -+ # For DRBD >= 8.4, syncer init must be done after local, not in net. -+ info = DRBD8.GetProcInfo() -+ version = info.GetVersion() -+ return version["k_minor"] >= 4 -+ - def _MatchesLocal(self, info): - """Test if our local config matches with an existing device. - -@@ -397,6 +404,20 @@ class DRBD8Dev(base.BlockDev): - base.ThrowError("drbd%d: can't attach local disk: %s", - minor, result.output) - -+ def _WaitForMinorSyncParams(): -+ """Call _SetMinorSyncParams and raise RetryAgain on errors. -+ """ -+ if self._SetMinorSyncParams(minor, self.params): -+ raise utils.RetryAgain() -+ -+ if self._NeedsLocalSyncerParams(): -+ # Retry because disk config for DRBD resource may be still uninitialized. -+ try: -+ utils.Retry(_WaitForMinorSyncParams, 1.0, 5.0) -+ except utils.RetryTimeout as e: -+ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -+ (minor, utils.CommaJoin(e.args[0]))) -+ - def _AssembleNet(self, minor, net_info, dual_pri=False, hmac=None, - secret=None): - """Configure the network part of the device. -@@ -432,21 +453,24 @@ class DRBD8Dev(base.BlockDev): - # sync speed only after setting up both sides can race with DRBD - # connecting, hence we set it here before telling DRBD anything - # about its peer. -- sync_errors = self._SetMinorSyncParams(minor, self.params) -- if sync_errors: -- base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -- (minor, utils.CommaJoin(sync_errors))) -+ -+ if not self._NeedsLocalSyncerParams(): -+ sync_errors = self._SetMinorSyncParams(minor, self.params) -+ if sync_errors: -+ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -+ (minor, utils.CommaJoin(sync_errors))) - - family = self._GetNetFamily(minor, lhost, rhost) - -- cmd = self._cmd_gen.GenNetInitCmd(minor, family, lhost, lport, -+ cmds = self._cmd_gen.GenNetInitCmds(minor, family, lhost, lport, - rhost, rport, protocol, - dual_pri, hmac, secret, self.params) - -- result = utils.RunCmd(cmd) -- if result.failed: -- base.ThrowError("drbd%d: can't setup network: %s - %s", -- minor, result.fail_reason, result.output) -+ for cmd in cmds: -+ result = utils.RunCmd(cmd) -+ if result.failed: -+ base.ThrowError("drbd%d: can't setup network: %s - %s", -+ minor, result.fail_reason, result.output) - - def _CheckNetworkConfig(): - info = self._GetShowInfo(minor) -@@ -463,19 +487,20 @@ class DRBD8Dev(base.BlockDev): - base.ThrowError("drbd%d: timeout while configuring network", minor) - - # Once the assembly is over, try to set the synchronization parameters -- try: -- # The minor may not have been set yet, requiring us to set it at least -- # temporarily -- old_minor = self.minor -- self._SetFromMinor(minor) -- sync_errors = self.SetSyncParams(self.params) -- if sync_errors: -- base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -- (self.minor, utils.CommaJoin(sync_errors))) -- finally: -- # Undo the change, regardless of whether it will have to be done again -- # soon -- self._SetFromMinor(old_minor) -+ if not self._NeedsLocalSyncerParams(): -+ try: -+ # The minor may not have been set yet, requiring us to set it at least -+ # temporarily -+ old_minor = self.minor -+ self._SetFromMinor(minor) -+ sync_errors = self.SetSyncParams(self.params) -+ if sync_errors: -+ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % -+ (self.minor, utils.CommaJoin(sync_errors))) -+ finally: -+ # Undo the change, regardless of whether it will have to be done again -+ # soon -+ self._SetFromMinor(old_minor) - - @staticmethod - def _GetNetFamily(minor, lhost, rhost): -diff --git a/lib/storage/drbd_cmdgen.py b/lib/storage/drbd_cmdgen.py ---- a/lib/storage/drbd_cmdgen.py -+++ b/lib/storage/drbd_cmdgen.py -@@ -56,7 +56,7 @@ class BaseDRBDCmdGenerator(object): - def GenLocalInitCmds(self, minor, data_dev, meta_dev, size_mb, params): - raise NotImplementedError - -- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, -+ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, - dual_pri, hmac, secret, params): - raise NotImplementedError - -@@ -138,7 +138,7 @@ class DRBD83CmdGenerator(BaseDRBDCmdGenerator): - - return [args] - -- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, -+ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, - dual_pri, hmac, secret, params): - args = ["drbdsetup", self._DevPath(minor), "net", - "%s:%s:%s" % (family, lhost, lport), -@@ -155,7 +155,7 @@ class DRBD83CmdGenerator(BaseDRBDCmdGenerator): - if params[constants.LDP_NET_CUSTOM]: - args.extend(shlex.split(params[constants.LDP_NET_CUSTOM])) - -- return args -+ return [args] - - def GenSyncParamsCmd(self, minor, params): - args = ["drbdsetup", self._DevPath(minor), "syncer"] -@@ -345,8 +345,14 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator): - - return cmds - -- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, -+ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, - dual_pri, hmac, secret, params): -+ cmds = [] -+ -+ cmds.append(["drbdsetup", "new-resource", self._GetResource(minor)]) -+ cmds.append(["drbdsetup", "new-minor", self._GetResource(minor), -+ str(minor), "0"]) -+ - args = ["drbdsetup", "connect", self._GetResource(minor), - "%s:%s:%s" % (family, lhost, lport), - "%s:%s:%s" % (family, rhost, rport), -@@ -362,7 +368,8 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator): - if params[constants.LDP_NET_CUSTOM]: - args.extend(shlex.split(params[constants.LDP_NET_CUSTOM])) - -- return args -+ cmds.append(args) -+ return cmds - - def GenSyncParamsCmd(self, minor, params): - args = ["drbdsetup", "disk-options", minor] diff --git a/gnu/packages/patches/ganeti-os-disk-size.patch b/gnu/packages/patches/ganeti-os-disk-size.patch deleted file mode 100644 index 16b1d7615c1..00000000000 --- a/gnu/packages/patches/ganeti-os-disk-size.patch +++ /dev/null @@ -1,17 +0,0 @@ -This exposes information about disk sizes to OS install scripts. instance-guix -uses this if available to determine the size of the VM image. - -Submitted upstream: -https://github.com/ganeti/ganeti/pull/1503 - -diff --git a/lib/backend.py b/lib/backend.py ---- a/lib/backend.py -+++ b/lib/backend.py -@@ -4305,6 +4305,7 @@ def OSEnvironment(instance, inst_os, debug=0): - uri = _CalculateDeviceURI(instance, disk, real_disk) - result["DISK_%d_ACCESS" % idx] = disk.mode - result["DISK_%d_UUID" % idx] = disk.uuid -+ result["DISK_%d_SIZE" % idx] = str(disk.size) - if real_disk.dev_path: - result["DISK_%d_PATH" % idx] = real_disk.dev_path - if uri: diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 09f27461a9d..65f611736d4 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -14,7 +14,7 @@ ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2020 Mathieu Othacehe -;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2020 Brett Gilio ;;; Copyright © 2021 Leo Famulari @@ -513,20 +513,17 @@ firmware blobs. You can (name "ganeti") ;; Note: we use a pre-release for Python 3 compatibility as well as many ;; other fixes. - (version "3.0.0beta1-24-g024cc9fa2") + (version "3.0.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ganeti/ganeti") (commit (string-append "v" version)))) (sha256 - (base32 "1ll34qd2mifni3bhg7cnir3xfnkafig8ch33qndqwrsby0y5ssia")) + (base32 "1i7gx0sdx9316fnldbv738s0ihym1370nhc1chk0biandkl8vvq0")) (file-name (git-file-name name version)) (patches (search-patches "ganeti-shepherd-support.patch" "ganeti-shepherd-master-failover.patch" - "ganeti-deterministic-manual.patch" - "ganeti-drbd-compat.patch" - "ganeti-os-disk-size.patch" "ganeti-haskell-pythondir.patch" "ganeti-disable-version-symlinks.patch" "ganeti-preserve-PYTHONPATH.patch")))) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index b64a332dde6..5ac2fd48dd6 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2020 Marius Bakke . +;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. @@ -52,17 +52,17 @@ (hosts-file (plain-file "hosts" (format #f " 127.0.0.1 localhost ::1 localhost -10.0.2.2 gnt1.example.com gnt1 +10.0.2.15 gnt1.example.com gnt1 192.168.254.254 ganeti.example.com "))) (packages (append (list ganeti-instance-debootstrap ganeti-instance-guix) %base-packages)) (services - (append (list (static-networking-service "eth0" "10.0.2.2" + (append (list (static-networking-service "eth0" "10.0.2.15" #:netmask "255.255.255.0" - #:gateway "10.0.2.1" - #:name-servers '("10.0.2.1")) + #:gateway "10.0.2.2" + #:name-servers '("10.0.2.3")) (service openssh-service-type (openssh-configuration @@ -83,8 +83,7 @@ (master-netdev "eth0") (hvparams '()) (extra-packages '()) - (rapi-port 5080) - (noded-port 1811)) + (rapi-port 5080)) "Run tests in %GANETI-OS." (define os (marionette-operating-system @@ -96,7 +95,6 @@ (guix combinators)))) (define %forwarded-rapi-port 5080) - (define %forwarded-noded-port 1811) (define vm (virtual-machine @@ -104,14 +102,14 @@ ;; Some of the daemons are fairly memory-hungry. (memory-size 512) ;; Forward HTTP ports so we can access them from the "outside". - (port-forwardings `((,%forwarded-rapi-port . ,rapi-port) - (,%forwarded-noded-port . ,noded-port))))) + (port-forwardings `((,%forwarded-rapi-port . ,rapi-port))))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (srfi srfi-11) (srfi srfi-64) (web uri) (web client) (web response) + (ice-9 iconv) (gnu build marionette)) (define marionette @@ -213,18 +211,19 @@ "watcher" "continue")) marionette)) - ;; Try accessing the RAPI. This causes an expected failure: - ;; https://github.com/ganeti/ganeti/issues/1502 - ;; Run it anyway for easy testing of potential fixes. + ;; Try accessing the RAPI. (test-equal "http-get RAPI version" - '(200 "2") + '(200 "2\n") (let-values (((response text) (http-get #$(simple-format #f "http://localhost:~A/version" %forwarded-rapi-port) - #:decode-body? #t))) - (list (response-code response) text))) + #:decode-body? #f))) + (list (response-code response) + ;; The API response lacks a content-type, so + ;; (http-client) won't decode it for us. + (bytevector->string text "UTF-8")))) (test-equal "gnt-os list" "debootstrap+default\nguix+default\n" @@ -249,7 +248,7 @@ marionette)) (test-end) - (exit (= (test-runner-fail-count (test-runner-current)) 1))))) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) (gexp->derivation (string-append "ganeti-" hypervisor "-test") test)) -- cgit v1.3 From 0105f33a4ddd7d3ef3d66bd16e16595dd500d404 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 11 Oct 2021 21:23:53 +0200 Subject: gnu: ganeti: Adjust to GHC 8.10 / Stackage 18.10. * gnu/packages/patches/ganeti-haskell-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/virtualization.scm (ganeti)[source](patches): Add it. [arguments]: Add phase patch-version-constraints. --- gnu/local.mk | 1 + gnu/packages/patches/ganeti-haskell-compat.patch | 18 ++++++++++++++++++ gnu/packages/virtualization.scm | 9 +++++++++ 3 files changed, 28 insertions(+) create mode 100644 gnu/packages/patches/ganeti-haskell-compat.patch (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 068cdb6730e..34218ec8ce4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1064,6 +1064,7 @@ dist_patch_DATA = \ %D%/packages/patches/fxdiv-system-libraries.patch \ %D%/packages/patches/gajim-honour-GAJIM_PLUGIN_PATH.patch \ %D%/packages/patches/ganeti-disable-version-symlinks.patch \ + %D%/packages/patches/ganeti-haskell-compat.patch \ %D%/packages/patches/ganeti-haskell-pythondir.patch \ %D%/packages/patches/ganeti-preserve-PYTHONPATH.patch \ %D%/packages/patches/ganeti-shepherd-master-failover.patch \ diff --git a/gnu/packages/patches/ganeti-haskell-compat.patch b/gnu/packages/patches/ganeti-haskell-compat.patch new file mode 100644 index 00000000000..931c50e1167 --- /dev/null +++ b/gnu/packages/patches/ganeti-haskell-compat.patch @@ -0,0 +1,18 @@ +Adjust to type change of TupE in Template Haskell 2.16. + +diff --git a/src/Ganeti/THH/Types.hs b/src/Ganeti/THH/Types.hs +--- a/src/Ganeti/THH/Types.hs ++++ b/src/Ganeti/THH/Types.hs +@@ -123,4 +123,11 @@ curryN n = do + f <- newName "f" + ps <- replicateM n (newName "x") + return $ LamE (VarP f : map VarP ps) +- (AppE (VarE f) (TupE $ map VarE ps)) ++ (AppE (VarE f) (nonUnaryTupE $ map VarE ps)) ++ where ++ nonUnaryTupE :: [Exp] -> Exp ++ nonUnaryTupE es = TupE $ ++#if MIN_VERSION_template_haskell(2,16,0) ++ map Just ++#endif ++ es diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 65f611736d4..e5da1b5c2c2 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -524,6 +524,7 @@ firmware blobs. You can (file-name (git-file-name name version)) (patches (search-patches "ganeti-shepherd-support.patch" "ganeti-shepherd-master-failover.patch" + "ganeti-haskell-compat.patch" "ganeti-haskell-pythondir.patch" "ganeti-disable-version-symlinks.patch" "ganeti-preserve-PYTHONPATH.patch")))) @@ -573,6 +574,14 @@ firmware blobs. You can ,(system->qemu-target (%current-system)))) #:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-version-constraints + (lambda _ + ;; Loosen version constraints for compatibility with Stackage 18.10. + (substitute* "cabal/ganeti.template.cabal" + (("(.*base64-bytestring.*) < 1\\.1" _ match) + (string-append match " < 1.2")) + (("(.*QuickCheck.*) < 2\\.14" _ match) + (string-append match " < 2.15"))))) (add-after 'unpack 'create-vcs-version (lambda _ ;; If we are building from a git checkout, we need to create a -- cgit v1.3