fix: choose a release asset by one rule

resolve_file picked and fetched a release asset in one step, and verify re-derived the choice in pending_release_asset, which refused any record whose size differed from a declared size. fbneo's donpachi, sfz3mix and twotiger samples declare an approximate size with no validation: an online build shipped them while verify reported them missing.

release_asset_paths now chooses on the database record under the rules declared_hash_verdict applies to bytes, and both the builder and verify call it. The builder then fetches that revision and holds its bytes to the declaration.
This commit is contained in:
Abdessamad Derraz committed 2026-11-22 02:26:45 +01:00
1 parent dd76142a9c
commit a39b1c25f3
7 files changed
+154 -108

No files matched your search

+4 -4
View File
@@ -314,7 +314,7 @@ def _resolve_for_platform(
disk and the large-file cache: verify never downloads. A frontend that
never reads the bytes takes the filename-free core's own image.
"""
from resolve.packfiles import pending_release_asset, resolve_declaration, run_is_offline
from resolve.packfiles import release_asset_paths, resolve_declaration, run_is_offline
override = slot_overrides.get(
declared_destination(file_entry)
@@ -326,9 +326,9 @@ def _resolve_for_platform(
if status in ("not_found", "hash_mismatch") and not run_is_offline():
# Not in the cache, and the release holds a copy that answers the
# declaration: an online build fetches and packs it (resolve_file).
asset = pending_release_asset(file_entry, db)
if asset:
return asset, RELEASE_ASSET_PENDING
assets = release_asset_paths(file_entry, db)
if assets:
return assets[0], RELEASE_ASSET_PENDING
if status == "not_found" and not reads_file_contents(mode):
found = agnostic_substitute(file_entry, sys_id, db, platform_profiles)
if found: