Avoid rebuilding byte-identical source graphs
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user