NetBSD Problem Report #55049

From www@netbsd.org  Thu Mar  5 16:25:15 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 679AE1A9217
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  5 Mar 2020 16:25:15 +0000 (UTC)
Message-Id: <20200305162514.3C3251A9243@mollari.NetBSD.org>
Date: Thu,  5 Mar 2020 16:25:14 +0000 (UTC)
From: oshima-ya@yagoto-urayama.jp
Reply-To: oshima-ya@yagoto-urayama.jp
To: gnats-bugs@NetBSD.org
Subject: emulators/qemu build fail after merge nvmm on netbsd/amd64-8
X-Send-Pr-Version: www-1.0

>Number:         55049
>Category:       pkg
>Synopsis:       emulators/qemu build fail after merge nvmm on netbsd/amd64-8
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    leot
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 05 16:30:01 +0000 2020
>Closed-Date:    Sat May 23 15:47:26 +0000 2020
>Last-Modified:  Sat May 23 15:50:01 +0000 2020
>Originator:     Yasushi Oshima
>Release:        pkgsrc-current
>Organization:
>Environment:
NetBSD amanatsu4 8.1 NetBSD 8.1 (XEN3_DOMU) #0: Fri May 31 08:43:59 UTC 2019  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/xen/compile/XEN3_DOMU amd64
>Description:
The nvmm patch for qemu always enables nvmm option when OS is NetBSD.
But nvmm is only available on NetBSD/amd64 9.0 and later now.

When in the case of another version, (netbsd/amd64-8, netbsd/i386-any, or so on), make configure says:

ERROR: User requested feature NVMM
       configure was not able to find it.
       NVMM is not available

*** Error code 1

Stop.
make[1]: stopped in /usr/pkgsrc/emulators/qemu
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/emulators/qemu

>How-To-Repeat:
make in pkgsrc/emulators/qemu on NetBSD/amd64 8.1

>Fix:
This patch change to:
- Set default off when netbsd.
- Add nvmm PKG_OPTION when NetBSD/amd64 9 and later.
  - add --enable-nvmm CONFIGURE_ARGS.
  - another case, add --disable-nvmm.
It will need more considerations for other OS cases.

diff --git a/emulators/qemu/options.mk b/emulators/qemu/options.mk
index 5da2584b4f0..94291eb3584 100644
--- a/emulators/qemu/options.mk
+++ b/emulators/qemu/options.mk
@@ -14,6 +14,11 @@ PKG_SUPPORTED_OPTIONS+=	virtfs-proxy-helper
 PKG_SUGGESTED_OPTIONS+=	sdl
 .endif

+.if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "x86_64" && ${OS_VERSION:R} >= 9
+PKG_SUPPORTED_OPTIONS+=	nvmm
+PKG_SUGGESTED_OPTIONS+=	nvmm
+.endif
+
 .include "../../mk/bsd.options.mk"

 PLIST_VARS+=		gtk virtfs-proxy-helper
@@ -49,3 +54,9 @@ CONFIGURE_ARGS+=	--enable-spice
 .else
 CONFIGURE_ARGS+=	--disable-spice
 .endif
+
+.if !empty(PKG_OPTIONS:Mnvmm)
+CONFIGURE_ARGS+=	--enable-nvmm
+.else
+CONFIGURE_ARGS+=	--disable-nvmm
+.endif
diff --git a/emulators/qemu/patches/patch-configure b/emulators/qemu/patches/patch-configure
index e2900d98e9a..8eb5631cd6d 100644
--- a/emulators/qemu/patches/patch-configure
+++ b/emulators/qemu/patches/patch-configure
@@ -43,7 +43,7 @@ Add NVMM support.
  NetBSD)
    bsd="yes"
    hax="yes"
-+  nvmm="yes"
++  nvmm="no"
    make="${MAKE-gmake}"
    audio_drv_list="oss try-sdl"
    audio_possible_drivers="oss sdl"

>Release-Note:

