From 29bf516500b64c5d503443d6b03d993fb996a16b Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 19 Dec 2025 22:28:35 +0700 Subject: [PATCH 1/5] Add recipe for os-test-relibc repo --- recipes/tests/os-test-result/recipe.toml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 recipes/tests/os-test-result/recipe.toml diff --git a/recipes/tests/os-test-result/recipe.toml b/recipes/tests/os-test-result/recipe.toml new file mode 100644 index 00000000..66f22c93 --- /dev/null +++ b/recipes/tests/os-test-result/recipe.toml @@ -0,0 +1,18 @@ +# Must be run on host: "make r.host:os-test-result" +[source] +git = "https://gitlab.redox-os.org/redox-os/os-test-relibc" +script = """ +# update automatically +cd relibc && git pull origin master +""" + +[build] +template = "custom" +script = """ +rsync -a --delete "${COOKBOOK_SOURCE}/" ./ +mkdir -p {COOKBOOK_STAGE}/share/os-test +./linux.sh +mv os-test/html ${COOKBOOK_STAGE}/share/os-test/html +mv os-test/out ${COOKBOOK_STAGE}/share/os-test/out +mv os-test/os-test.json ${COOKBOOK_STAGE}/share/os-test/os-test.json +""" From fcb4bb090085cf3095d81d7917d7dd5369b54637 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sat, 20 Dec 2025 13:52:43 +0700 Subject: [PATCH 2/5] Support running cross compiled os-test --- podman/redox-base-containerfile | 4 ++ recipes/dev/redoxer/recipe.toml | 6 +++ recipes/tests/os-test-result/recipe.toml | 56 +++++++++++++++++++----- 3 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 recipes/dev/redoxer/recipe.toml diff --git a/podman/redox-base-containerfile b/podman/redox-base-containerfile index 525d64e1..837dd30f 100644 --- a/podman/redox-base-containerfile +++ b/podman/redox-base-containerfile @@ -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 \ diff --git a/recipes/dev/redoxer/recipe.toml b/recipes/dev/redoxer/recipe.toml new file mode 100644 index 00000000..5579c056 --- /dev/null +++ b/recipes/dev/redoxer/recipe.toml @@ -0,0 +1,6 @@ +[source] +git = "https://gitlab.redox-os.org/willnode/redoxer" +branch = "artifact-opt" + +[build] +template = "cargo" diff --git a/recipes/tests/os-test-result/recipe.toml b/recipes/tests/os-test-result/recipe.toml index 66f22c93..71d2663a 100644 --- a/recipes/tests/os-test-result/recipe.toml +++ b/recipes/tests/os-test-result/recipe.toml @@ -1,18 +1,50 @@ -# Must be run on host: "make r.host:os-test-result" [source] -git = "https://gitlab.redox-os.org/redox-os/os-test-relibc" -script = """ -# update automatically -cd relibc && git pull origin master -""" +same_as = "../os-test" [build] template = "custom" +dev-dependencies = [ + "host:redoxer", + "gnu-grep", + "gnu-make", + "libarchive", + "sed", +] script = """ -rsync -a --delete "${COOKBOOK_SOURCE}/" ./ -mkdir -p {COOKBOOK_STAGE}/share/os-test -./linux.sh -mv os-test/html ${COOKBOOK_STAGE}/share/os-test/html -mv os-test/out ${COOKBOOK_STAGE}/share/os-test/out -mv os-test/os-test.json ${COOKBOOK_STAGE}/share/os-test/os-test.json +rsync -a "${COOKBOOK_SOURCE}/" ./ +case "$(echo "${TARGET}" | cut -d - -f3)" in + linux) OS=Linux;; + redox) OS=Redox;; +esac + +make OS=${OS} CC="${CC}" CFLAGS= CPPFLAGS= \ + LDFLAGS= EXTRA_LDFLAGS= \ + CC_FOR_BUILD="${CC_WRAPPER} cc" CFLAGS_FOR_BUILD= CPPFLAGS_FOR_BUILD= \ + LDFLAGS_FOR_BUILD= all + +skips=( + # Skip fputc_unlocked, hanging on Linux with relibc + basic/stdio/putc_unlocked +) +for skip in "${skips[@]}" +do + mkdir -p out.known/{linux,redox}/"$(dirname "${skip}")" + echo "skipped" > out.known/linux/"${skip}.out" + echo "skipped" > out.known/redox/"${skip}.out" +done +cp -t out -R out.known/linux +cp -t out -R out.known/redox + +if [ "$TARGET" = "$COOKBOOK_HOST_TARGET" ]; then + make test +else + redoxer exec --folder . --folder ${COOKBOOK_SYSROOT}/usr/:/usr --artifact . make test +fi + +make html json jsonl + +mkdir -p ${COOKBOOK_STAGE}/share/os-test +mv html ${COOKBOOK_STAGE}/share/os-test/html +mv out ${COOKBOOK_STAGE}/share/os-test/out +mv os-test.json ${COOKBOOK_STAGE}/share/os-test/os-test.json """ From 865230fde4e67a21d692a77eae836230801a79bd Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 21 Dec 2025 13:50:13 +0700 Subject: [PATCH 3/5] Adapt os-test-result and move packages to redoxer bin --- config/redoxer.toml | 2 + recipes/dev/redoxer/recipe.toml | 4 +- recipes/tests/os-test-result/recipe.toml | 75 +++++++++++++++++++----- 3 files changed, 65 insertions(+), 16 deletions(-) diff --git a/config/redoxer.toml b/config/redoxer.toml index 8c50e37d..ad112df7 100644 --- a/config/redoxer.toml +++ b/config/redoxer.toml @@ -9,10 +9,12 @@ ca-certificates = {} coreutils = {} extrautils = {} findutils = {} +gnu-make = {} ion = {} netdb = {} pkgutils = {} relibc = {} +sed = {} # Override to not background dhcpd [[files]] diff --git a/recipes/dev/redoxer/recipe.toml b/recipes/dev/redoxer/recipe.toml index 5579c056..5f5c2048 100644 --- a/recipes/dev/redoxer/recipe.toml +++ b/recipes/dev/redoxer/recipe.toml @@ -1,6 +1,6 @@ [source] -git = "https://gitlab.redox-os.org/willnode/redoxer" -branch = "artifact-opt" +git = "https://gitlab.redox-os.org/redox-os/redoxer" +branch = "master" [build] template = "cargo" diff --git a/recipes/tests/os-test-result/recipe.toml b/recipes/tests/os-test-result/recipe.toml index 71d2663a..c346d2c5 100644 --- a/recipes/tests/os-test-result/recipe.toml +++ b/recipes/tests/os-test-result/recipe.toml @@ -5,46 +5,93 @@ same_as = "../os-test" template = "custom" dev-dependencies = [ "host:redoxer", +# allows rebuilding relibc without updating prefix + "relibc", "gnu-grep", - "gnu-make", "libarchive", - "sed", ] script = """ rsync -a "${COOKBOOK_SOURCE}/" ./ -case "$(echo "${TARGET}" | cut -d - -f3)" in +os=$(echo "${TARGET}" | cut -d - -f3) +case "$os" in linux) OS=Linux;; redox) OS=Redox;; esac -make OS=${OS} CC="${CC}" CFLAGS= CPPFLAGS= \ +# 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 \ +" + +# allow retest without restesting successful ones +mkdir -p out +for file in $(grep -rL "good" out); do + if [ -f "$file" ]; then + rm "$file" + fi +done + +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= all + LDFLAGS_FOR_BUILD= -j ${COOKBOOK_MAKE_JOBS} all skips=( - # Skip fputc_unlocked, hanging on Linux with relibc + # 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/{linux,redox}/"$(dirname "${skip}")" - echo "skipped" > out.known/linux/"${skip}.out" - echo "skipped" > out.known/redox/"${skip}.out" + mkdir -p out.known/${os}/"$(dirname "${skip}")" + echo "skipped" > out.known/${os}/"${skip}.out" done -cp -t out -R out.known/linux -cp -t out -R out.known/redox + +cp -t out -R out.known/${os} if [ "$TARGET" = "$COOKBOOK_HOST_TARGET" ]; then make test else - redoxer exec --folder . --folder ${COOKBOOK_SYSROOT}/usr/:/usr --artifact . make test + # bash: gnu-make crashes randomly but can continue + redoxer exec --folder . --folder "${COOKBOOK_SYSROOT}/usr/:/usr" --artifact out:/root/out \ + bash -c "until make -j 4 test; do echo retrying; done" + # html won't generated without this, not sure why + sleep 2 fi -make html json jsonl +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 -mv html ${COOKBOOK_STAGE}/share/os-test/html mv out ${COOKBOOK_STAGE}/share/os-test/out +mv html ${COOKBOOK_STAGE}/share/os-test/html mv os-test.json ${COOKBOOK_STAGE}/share/os-test/os-test.json +mv os-test.jsonl ${COOKBOOK_STAGE}/share/os-test/os-test.jsonl """ From dbfdb8e1d4890766e5c71894df74b19ea46faf2c Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 21 Dec 2025 19:30:07 +0700 Subject: [PATCH 4/5] Add gnu-make to CI --- config/aarch64/ci.toml | 1 + config/i586/ci.toml | 1 + config/riscv64gc/ci.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/config/aarch64/ci.toml b/config/aarch64/ci.toml index bbe0b337..76fb84db 100644 --- a/config/aarch64/ci.toml +++ b/config/aarch64/ci.toml @@ -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 = {} diff --git a/config/i586/ci.toml b/config/i586/ci.toml index 1df1e25d..8c6105c9 100644 --- a/config/i586/ci.toml +++ b/config/i586/ci.toml @@ -32,6 +32,7 @@ freefont = {} freetype2 = {} gettext = {} git = {} +gnu-make = {} hicolor-icon-theme = {} installer = {} installer-gui = {} diff --git a/config/riscv64gc/ci.toml b/config/riscv64gc/ci.toml index 694fbafa..6da302cb 100644 --- a/config/riscv64gc/ci.toml +++ b/config/riscv64gc/ci.toml @@ -32,6 +32,7 @@ freefont = {} freetype2 = {} gettext = {} git = {} +gnu-make = {} hicolor-icon-theme = {} installer = {} #installer-gui = {} # redox_syscall 0.4 not working on riscv64gc? From 293fa923ca6d88c0ae744b51f6045f134fec7779 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 21 Dec 2025 19:31:32 +0700 Subject: [PATCH 5/5] Polish os-test-result script --- recipes/dev/gnu-make/recipe.toml | 7 +--- recipes/tests/os-test-result/recipe.toml | 50 +++++++++++++----------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/recipes/dev/gnu-make/recipe.toml b/recipes/dev/gnu-make/recipe.toml index 7199d805..91e95a5d 100644 --- a/recipes/dev/gnu-make/recipe.toml +++ b/recipes/dev/gnu-make/recipe.toml @@ -10,9 +10,4 @@ autotools_recursive_regenerate """ [build] -template = "custom" -script = """ -DYNAMIC_INIT -rsync -av --delete "$COOKBOOK_SOURCE/." ./ -cookbook_configure -""" +template = "configure" diff --git a/recipes/tests/os-test-result/recipe.toml b/recipes/tests/os-test-result/recipe.toml index c346d2c5..f0fded6b 100644 --- a/recipes/tests/os-test-result/recipe.toml +++ b/recipes/tests/os-test-result/recipe.toml @@ -11,6 +11,11 @@ dev-dependencies = [ "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 @@ -32,14 +37,6 @@ ${COOKBOOK_SYSROOT}/lib/crtn.o \ ${COOKBOOK_SYSROOT}/lib/libc.a \ " -# allow retest without restesting successful ones -mkdir -p out -for file in $(grep -rL "good" out); do - if [ -f "$file" ]; then - rm "$file" - fi -done - make OS=${OS} CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS= \ LDFLAGS= EXTRA_LDFLAGS= \ CC_FOR_BUILD="${CC_WRAPPER} cc" CFLAGS_FOR_BUILD= CPPFLAGS_FOR_BUILD= \ @@ -75,23 +72,30 @@ done cp -t out -R out.known/${os} -if [ "$TARGET" = "$COOKBOOK_HOST_TARGET" ]; then - make test -else - # bash: gnu-make crashes randomly but can continue - redoxer exec --folder . --folder "${COOKBOOK_SYSROOT}/usr/:/usr" --artifact out:/root/out \ - bash -c "until make -j 4 test; do echo retrying; done" - # html won't generated without this, not sure why - sleep 2 -fi - +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 -mv out ${COOKBOOK_STAGE}/share/os-test/out -mv html ${COOKBOOK_STAGE}/share/os-test/html -mv os-test.json ${COOKBOOK_STAGE}/share/os-test/os-test.json -mv os-test.jsonl ${COOKBOOK_STAGE}/share/os-test/os-test.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 """