all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#45014] QEMU 5.2.0 update - functions properly but still work in progress
@ 2020-12-02 18:23 Leo Famulari
  2021-02-27  4:08 ` Leo Famulari
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Famulari @ 2020-12-02 18:23 UTC (permalink / raw)
  To: 45014


[-- Attachment #1.1: Type: text/plain, Size: 1696 bytes --]

Here is a patch that updates QEMU to 5.2.0-rc4.

The big change here is that the build system has changed to use Meson
and Ninja "under the hood", although this release still uses
`./configure && make` in a superficial way.

With this patch, the qemu and qemu-minimal packages build and can boot
Guix VMs created with the `guix system` commands.

There are still two open tasks that require assistance:

1) The patch that makes Sphinx build an info manual will need to be
adapted to the meson build system. Ideally, this would be submitted
upstream.

2) The ./configure step is considered "stale" in the build phase and
thus gets run twice. You can add "--trace" to #:make-flags to trace the
Makefile and try to understand what's wrong (shown below). I'm no Make
expert but, AFAICT, there are some PHONY targets that depend on the
output of the configure step, config-host.mak, so it may be an upstream
bug. But I might be misunderstanding it. I asked on the QEMU IRC but
didn't get a useful answer.

------
starting phase `build'
GNUmakefile:10: update target 'all' due to: force
echo 'changing dir to build for make ""...'
changing dir to build for make ""...
make -C build -f Makefile 
make[1]: Entering directory '/tmp/guix-build-qemu-minimal-5.2.0-rc4.drv-0/qemu-5.2.0-rc4/build'
Makefile:109: update target 'config-host.mak' due to: /tmp/guix-build-qemu-minimal-5.2.0-rc4.drv-0/qemu-5.2.0-rc4/pc-bios
echo config-host.mak is out-of-date, running configure
config-host.mak is out-of-date, running configure
if test -f meson-private/coredata.dat; then \
  ./config.status --skip-meson; \
else \
  ./config.status && touch build.ninja.stamp; \
fi
------

[-- Attachment #1.2: 0001-WIP-QEMU-Update-to-5.2.0-rc4.patch --]
[-- Type: text/plain, Size: 5363 bytes --]

From 37e261512f5b3a3e7544c31d2b001d71c547d08c Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Sat, 28 Nov 2020 00:33:13 -0500
Subject: [PATCH] WIP: QEMU: Update to 5.2.0-rc4.

* gnu/packages/virtualization.scm (qemu): Update to 5.2.0-rc4.
[source]: TODO Update patch building the info manual.
[arguments]: Adjust the 'disable-unusable-tests' for the new Meson build
system. Generalize the 'patch-/bin/sh-references' into a 'patch-paths' phase,
and move an instance of path patching into it from the 'configure' phase.
[native-inputs]: Add ninja.
* gnu/packages/patches/qemu-build-info-manual.patch: Adjust to 5.2.0-rc4.
---
 gnu/packages/virtualization.scm | 34 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 466e9d1ac5..e2b2508efa 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -80,6 +80,7 @@
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages nettle)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages ninja)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages package-management)
   #:use-module (gnu packages perl)
