Merge branch 'os-test-result' into 'master'

Add recipe for os-test-relibc repo

See merge request redox-os/redox!1780
This commit is contained in:
Jeremy Soller 2025-12-21 06:14:04 -07:00
commit b5ab5fb170
8 changed files with 117 additions and 6 deletions

View File

@ -34,6 +34,7 @@ gettext = {}
git = {}
# gdbserver = {} # wrong libc type
# gnu-binutils = {} # bfd doesn't recognize redox
gnu-make = {}
hicolor-icon-theme = {}
installer = {}
installer-gui = {}

View File

@ -32,6 +32,7 @@ freefont = {}
freetype2 = {}
gettext = {}
git = {}
gnu-make = {}
hicolor-icon-theme = {}
installer = {}
installer-gui = {}

View File

@ -9,10 +9,12 @@ ca-certificates = {}
coreutils = {}
extrautils = {}
findutils = {}
gnu-make = {}
ion = {}
netdb = {}
pkgutils = {}
relibc = {}
sed = {}
# Override to not background dhcpd
[[files]]

View File

@ -32,6 +32,7 @@ freefont = {}
freetype2 = {}
gettext = {}
git = {}
gnu-make = {}
hicolor-icon-theme = {}
installer = {}
#installer-gui = {} # redox_syscall 0.4 not working on riscv64gc?

View File

@ -31,6 +31,7 @@ RUN apt-get update \
gtk-doc-tools \
gtk-update-icon-cache \
help2man \
ipxe-qemu \
intltool \
itstool \
libaudiofile-dev \
@ -63,6 +64,9 @@ RUN apt-get update \
pkg-config \
po4a \
protobuf-compiler \
qemu-system-x86 \
qemu-system-arm \
qemu-efi-aarch64 \
python3 \
python3-dev \
python3-mako \

View File

@ -10,9 +10,4 @@ autotools_recursive_regenerate
"""
[build]
template = "custom"
script = """
DYNAMIC_INIT
rsync -av --delete "$COOKBOOK_SOURCE/." ./
cookbook_configure
"""
template = "configure"

View File

@ -0,0 +1,6 @@
[source]
git = "https://gitlab.redox-os.org/redox-os/redoxer"
branch = "master"
[build]
template = "cargo"

View File

@ -0,0 +1,101 @@
[source]
same_as = "../os-test"
[build]
template = "custom"
dev-dependencies = [
"host:redoxer",
# allows rebuilding relibc without updating prefix
"relibc",
"gnu-grep",
"libarchive",
]
script = """
if [ "$TARGET" = "$COOKBOOK_HOST_TARGET" ]; then
# TODO: libc conflict on toolchain
export LD_LIBRARY_PATH="/lib/${GNU_TARGET}:${LD_LIBRARY_PATH}"
fi
rsync -a "${COOKBOOK_SOURCE}/" ./
os=$(echo "${TARGET}" | cut -d - -f3)
case "$os" in
linux) OS=Linux;;
redox) OS=Redox;;
esac
# allows linking to relibc instead of prefix/host libc
export CC="env LIBRARY_PATH=${COOKBOOK_SYSROOT}/lib ${GNU_TARGET}-gcc"
export CFLAGS="\
-nostdinc \
-nostdlib \
-isystem ${COOKBOOK_SYSROOT}/include \
-static \
--sysroot ${COOKBOOK_SYSROOT} \
${COOKBOOK_SYSROOT}/lib/crt0.o \
${COOKBOOK_SYSROOT}/lib/crti.o \
${COOKBOOK_SYSROOT}/lib/crtn.o \
${COOKBOOK_SYSROOT}/lib/libc.a \
"
make OS=${OS} CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS= \
LDFLAGS= EXTRA_LDFLAGS= \
CC_FOR_BUILD="${CC_WRAPPER} cc" CFLAGS_FOR_BUILD= CPPFLAGS_FOR_BUILD= \
LDFLAGS_FOR_BUILD= -j ${COOKBOOK_MAKE_JOBS} all
skips=(
# Skip hanging tests on Linux/Redox with relibc
basic/stdio/putc_unlocked
)
if [ "$OS" = "Redox" ]; then
skips+=(
# Skip hanging tests on Redox with relibc
# https://gitlab.redox-os.org/redox-os/redox/-/issues/1752
basic/sys_socket/accept
basic/sys_socket/recv
basic/sys_socket/send
basic/sys_socket/shutdown
signal/ppoll-block-close
signal/ppoll-block-close-raise
signal/ppoll-block-raise
signal/ppoll-block-sleep-raise-write
signal/ppoll-block-sleep-raise
signal/ppoll-block-sleep-write-raise
)
fi
for skip in "${skips[@]}"
do
mkdir -p out.known/${os}/"$(dirname "${skip}")"
echo "skipped" > out.known/${os}/"${skip}.out"
done
cp -t out -R out.known/${os}
postinstall () {
make OS=${OS} CC_FOR_BUILD="${CC_WRAPPER} cc" \
CFLAGS_FOR_BUILD= CPPFLAGS_FOR_BUILD= \
LDFLAGS_FOR_BUILD= html json jsonl
mkdir -p ${COOKBOOK_STAGE}/share/os-test
cp -a out ${COOKBOOK_STAGE}/share/os-test/out
cp -a html ${COOKBOOK_STAGE}/share/os-test/html
cp -a os-test.json ${COOKBOOK_STAGE}/share/os-test/os-test.json
cp -a os-test.jsonl ${COOKBOOK_STAGE}/share/os-test/os-test.jsonl
}
if [ "$TARGET" = "$COOKBOOK_HOST_TARGET" ]; then
make test
postinstall
else
# bash: gnu-make crashes randomly but can continue
# issues with multi-core and make jobs
# https://gitlab.redox-os.org/redox-os/relibc/-/issues/240
# https://gitlab.redox-os.org/redox-os/redox/-/issues/1753
export REDOXER_QEMU_ARGS="-smp 1"
# make: jobs doesn't work yet
echo redoxer exec --folder . --folder "${COOKBOOK_SYSROOT}/usr/:/usr" --artifact out:/root/out \
bash -c "until make test; do echo retrying; done"
postinstall
fi
"""