cmds.projects.lib.pkg_relations(): Skip excluded modules

The [build] exclude list names platforms (OS cascade entries) on which a
project's build is excluded, not projects. pkg_relations() implements
--skip-excluded by walking the seeds' exclude values as if they were
project specs, so a value such as "debian" is visited as a project, the
installed-package check fails with "Unmet dependency on debian: the -run
package of project debian is not installed", and `make
pkg-install-testbuild-deps` breaks.

Implement the flag's documented semantics using
App.is_excluded_from_build(): an excluded seed is neither considered nor
output, an excluded module in the dependency closure contributes no
dependencies, and excluded modules are not output as jw dependencies. This
matches what required-os-pkg already does.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.87.0
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-09-23 16:40:19 +02:00
commit 023f4b17d7
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -30,16 +30,11 @@ def pkg_relations(
if syntax == Syntax.DEBIAN:
expand_semver_revision_range = True
if skip_excluded:
excluded = app.get_project_refs(
seed_pkgs,
['build'],
'exclude',
scope = Scope.One,
add_self = False,
names_only = True,
)
ignore |= set(excluded)
def __is_excluded(module: str) -> bool:
# True if the module is excluded from the build on the current
# distro, i.e. if its [build] exclude list matches the distro's
# os cascade
return app.is_excluded_from_build(module) is not None
log(
DEBUG,
@ -55,6 +50,9 @@ def pkg_relations(
closure: list[str] = []
visited: set[str] = set()
for seed in seed_pkgs:
if skip_excluded and __is_excluded(seed):
# Excluded seeds are neither considered nor output
continue
app.walk_project_deps(
closure,
visited,
@ -69,6 +67,9 @@ def pkg_relations(
recurse = recursive,
)
for cur_pkg in closure:
if skip_excluded and __is_excluded(cur_pkg):
# Excluded modules contribute no dependencies
continue
for subsec in subsections:
section = 'pkg.' + rel_type + '.' + subsec
for deps_spec in app.read_dep_edges(cur_pkg, [section], flavour):
@ -81,6 +82,8 @@ def pkg_relations(
if dep_name in ignore or dep.full_name in ignore:
continue
if subsec == 'jw':
if skip_excluded and __is_excluded(dep_name):
continue
if hide_jw_pkg and dep_name == 'jw-pkg':
continue
expand_version_macros = subsec == 'jw'