@@ -132,15 +133,16 @@
 (define-public qemu
   (package
     (name "qemu")
-    (version "5.1.0")
+    (version "5.2.0-rc4")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://download.qemu.org/qemu-"
                                   version ".tar.xz"))
               (sha256
                (base32
-                "1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9"))
-              (patches (search-patches "qemu-build-info-manual.patch"))))
+                "10xsnw9sscknb6abd4h45k6gjzhqpdrvk9h8djbh7y1vh1zg76i9"))
+;              (patches (search-patches "qemu-build-info-manual.patch"))
+))
     (outputs '("out" "doc"))            ;4.7 MiB of HTML docs
     (build-system gnu-build-system)
     (arguments
@@ -188,30 +190,28 @@
                 (string-append match "9")))))
          (add-after 'unpack 'disable-unusable-tests
            (lambda _
-             (substitute* "tests/Makefile.include"
+             (substitute* "tests/meson.build"
                ;; Comment out the test-qga test, which needs /sys and
                ;; fails within the build environment.
-               (("check-unit-.* tests/test-qga" all)
+               (("tests.*test-qga.*$" all)
                 (string-append "# " all))
                ;; Comment out the test-char test, which needs networking and
                ;; fails within the build environment.
-               (("check-unit-.* tests/test-char" all)
-                (string-append "# " all)))
-             (substitute* "tests/qtest/Makefile.include"
-               ;; Disable the following test, which triggers a crash on some
-               ;; x86 CPUs (see https://issues.guix.info/43048 and
-               ;; https://bugs.launchpad.net/qemu/+bug/1896263).
-               (("check-qtest-i386-y \\+= bios-tables-test" all)
+               (("'test-char':.*$" all)
                 (string-append "# " all)))
              #t))
-         (add-after 'patch-source-shebangs 'patch-/bin/sh-references
+         (add-after 'patch-source-shebangs 'patch-embedded-shebangs
            (lambda _
              ;; Ensure the executables created by these source files reference
              ;; /bin/sh from the store so they work inside the build container.
              (substitute* '("block/cloop.c" "migration/exec.c"
                             "net/tap.c" "tests/qtest/libqtest.c")
                (("/bin/sh") (which "sh")))
+             (substitute* "tests/qemu-iotests/check"
+               (("#!/usr/bin/env python3")
+                (string-append "#!" (which "python3"))))
              #t))
+         ;; XXX ./configure is being re-run at beginning of build phase...
          (replace 'configure
            (lambda* (#:key inputs outputs (configure-flags '())
                      #:allow-other-keys)
@@ -220,14 +220,9 @@
              (let ((out (assoc-ref outputs "out")))
                (setenv "SHELL" (which "bash"))
 
-               ;; While we're at it, patch for tests.
-               (substitute* "tests/qemu-iotests/check"
-                 (("#!/usr/bin/env python3")
-                  (string-append "#!" (which "python3"))))
-
                ;; Ensure config.status gets the correct shebang off the bat.
                ;; The build system gets confused if we change it later and
-               ;; attempts to re-run the whole configury, and fails.
+               ;; attempts to re-run the whole configuration, and fails.
                (substitute* "configure"
                  (("#!/bin/sh")
                   (string-append "#!" (which "sh"))))
@@ -302,6 +297,7 @@ exec smbd $@")))
                      ("pkg-config" ,pkg-config)
                      ("python-wrapper" ,python-wrapper)
                      ("python-sphinx" ,python-sphinx)
+                     ("ninja" ,ninja)
                      ("texinfo" ,texinfo)))
     (home-page "https://www.qemu.org")
     (synopsis "Machine emulator and virtualizer")
-- 
2.29.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [bug#45014] QEMU 5.2.0 update - functions properly but still work in progress
  2020-12-02 18:23 [bug#45014] QEMU 5.2.0 update - functions properly but still work in progress Leo Famulari
@ 2021-02-27  4:08 ` Leo Famulari
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Famulari @ 2021-02-27  4:08 UTC (permalink / raw)
  To: 45014; +Cc: Maxim Cournoyer


[-- Attachment #1.1: Type: text/plain, Size: 122 bytes --]

Here is a new revision of this patch.

It updates QEMU to the final 5.2.0 release, rather than using a release
candidate.

[-- Attachment #1.2: 0001-gnu-QEMU-Update-to-5.2.0.patch --]
[-- Type: text/plain, Size: 12389 bytes --]

From 8fdecf103773af436ce636556ee94604e5d94939 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Sat, 28 Nov 2020 00:33:13 -0500
Subject: [PATCH] gnu: QEMU: Update to 5.2.0.

* gnu/packages/virtualization.scm (qemu): Update to 5.2.0.
[source]: Remove 'qemu-build-info-manual' and don't build an info manual.
[arguments]: Adjust the 'disable-unusable-tests' for the new Meson build
system. Generalize the 'patch-/bin/sh-references' into a 'patch-paths' phase,
and move an instance of path patching into it from the 'configure' phase.
[native-inputs]: Add ninja.
* gnu/packages/patches/qemu-build-info-manual.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Remove it.
---
 gnu/local.mk                                  |   1 -
 .../patches/qemu-build-info-manual.patch      | 139 ------------------
 gnu/packages/virtualization.scm               |  38 ++---
 3 files changed, 16 insertions(+), 162 deletions(-)
 delete mode 100644 gnu/packages/patches/qemu-build-info-manual.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8d1465158a..2c2c859ee0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1560,7 +1560,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-unittest2-remove-argparse.patch	\
   %D%/packages/patches/python-waitress-fix-tests.patch		\
   %D%/packages/patches/pypy3-7.3.1-fix-tests.patch		\
-  %D%/packages/patches/qemu-build-info-manual.patch		\
   %D%/packages/patches/qemu-glibc-2.27.patch 			\
   %D%/packages/patches/qpdfview-qt515-compat.patch		\
   %D%/packages/patches/qrcodegen-cpp-make-install.patch		\
diff --git a/gnu/packages/patches/qemu-build-info-manual.patch b/gnu/packages/patches/qemu-build-info-manual.patch
deleted file mode 100644
index d57b26ea00..0000000000
--- a/gnu/packages/patches/qemu-build-info-manual.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 07303a0a4daa83a0555ac4abad7a5d65584307ad Mon Sep 17 00:00:00 2001
-From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
-Date: Thu, 17 Sep 2020 13:28:19 -0400
-Subject: [PATCH] build: Build and install the info manual.
-
-Take advantage of the Sphinx texinfo backend to generate a QEMU info
-manual.  The texinfo format allows for more structure and info readers
-provide more advanced navigation capabilities compared to manpages
-readers.
-
-* configure (infodir): Add the --infodir option, which allows
-configuring the directory under which the info manuals are installed.
-* docs/index.rst: Include the top level documents to prevent
-warnings (treated as errors by sphinx-build).
-* Makefile (sphinxdocs-info, $(MANUAL_BUILDDIR)/QEMU.texi)): New targets.
-(info): Depend on sphinxdocs-info.
-(install-doc): Install the info manual.
----
- Makefile       | 13 +++++++++++--
- configure      |  7 +++++++
- docs/index.rst |  2 ++
- 3 files changed, 20 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 13dd708c..da78612d 100644
---- a/Makefile
-+++ b/Makefile
-@@ -864,12 +864,14 @@ endef
- # Note that we deliberately do not install the "devel" manual: it is
- # for QEMU developers, and not interesting to our users.
- .PHONY: install-sphinxdocs
--install-sphinxdocs: sphinxdocs
-+install-sphinxdocs: sphinxdocs sphinxdocs-info
- 	$(call install-manual,interop)
- 	$(call install-manual,specs)
- 	$(call install-manual,system)
- 	$(call install-manual,tools)
- 	$(call install-manual,user)
-+	$(INSTALL_DIR) "$(DESTDIR)$(infodir)"
-+	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/QEMU.info "$(DESTDIR)$(infodir)"
- 
- install-doc: $(DOCS) install-sphinxdocs
- 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
-@@ -1067,6 +1069,13 @@ sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \
-             $(MANUAL_BUILDDIR)/tools/index.html \
-             $(MANUAL_BUILDDIR)/user/index.html
- 
-+# Build the complete info manual.
-+.PHONE: sphinxdocs-info
-+sphinxdocs-info: $(MANUAL_BUILDDIR)/QEMU.info
-+
-+$(MANUAL_BUILDDIR)/QEMU.texi: $(call manual-deps,*) $(wildcard $(SRC_PATH)/docs/*.rst)
-+	$(call build-manual,,texinfo)
-+
- # Canned command to build a single manual
- # Arguments: $1 = manual name, $2 = Sphinx builder ('html' or 'man')
- # Note the use of different doctree for each (manual, builder) tuple;
-@@ -1126,7 +1135,7 @@ docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi-doc.texi
- 	@cp -p $< $@
- 
- html: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs
--info: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info
-+info: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info sphinxdocs-info
- pdf: docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
- txt: docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
- 
-diff --git a/configure b/configure
-index 2acc4d14..3691bd2e 100755
---- a/configure
-+++ b/configure
-@@ -415,6 +415,7 @@ LDFLAGS_SHARED="-shared"
- modules="no"
- module_upgrades="no"
- prefix="/usr/local"
-+infodir="\${prefix}/share/info"
- mandir="\${prefix}/share/man"
- datadir="\${prefix}/share"
- firmwarepath="\${prefix}/share/qemu-firmware"
-@@ -987,6 +988,7 @@ if test "$mingw32" = "yes" ; then
-     LIBS="-liberty $LIBS"
-   fi
-   prefix="c:/Program Files/QEMU"
-+  infodir="\${prefix}"
-   mandir="\${prefix}"
-   datadir="\${prefix}"
-   qemu_docdir="\${prefix}"
-@@ -1087,6 +1089,8 @@ for opt do
-     static="yes"
-     QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
-   ;;
-+  --infodir=*) infodir="$optarg"
-+  ;;
-   --mandir=*) mandir="$optarg"
-   ;;
-   --bindir=*) bindir="$optarg"
-@@ -1780,6 +1784,7 @@ Advanced options (experts only):
-   --smbd=SMBD              use specified smbd [$smbd]
-   --with-git=GIT           use specified git [$git]
-   --static                 enable static build [$static]
-+  --infodir=PATH           install info manual in PATH
-   --mandir=PATH            install man pages in PATH
-   --datadir=PATH           install firmware in PATH$confsuffix
-   --docdir=PATH            install documentation in PATH$confsuffix
-@@ -6836,6 +6841,7 @@ echo "include directory $(eval echo $includedir)"
- echo "config directory  $(eval echo $sysconfdir)"
- if test "$mingw32" = "no" ; then
- echo "local state directory   $(eval echo $local_statedir)"
-+echo "Info manual directory   $(eval echo $infodir)"
- echo "Manual directory  $(eval echo $mandir)"
- echo "ELF interp prefix $interp_prefix"
- else
-@@ -7059,6 +7065,7 @@ echo "bindir=$bindir" >> $config_host_mak
- echo "libdir=$libdir" >> $config_host_mak
- echo "libexecdir=$libexecdir" >> $config_host_mak
- echo "includedir=$includedir" >> $config_host_mak
-+echo "infodir=$infodir" >> $config_host_mak
- echo "mandir=$mandir" >> $config_host_mak
- echo "sysconfdir=$sysconfdir" >> $config_host_mak
- echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
-diff --git a/docs/index.rst b/docs/index.rst
-index 763e3d04..4f155b51 100644
---- a/docs/index.rst
-+++ b/docs/index.rst
-@@ -9,6 +9,7 @@ Welcome to QEMU's documentation!
- .. toctree::
-    :maxdepth: 2
-    :caption: Contents:
-+   :glob:
- 
-    system/index
-    user/index
-@@ -16,3 +17,4 @@ Welcome to QEMU's documentation!
-    interop/index
-    specs/index
-    devel/index
-+   *
--- 
-2.28.0
-
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 8da57cf6ab..ba8797a09c 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -80,6 +80,7 @@
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages nettle)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages ninja)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages package-management)
   #:use-module (gnu packages perl)
@@ -133,15 +134,14 @@
 (define-public qemu
   (package
     (name "qemu")
-    (version "5.1.0")
+    (version "5.2.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://download.qemu.org/qemu-"
                                   version ".tar.xz"))
                (sha256
                 (base32
-                 "1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9"))
-              (patches (search-patches "qemu-build-info-manual.patch"))
+                 "1g0pvx4qbirpcn9mni704y03n3lvkmw2c0rbcwvydyr8ns4xh66b"))
               (modules '((guix build utils)))
               (snippet
                '(begin
@@ -157,9 +157,9 @@
                     (("^([[:blank:]]*)target_ifreq_size[[:blank:]]=.*$" _ indent)
                      (string-append indent "target_ifreq_size = thunk_type_size(ifreq_max_type, 0);")))
                   #t))))
-     (outputs '("out" "doc"))            ;4.7 MiB of HTML docs
-     (build-system gnu-build-system)
-     (arguments
+    (outputs '("out" "doc"))            ;5.3 MiB of HTML docs
+    (build-system gnu-build-system)
+    (arguments
      `(;; FIXME: Disable tests on i686 to work around
        ;; <https://bugs.gnu.org/40527>.
        #:tests? ,(or (%current-target-system)
@@ -204,30 +204,28 @@
                 (string-append match "9")))))
          (add-after 'unpack 'disable-unusable-tests
            (lambda _
-             (substitute* "tests/Makefile.include"
+             (substitute* "tests/meson.build"
                ;; Comment out the test-qga test, which needs /sys and
                ;; fails within the build environment.
-               (("check-unit-.* tests/test-qga" all)
+               (("tests.*test-qga.*$" all)
                 (string-append "# " all))
                ;; Comment out the test-char test, which needs networking and
                ;; fails within the build environment.
-               (("check-unit-.* tests/test-char" all)
-                (string-append "# " all)))
-             (substitute* "tests/qtest/Makefile.include"
-               ;; Disable the following test, which triggers a crash on some
-               ;; x86 CPUs (see https://issues.guix.info/43048 and
-               ;; https://bugs.launchpad.net/qemu/+bug/1896263).
-               (("check-qtest-i386-y \\+= bios-tables-test" all)
+               (("'test-char':.*$" all)
                 (string-append "# " all)))
              #t))
-         (add-after 'patch-source-shebangs 'patch-/bin/sh-references
+         (add-after 'patch-source-shebangs 'patch-embedded-shebangs
            (lambda _
              ;; Ensure the executables created by these source files reference
              ;; /bin/sh from the store so they work inside the build container.
              (substitute* '("block/cloop.c" "migration/exec.c"
                             "net/tap.c" "tests/qtest/libqtest.c")
                (("/bin/sh") (which "sh")))
+             (substitute* "tests/qemu-iotests/check"
+               (("#!/usr/bin/env python3")
+                (string-append "#!" (which "python3"))))
              #t))
+         ;; XXX ./configure is being re-run at beginning of build phase...
          (replace 'configure
            (lambda* (#:key inputs outputs (configure-flags '())
                      #:allow-other-keys)
@@ -236,14 +234,9 @@
              (let ((out (assoc-ref outputs "out")))
                (setenv "SHELL" (which "bash"))
 
-               ;; While we're at it, patch for tests.
-               (substitute* "tests/qemu-iotests/check"
-                 (("#!/usr/bin/env python3")
-                  (string-append "#!" (which "python3"))))
-
                ;; Ensure config.status gets the correct shebang off the bat.
                ;; The build system gets confused if we change it later and
-               ;; attempts to re-run the whole configury, and fails.
+               ;; attempts to re-run the whole configuration, and fails.
                (substitute* "configure"
                  (("#!/bin/sh")
                   (string-append "#!" (which "sh"))))
@@ -318,6 +311,7 @@ exec smbd $@")))
                      ("pkg-config" ,pkg-config)
                      ("python-wrapper" ,python-wrapper)
                      ("python-sphinx" ,python-sphinx)
+                     ("ninja" ,ninja)
                      ("texinfo" ,texinfo)))
     (home-page "https://www.qemu.org")
     (synopsis "Machine emulator and virtualizer")
-- 
2.30.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-02-27  4:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 18:23 [bug#45014] QEMU 5.2.0 update - functions properly but still work in progress Leo Famulari
2021-02-27  4:08 ` Leo Famulari

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.