refactor: one whole-tree gap report for both

This commit is contained in:
Abdessamad Derraz committed 2026-11-24 00:20:03 +01:00
1 parent 5d8320f735
commit 82cb80d554
6 files changed
+48 -38

No files matched your search

+16 -9
View File
@@ -2,7 +2,13 @@
from __future__ import annotations
from packs.crossref import cross_reference, global_report_scope, platform_configs
from packs.crossref import (
cross_reference,
emulator_profiles,
global_report_scope,
platform_configs,
whole_tree_gaps,
)
from packs.crossrefscope import TreeScope
from packs.supplemental import build_supplemental_index
from resolve.launchers import LauncherLayer, declared_destinations
@@ -14,18 +20,19 @@ def scope_gaps(
) -> dict:
"""Each profile of the scope with the files its platforms leave undeclared."""
platform_scope = tree.platform
declared, global_scope = global_report_scope(
platform_configs(platforms_dir, tree.selected), db, all_profiles)
global_scope["standalone_cores"] = tree.standalone_cores
configs = platform_configs(platforms_dir, tree.selected)
data_names = build_supplemental_index()
if platform_scope is None:
return whole_tree_gaps(configs, db, all_profiles, data_names, tree.profiles)
declared, global_scope = global_report_scope(configs, db, all_profiles)
# The platform's own layout, its per-core directory markers kept.
global_scope["standalone_cores"] = tree.standalone_cores
return cross_reference(
tree.profiles, declared, db, data_names, **global_scope,
platform=(
platform_scope.config.get("_key", platform) if platform_scope else ""
),
emulator_profiles(tree.profiles), declared, db, data_names, **global_scope,
platform=platform_scope.config.get("_key", platform),
# What the platform's launchers open, as verify and the builder read it.
launcher_layer=LauncherLayer(
platform_scope.config, tree.profiles, platform_scope.relevant, db,
declared_destinations(platform_scope.config),
) if platform_scope else None,
),
)