Skip to content

Commit 1a15b27

Browse files
committed
ci: fix kraft fallback to check for kernel output, not just source dirs
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 27cff20 commit 1a15b27

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/test-examples.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ jobs:
112112
working-directory: examples/${{ matrix.example }}
113113
run: |
114114
kraft-hyperlight --no-prompt build --plat hyperlight --arch x86_64 || true
115-
# Fallback: kraft's source-resolution path is flaky (it sometimes
116-
# probes + finds the repo but skips the pull and leaves
117-
# .unikraft/unikraft empty — see memory/feedback_kraft_clean_rebuild).
118-
# Manually clone the components and rebuild with --no-fetch/--no-update.
119-
if [ ! -d ".unikraft/unikraft" ] || [ -z "$(ls -A .unikraft/unikraft 2>/dev/null)" ]; then
120-
echo "::warning::kraft didn't clone unikraft sources; cloning manually"
115+
# Fallback: kraft's source-resolution is flaky it can partially
116+
# clone (e.g. unikraft but not libelf) or leave dirs empty. Check
117+
# for the actual kernel output; if missing, nuke everything and
118+
# clone + build from scratch.
119+
if ! ls .unikraft/build/*_hyperlight-x86_64 >/dev/null 2>&1; then
120+
echo "::warning::kraft build produced no kernel; cloning manually and rebuilding"
121121
UK_SOURCE=$(awk '/^unikraft:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
122122
UK_BRANCH=$(awk '/^unikraft:/{f=1} f && /version:/{print $2; exit}' kraft.yaml)
123123
ELF_SOURCE=$(awk '/app-elfloader:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
@@ -300,8 +300,8 @@ jobs:
300300
run: |
301301
just rootfs
302302
kraft-hyperlight --no-prompt build --plat hyperlight --arch x86_64 || true
303-
if [ ! -d ".unikraft/unikraft" ] || [ -z "$(ls -A .unikraft/unikraft 2>/dev/null)" ]; then
304-
echo "::warning::kraft didn't clone unikraft sources; cloning manually"
303+
if ! ls .unikraft/build/*_hyperlight-x86_64 >/dev/null 2>&1; then
304+
echo "::warning::kraft build produced no kernel; cloning manually and rebuilding"
305305
UK_SOURCE=$(awk '/^unikraft:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
306306
UK_BRANCH=$(awk '/^unikraft:/{f=1} f && /version:/{print $2; exit}' kraft.yaml)
307307
ELF_SOURCE=$(awk '/app-elfloader:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
@@ -445,7 +445,8 @@ jobs:
445445
run: |
446446
just rootfs
447447
kraft-hyperlight --no-prompt build --plat hyperlight --arch x86_64 || true
448-
if [ ! -d ".unikraft/unikraft" ] || [ -z "$(ls -A .unikraft/unikraft 2>/dev/null)" ]; then
448+
if ! ls .unikraft/build/*_hyperlight-x86_64 >/dev/null 2>&1; then
449+
echo "::warning::kraft build produced no kernel; cloning manually and rebuilding"
449450
UK_SOURCE=$(awk '/^unikraft:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
450451
UK_BRANCH=$(awk '/^unikraft:/{f=1} f && /version:/{print $2; exit}' kraft.yaml)
451452
ELF_SOURCE=$(awk '/app-elfloader:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)

0 commit comments

Comments
 (0)