From 8b1127f6eb5aca0b59f0031f2a8dedf736c82d46 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 8 Nov 2026 19:43:13 +0900 Subject: cmd/hakurei/testsuite: format expected ldd output This message is different between the musl and glibc implementations. This change assumes the non-Rosa test suite uses glibc, since it is only ran on the Gitea actions runner. Signed-off-by: Ophestra --- cmd/hakurei/testsuite/main.go | 2 +- cmd/hakurei/testsuite/prefix.go | 6 ++++++ cmd/hakurei/testsuite/prefix_rosa.go | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/hakurei/testsuite/main.go b/cmd/hakurei/testsuite/main.go index bb83aac0..eb3eafc4 100644 --- a/cmd/hakurei/testsuite/main.go +++ b/cmd/hakurei/testsuite/main.go @@ -192,7 +192,7 @@ func main() { pathname := prefix.Append("bin", name) testsuite.AssertOutput( "validating "+pathname.String()+" static linking", - "", "\tnot a dynamic executable\n", + "", lddMessage(name), )(testsuite.MustOutput( ctx, nil, nil, hst.ExitFailure, "validate "+pathname.String()+" static linking", diff --git a/cmd/hakurei/testsuite/prefix.go b/cmd/hakurei/testsuite/prefix.go index 03cf6fd7..5fef7c8f 100644 --- a/cmd/hakurei/testsuite/prefix.go +++ b/cmd/hakurei/testsuite/prefix.go @@ -6,3 +6,9 @@ import "hakurei.app/fhs" // prefix is the hakurei installation prefix. var prefix = fhs.AbsUsr.Append("local") + +// lddMessage returns the string written to stderr by glibc while validating +// hakurei. +func lddMessage(_ string) string { + return "\tnot a dynamic executable\n" +} diff --git a/cmd/hakurei/testsuite/prefix_rosa.go b/cmd/hakurei/testsuite/prefix_rosa.go index 4a00367f..dda93178 100644 --- a/cmd/hakurei/testsuite/prefix_rosa.go +++ b/cmd/hakurei/testsuite/prefix_rosa.go @@ -6,3 +6,9 @@ import "hakurei.app/check" // prefix is the hakurei installation prefix on Rosa OS. var prefix = check.MustAbs("/system") + +// lddMessage returns the string written to stderr by musl while validating +// hakurei on Rosa OS. +func lddMessage(name string) string { + return "ldd: /system/bin/" + name + ": Not a valid dynamic program\n" +} -- cgit v1.3.1