>Audit-Trail:
From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/55049: emulators/qemu build fail after merge nvmm on netbsd/amd64-8
Date: Thu, 05 Mar 2020 17:36:34 +0100

 Hello Yasushi, 

 oshima-ya@yagoto-urayama.jp writes:
 > [...]
 > >Description:
 > The nvmm patch for qemu always enables nvmm option when OS is NetBSD.
 > But nvmm is only available on NetBSD/amd64 9.0 and later now.
 >
 > When in the case of another version, (netbsd/amd64-8, netbsd/i386-any, or so on), make configure says:
 >
 > ERROR: User requested feature NVMM
 >        configure was not able to find it.
 >        NVMM is not available
 >
 > *** Error code 1
 >
 > Stop.
 > make[1]: stopped in /usr/pkgsrc/emulators/qemu
 > *** Error code 1
 > 
 > Stop.
 > make: stopped in /usr/pkgsrc/emulators/qemu
 >
 > >How-To-Repeat:
 > make in pkgsrc/emulators/qemu on NetBSD/amd64 8.1
 >
 > >Fix:
 > This patch change to:
 > - Set default off when netbsd.
 > - Add nvmm PKG_OPTION when NetBSD/amd64 9 and later.
 >   - add --enable-nvmm CONFIGURE_ARGS.
 >   - another case, add --disable-nvmm.
 > It will need more considerations for other OS cases.
 > [...]

 What about just adjusting the patches/patch-configure as follow:

 > [...]
 > diff --git a/emulators/qemu/patches/patch-configure b/emulators/qemu/patches/patch-configure
 > index e2900d98e9a..8eb5631cd6d 100644
 > --- a/emulators/qemu/patches/patch-configure
 > +++ b/emulators/qemu/patches/patch-configure
 > @@ -43,7 +43,7 @@ Add NVMM support.
 >   NetBSD)
 >     bsd="yes"
 >     hax="yes"
 > -+  nvmm="yes"
 > ++  nvmm="no"
 >     make="${MAKE-gmake}"
 >     audio_drv_list="oss try-sdl"
 >     audio_possible_drivers="oss sdl"
 >

 ...instead of `nvmm="yes"' or `nvmm="no"' it can be set to:

  nvmm=""

 so in that way nvmm will be enabled only if available.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 11 Apr 2020 12:39:19 +0000
State-Changed-Why:
I believe this issue is now fixed. The makefile checks for the existence of /usr/include/nvmm.h which can't happen on older netbsd (without intentional attempts to shoot one's feet off)


Responsible-Changed-From-To: pkg-manager->leot
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Sat, 11 Apr 2020 12:50:40 +0000
Responsible-Changed-Why:
Take.

The check in Makefile could be probably avoided and use the already
existent logic in configure.  I'll try to look at it.


State-Changed-From-To: closed->analyzed
State-Changed-By: leot@NetBSD.org
State-Changed-When: Sat, 11 Apr 2020 12:55:50 +0000
State-Changed-Why:
Put in analyzed state to eventually remind me about this PR and
applying the less intrusive patch proposed.


State-Changed-From-To: analyzed->closed
State-Changed-By: leot@NetBSD.org
State-Changed-When: Sat, 23 May 2020 15:47:26 +0000
State-Changed-Why:
Proposed patch committed.

Thanks Yasushi Oshima for the PR, patch and feedbacks!


From: "Leonardo Taccari" <leot@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55049 CVS commit: pkgsrc/emulators/qemu
Date: Sat, 23 May 2020 15:46:12 +0000

 Module Name:	pkgsrc
 Committed By:	leot
 Date:		Sat May 23 15:46:12 UTC 2020

 Modified Files:
 	pkgsrc/emulators/qemu: Makefile distinfo
 	pkgsrc/emulators/qemu/patches: patch-configure

 Log Message:
 qemu: Do not duplicate already existing configure nvmm test in pkgsrc Makefile

 configure already had the logic to gracefully test for nvmm and if the
 corresponding nvmm variable is set to an empty string do that.

 No functional nor binary change intended except a CONFIGURE_ARGS difference.

 Fixes PR pkg/55049.

 Thanks Yasushi Oshima for reporting this problem, sharing an initial
 patch and further testing the version committed now!


 To generate a diff of this commit:
 cvs rdiff -u -r1.242 -r1.243 pkgsrc/emulators/qemu/Makefile
 cvs rdiff -u -r1.159 -r1.160 pkgsrc/emulators/qemu/distinfo
 cvs rdiff -u -r1.27 -r1.28 pkgsrc/emulators/qemu/patches/patch-configure

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.