Avoid rebuilding byte-identical source graphs

This commit is contained in:
root
2026-07-16 23:27:51 +00:00
parent 8dd307d316
commit e9644c717f
2 changed files with 16 additions and 2 deletions
+12 -1
View File
@@ -69,6 +69,18 @@ if [[ "$(http_marker)" != *"dependency-marker-a"* ]]; then
exit 1
fi
# 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"
parent_wasm_identity=$(stat -c '%y:%s' "$parent_wasm")
sleep 1.1
touch "$source_dir/child.uce"
assert_marker parent dependency-marker-a
if [[ "$(stat -c '%y:%s' "$parent_wasm")" != "$parent_wasm_identity" ]]; then
echo "byte-identical dependency touch recompiled the parent artifact" >&2
exit 1
fi
printf '%s\n' 'CLI(Request& context) { print("readable-source-marker"); }' >"$source_dir/unreadable.uce"
chmod 000 "$source_dir/unreadable.uce"
if unreadable_output=$(scripts/uce-cli --get "/$test_name/unreadable.uce" __uce_expected_source_read_failure=1 2>&1); then
@@ -112,7 +124,6 @@ assert_marker parent dependency-marker-b
# A proactive rebuild owns these same per-unit locks. While it publishes fresh
# artifacts, requests must use the last complete artifacts instead of waiting
# across the transitive graph. Atomic publication keeps those artifacts safe.
parent_wasm="$cache_dir/parent.uce.wasm"
child_wasm="$cache_dir/child.uce.wasm"
(
exec 8>"$parent_wasm.lock"