diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile --- a/emulators/qemu-devel/Makefile +++ b/emulators/qemu-devel/Makefile @@ -23,7 +23,7 @@ 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 @@ 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 @@ @${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 @@ @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/) .endif +do-test: + cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${GMAKE} test + .include 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 --- /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 --- /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 --- /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.