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