Recover after transient dependency compile failures

This commit is contained in:
udo
2026-07-17 19:59:39 +00:00
parent c28b446541
commit 2dd23766e0
3 changed files with 28 additions and 0 deletions
+23
View File
@@ -69,6 +69,29 @@ if [[ "$(http_marker)" != *"dependency-marker-a"* ]]; then
exit 1
fi
# A failed parent build must remember the exact dependency graph that failed.
# If a dependency is restored byte-for-byte to the last working source, the
# old successful metadata must not make that transient failure permanent.
printf '%s\n' \
'#ifndef UCE_DEPENDENCY_CACHE_CHILD' \
'#define UCE_DEPENDENCY_CACHE_CHILD' \
'String dependency_cache_marker() { return(deliberate_dependency_compile_failure); }' \
'#endif' >"$source_dir/child.uce"
if restored_failure=$(scripts/uce-cli --get "/$test_name/parent.uce" __uce_expected_compile_failure=1 2>&1); then
echo "invalid dependency unexpectedly compiled: $restored_failure" >&2
exit 1
fi
if [[ "$restored_failure" != *"deliberate_dependency_compile_failure"* ]]; then
echo "invalid dependency did not report the expected compiler failure: $restored_failure" >&2
exit 1
fi
printf '%s\n' \
'#ifndef UCE_DEPENDENCY_CACHE_CHILD' \
'#define UCE_DEPENDENCY_CACHE_CHILD' \
'String dependency_cache_marker() { return("dependency-marker-a"); }' \
'#endif' >"$source_dir/child.uce"
assert_marker parent dependency-marker-a
# The load-graph signature is content-addressed. A byte-identical dependency
# touch must invalidate stat caches without recompiling its parent artifact.
parent_wasm="$cache_dir/parent.uce.wasm"