Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Mar 2026 19:11:41 +0000
From:      Gleb Popov <arrowd@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 28d3c9802b42 - main - emulators/qemu-devel: Make the port a bit more in line with emulators/qemu and enable testing
Message-ID:  <69a5e0ed.1a318.6531d594@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=28d3c9802b4210bb96a07277715b77d9b28e9cbd

commit 28d3c9802b4210bb96a07277715b77d9b28e9cbd
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2026-02-25 15:23:52 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2026-03-02 19:11:06 +0000

    emulators/qemu-devel: Make the port a bit more in line with emulators/qemu and enable testing
    
    Approved by: bofh (maintainer)
    Differential Revision: https://reviews.freebsd.org/D55511
---
 emulators/qemu-devel/Makefile                      | 11 ++++---
 ...tch-tests_functional_qemu__test_____init____.py | 11 +++++++
 ...patch-tests_functional_qemu__test_decorators.py | 35 ++++++++++++++++++++++
 ...patch-tests_functional_x86__64_test__memlock.py | 18 +++++++++++
 4 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile
index 16bd4f7a9ad3..58c4617a073f 100644
--- a/emulators/qemu-devel/Makefile
+++ b/emulators/qemu-devel/Makefile
@@ -23,7 +23,7 @@ LIB_DEPENDS=	libepoxy.so:graphics/libepoxy \
 		libslirp.so:net/libslirp
 
 USES=		bison compiler:c11 cpe gmake gnome iconv:wchar_t localbase:ldflags \
-		ninja perl5 pkgconfig python:build shebangfix tar:xz xorg
+		ninja:build perl5 pkgconfig python:build shebangfix tar:xz xorg
 USE_GITLAB=	yes
 GL_ACCOUNT=	qemu-project
 GL_TAGNAME=	9ef49528b5286f078061b52ac41e0ca19fa10e36
@@ -35,7 +35,6 @@ GL_TUPLE=	qemu-project:keycodemapdb:f5772a62ec52591ff6870b7e8ef32482371f22c6:key
 		qemu-project:berkeley-testfloat-3:e7af9751d9f9fd3b47911f51a5cfd08af256a9ab:berkeleytestfloat3/subprojects/berkeley-testfloat-3
 USE_GNOME=	cairo glib20
 USE_PERL5=	build
-USE_PYTHON=	distutils noflavors
 USE_XORG=	pixman
 
 SHEBANG_FILES=	scripts/xml-preprocess.py
@@ -155,10 +154,11 @@ post-patch-CDROM_DMA-off:
 	@${REINPLACE_CMD} -e '/USE_DMA_CDROM/d' ${WRKSRC}/include/hw/ide/internal.h
 
 do-build:
-	cd ${WRKSRC} && ${GMAKE}
+# Don't build with -j, because the development branch of QEMU regresses from time to time
+	cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${GMAKE}
 
 do-install:
-	cd ${WRKSRC} && ${SETENV} DESTDIR=${STAGEDIR} ${GMAKE} install
+	cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} DESTDIR=${STAGEDIR} ${GMAKE} install
 
 .if !target(post-install)
 post-install:
@@ -170,4 +170,7 @@ post-install-DOCS-on:
 	@(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/)
 .endif
 
+do-test:
+	cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${GMAKE} test
+
 .include <bsd.port.mk>
diff --git a/emulators/qemu-devel/files/patch-tests_functional_qemu__test_____init____.py b/emulators/qemu-devel/files/patch-tests_functional_qemu__test_____init____.py
new file mode 100644
index 000000000000..ece7c08f4235
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-tests_functional_qemu__test_____init____.py
@@ -0,0 +1,11 @@
+--- tests/functional/qemu_test/__init__.py.orig	2025-11-25 22:22:39 UTC
++++ tests/functional/qemu_test/__init__.py
+@@ -16,7 +16,7 @@ from .decorators import skipIfMissingCommands, skipIfN
+ from .decorators import skipIfMissingCommands, skipIfNotMachine, \
+     skipFlakyTest, skipUntrustedTest, skipBigDataTest, skipSlowTest, \
+     skipIfMissingImports, skipIfOperatingSystem, skipLockedMemoryTest, \
+-    skipIfMissingEnv
++    skipIfMissingEnv, skipIfInsideFreeBSDJail
+ from .archive import archive_extract
+ from .uncompress import uncompress
+ from .gdb import GDB
diff --git a/emulators/qemu-devel/files/patch-tests_functional_qemu__test_decorators.py b/emulators/qemu-devel/files/patch-tests_functional_qemu__test_decorators.py
new file mode 100644
index 000000000000..d5901a0da1a2
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-tests_functional_qemu__test_decorators.py
@@ -0,0 +1,35 @@
+--- tests/functional/qemu_test/decorators.py.orig	2025-11-25 22:22:39 UTC
++++ tests/functional/qemu_test/decorators.py
+@@ -6,6 +6,7 @@ import resource
+ import os
+ import platform
+ import resource
++import subprocess
+ from unittest import skipIf, skipUnless
+ 
+ from .cmd import which
+@@ -165,3 +166,24 @@ def skipLockedMemoryTest(locked_memory):
+         ulimit_memory == resource.RLIM_INFINITY or ulimit_memory >= locked_memory * 1024,
+         f'Test required {locked_memory} kB of available locked memory',
+     )
++
++def skipIfInsideFreeBSDJail():
++    '''
++    Decorator to skip execution in a FreeBSD jail
++
++      @skipIfInsideFreeBSDJail()
++    '''
++    jailed = False
++    try:
++        result = subprocess.run(
++            ['sysctl', '-n', 'security.jail.jailed'],
++            capture_output=True,
++            text=True,
++            check=True
++          )
++        jailed = result.stdout.strip() == '1'
++    except Exception:
++        pass
++
++    return skipIf(platform.system() == 'FreeBSD' and jailed,
++                  'running inside the FreeBSD jail')
diff --git a/emulators/qemu-devel/files/patch-tests_functional_x86__64_test__memlock.py b/emulators/qemu-devel/files/patch-tests_functional_x86__64_test__memlock.py
new file mode 100644
index 000000000000..135f238fa18c
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-tests_functional_x86__64_test__memlock.py
@@ -0,0 +1,18 @@
+--- tests/functional/x86_64/test_memlock.py.orig	2025-11-25 22:22:39 UTC
++++ tests/functional/x86_64/test_memlock.py
+@@ -14,13 +14,14 @@ from qemu_test import QemuSystemTest
+ from typing import Dict
+ 
+ from qemu_test import QemuSystemTest
+-from qemu_test import skipLockedMemoryTest
++from qemu_test import skipLockedMemoryTest, skipIfInsideFreeBSDJail
+ 
+ 
+ STATUS_VALUE_PATTERN = re.compile(r'^(\w+):\s+(\d+) kB', re.MULTILINE)
+ 
+ 
+ @skipLockedMemoryTest(2_097_152)  # 2GB
++@skipIfInsideFreeBSDJail()
+ class MemlockTest(QemuSystemTest):
+     """
+     Runs a guest with memlock options.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69a5e0ed.1a318.6531d594>