summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <marius.andre.bakke@gmail.com>2026-08-09 07:16:07 +0200
committerAndreas Enge <andreas@enge.fr>2026-08-25 11:37:31 +0200
commit52947daef0c03b60424b6cc8a5e8ccacdb1e1799 (patch)
tree8dbbb479fe69b02c0219e947b7c5cd7e6b4634f3 /gnu
parent2501761ace45b097510bdef99165d7148d1e4414 (diff)
gnu: ganeti: Fix build.
* gnu/packages/virtualization.scm (ganeti)[arguments]<#:phases>: Restore the 'setup-compiler and 'do-not-use-GHC_PACKAGE_PATH phases that were removed in 4fca464f917d4. This is necessary because of a GHC regression, see #10438. While at it, re-enable Python unittests (and disable some that don't work) by ... [native-inputs]: ... adding python-pytest. Also remove python-mock, which is no longer required. And remove an obsolete comment. Signed-off-by: Andreas Enge <andreas@enge.fr>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/virtualization.scm49
1 files changed, 44 insertions, 5 deletions
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 6501491151d..f87073e38ee 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -14,7 +14,7 @@
14;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> 14;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
15;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re> 15;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
16;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com> 16;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
17;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org> 17;;; Copyright © 2020, 2021, 2022, 2026 Marius Bakke <marius@gnu.org>
18;;; Copyright © 2020-2026 Maxim Cournoyer <maxim@guixotic.coop> 18;;; Copyright © 2020-2026 Maxim Cournoyer <maxim@guixotic.coop>
19;;; Copyright © 2020 Brett Gilio <brettg@gnu.org> 19;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
20;;; Copyright © 2021 Leo Famulari <leo@famulari.name> 20;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
@@ -184,6 +184,7 @@
184 #:use-module (guix build-system cmake) 184 #:use-module (guix build-system cmake)
185 #:use-module (guix build-system gnu) 185 #:use-module (guix build-system gnu)
186 #:use-module (guix build-system go) 186 #:use-module (guix build-system go)
187 #:use-module (guix build-system haskell)
187 #:use-module (guix build-system meson) 188 #:use-module (guix build-system meson)
188 #:use-module (guix build-system pyproject) 189 #:use-module (guix build-system pyproject)
189 #:use-module (guix build-system ruby) 190 #:use-module (guix build-system ruby)
@@ -854,8 +855,10 @@ firmware blobs. You can
854 (build-system gnu-build-system) 855 (build-system gnu-build-system)
855 (arguments 856 (arguments
856 (list 857 (list
857 #:imported-modules %pyproject-build-system-modules 858 #:imported-modules `(,@%pyproject-build-system-modules
859 ,@%haskell-build-system-modules)
858 #:modules `(,@%default-gnu-modules 860 #:modules `(,@%default-gnu-modules
861 ((guix build haskell-build-system) #:prefix haskell:)
859 ((guix build pyproject-build-system) #:select (site-packages)) 862 ((guix build pyproject-build-system) #:select (site-packages))
860 (srfi srfi-1) 863 (srfi srfi-1)
861 (srfi srfi-26) 864 (srfi srfi-26)
@@ -951,6 +954,35 @@ firmware blobs. You can
951 (("\\$SPHINX --version 2>&1") 954 (("\\$SPHINX --version 2>&1")
952 "$SPHINX --version 2>&1 \ 955 "$SPHINX --version 2>&1 \
953| sed 's/.sphinx-build-real/sphinx-build/g'")))) 956| sed 's/.sphinx-build-real/sphinx-build/g'"))))
957 ;; The build system invokes Cabal and GHC, which do not work with
958 ;; GHC_PACKAGE_PATH: <https://github.com/haskell/cabal/issues/3728>.
959 ;; Tweak the build system to do roughly what haskell-build-system does.
960 (add-before 'configure 'configure-haskell
961 (lambda* (#:key system inputs outputs #:allow-other-keys)
962 ((assoc-ref haskell:%standard-phases 'setup-compiler)
963 #:system system
964 ;; The phase expects the GHC input to be named "haskell".
965 ;; TODO(haskell-team): Both this and the next phase can be
966 ;; removed when #10184 is merged.
967 #:inputs `(("haskell" . ,(assoc-ref inputs "ghc")) ,@inputs)
968 #:outputs outputs)))
969 (add-after 'configure 'do-not-use-GHC_PACKAGE_PATH
970 (lambda _
971 ;; The temporary package database populated by the
972 ;; 'configure-haskell' phase above.
973 (let ((package-db (string-append (or (getenv "TMP") "/tmp")
974 "/package.conf.d")))
975 (unsetenv "GHC_PACKAGE_PATH")
976 (substitute* "Makefile"
977 ;; Patch Cabal and GHC invocations to include -package-db.
978 (("^CABAL_SETUP = runhaskell")
979 (string-append "CABAL_SETUP = runhaskell -package-db="
980 package-db))
981 (("\\$\\(CABAL_SETUP\\) configure")
982 (string-append "$(CABAL_SETUP) configure --package-db="
983 package-db))
984 (("\\$\\(GHC\\)")
985 (string-append "$(GHC) -package-db=" package-db))))))
954 (add-after 'configure 'make-ghc-use-shared-libraries 986 (add-after 'configure 'make-ghc-use-shared-libraries
955 (lambda _ 987 (lambda _
956 (substitute* "Makefile" 988 (substitute* "Makefile"
@@ -970,6 +1002,15 @@ firmware blobs. You can
970 ;; Disable tests that can not run. Do it early to prevent 1002 ;; Disable tests that can not run. Do it early to prevent
971 ;; touching the Makefile later and triggering a needless rebuild. 1003 ;; touching the Makefile later and triggering a needless rebuild.
972 (substitute* "Makefile" 1004 (substitute* "Makefile"
1005 ;; These tests expect the presence of a 'root' user (via
1006 ;; ganeti/runtime.py), which fails in the build environment.
1007 (("test/py/legacy/ganeti\\.asyncnotifier_unittest\\.py") "")
1008 (("test/py/legacy/ganeti\\.backend_unittest\\.py") "")
1009 (("test/py/legacy/ganeti\\.backend_unittest-runasroot\\.py") "")
1010 (("test/py/legacy/ganeti\\.daemon_unittest\\.py") "")
1011 (("test/py/legacy/ganeti\\.hypervisor\\.hv_kvm_unittest\\.py") "")
1012 (("test/py/legacy/ganeti\\.tools\\.ensure_dirs_unittest\\.py") "")
1013 (("test/py/legacy/ganeti\\.utils\\.io_unittest-runasroot\\.py") "")
973 ;; Disable the bash_completion test, as it requires the full 1014 ;; Disable the bash_completion test, as it requires the full
974 ;; bash instead of bash-minimal. 1015 ;; bash instead of bash-minimal.
975 (("test/py/legacy/bash_completion\\.bash") 1016 (("test/py/legacy/bash_completion\\.bash")
@@ -1073,8 +1114,6 @@ firmware blobs. You can
1073 (list ghc 1114 (list ghc
1074 cabal-install 1115 cabal-install
1075 m4 1116 m4
1076 ;; These inputs are necessary to bootstrap the package, because we
1077 ;; have patched the build system.
1078 autoconf 1117 autoconf
1079 automake 1118 automake
1080 1119
@@ -1090,7 +1129,7 @@ firmware blobs. You can
1090 ghc-test-framework 1129 ghc-test-framework
1091 ghc-test-framework-hunit 1130 ghc-test-framework-hunit
1092 ghc-test-framework-quickcheck2 1131 ghc-test-framework-quickcheck2
1093 python-mock 1132 python-pytest
1094 python-pyyaml 1133 python-pyyaml
1095 openssh 1134 openssh
1096 procps 1135 procps