summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin-ack <sin-ack@protonmail.com>2025-02-15 00:33:11 +0500
committerSam James <sam@gentoo.org>2025-02-16 16:24:53 +0000
commitb5ac3a5296fd73fbd9efe3443724e6547222e815 (patch)
treee197cdccec4154d58d8fd2d05e1adf3f548a1550 /dev-lang
parentdev-lang/zig: do not pass `--libc` when running tests (diff)
downloadgentoo-b5ac3a5296fd73fbd9efe3443724e6547222e815.tar.gz
gentoo-b5ac3a5296fd73fbd9efe3443724e6547222e815.tar.bz2
gentoo-b5ac3a5296fd73fbd9efe3443724e6547222e815.zip
dev-lang/zig: warn user about `binfmt_misc` when running tests
If binfmt_misc hooks are installed for QEMU, then running Zig tests will fail because Zig attempts to run executables during tests that may be from foreign architectures. Normally this would raise an "exec format error" failure which Zig handles but binfmt_misc hooks turn it into a "missing interpreter" error instead which is not handled. Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/zig/zig-0.13.0-r2.ebuild7
-rw-r--r--dev-lang/zig/zig-9999.ebuild7
2 files changed, 14 insertions, 0 deletions
diff --git a/dev-lang/zig/zig-0.13.0-r2.ebuild b/dev-lang/zig/zig-0.13.0-r2.ebuild
index 2b05516cbff1..d8fa77b14495 100644
--- a/dev-lang/zig/zig-0.13.0-r2.ebuild
+++ b/dev-lang/zig/zig-0.13.0-r2.ebuild
@@ -209,6 +209,13 @@ src_compile() {
}
src_test() {
+ if has_version -b app-emulation/qemu; then
+ ewarn "QEMU executable was found on your building system."
+ ewarn "If you have qemu-binfmt (binfmt_misc) hooks enabled for"
+ ewarn "foreign architectures, Zig tests might fail."
+ ewarn "In this case, please disable qemu-binfmt and try again."
+ fi
+
cd "${BUILD_DIR}" || die
# XXX: When we pass a libc installation to Zig, it will fail to find
diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild
index cb7c8e8bffc1..9fe4558461eb 100644
--- a/dev-lang/zig/zig-9999.ebuild
+++ b/dev-lang/zig/zig-9999.ebuild
@@ -202,6 +202,13 @@ src_compile() {
}
src_test() {
+ if has_version -b app-emulation/qemu; then
+ ewarn "QEMU executable was found on your building system."
+ ewarn "If you have qemu-binfmt (binfmt_misc) hooks enabled for"
+ ewarn "foreign architectures, Zig tests might fail."
+ ewarn "In this case, please disable qemu-binfmt and try again."
+ fi
+
cd "${BUILD_DIR}" || die
# XXX: When we pass a libc installation to Zig, it will fail to find