From 293fa923ca6d88c0ae744b51f6045f134fec7779 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 21 Dec 2025 19:31:32 +0700 Subject: [PATCH] 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 7199d8059..91e95a5d3 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 c346d2c54..f0fded6b0 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 """