App.__get_project_refs(): Fix broken detection of missing build dependencies #94

Merged
Jan Lindemann merged 4 commits from jan/fix/20260910-broken-detection-of-missing-build-dependencies into master 2026-09-10 13:15:30 +02:00 AGit
Showing only changes of commit a269631e92 - Show all commits

CmdBuild.run_make(): Skip projects without buildable dir

The iteration order contains every project the dependency walk resolved,
including projects that are only installed as -devel packages below /opt.
Running the target in such a project ran make in a read-only, source-less
directory and failed the run.

Resolve each module against the workspace root only, and skip the target
with a notice when there is no buildable project directory. Factor the skip
notice into log_skip() so the platform-exclusion path shares it.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Jan Lindemann 2026-09-06 17:19:06 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -94,6 +94,14 @@ class CmdBuild(Cmd): # export
@override
async def _run(self, args: Namespace) -> None:
@lru_cache(maxsize = None)
def proj_dir(module: str) -> str | None:
return self.app.find_dir(
module,
pretty = False,
projs_roots = [self.app.projs_root],
)
@lru_cache(maxsize = None)
def read_deps(cur: str, dep_flavour: str) -> list[str]:
# dep cache doesn't make a difference at all
@ -172,20 +180,27 @@ class CmdBuild(Cmd): # export
dep_tree[k].remove(d)
return 1
def log_skip(module: str, msg: str) -> None:
title = f'---- {module}'
log(NOTICE, f',{title} >')
log(NOTICE, f'| {msg}<')
log(NOTICE, f'`{title} <')
async def run_make(
module: str, target: str, cur_project: int, num_projects: int
) -> None:
patt = self.app.is_excluded_from_build(module)
if patt is not None:
title = f'---- {module}'
log(NOTICE, f',{title} >')
log(NOTICE, f'| Configured to skip build on platform >{patt}<')
log(NOTICE, f'`{title} <')
log_skip(module, f'Configured to skip build on platform >{patt}<')
return
wd = proj_dir(module)
if wd is None:
log_skip(module, 'Skipping: No buildable project directory')
return
make_cmd = ['make', target]
wd = self.app.find_dir(module, pretty = False)
title = '---- [%d/%d]: Running "%s" in %s -' % (
cur_project,
num_projects,