Recover after transient dependency compile failures
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user