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

This PR adds a series of commits leading up to cleaner detection of missing build dependencies.

App.find_dir(): Allow restricting the project roots

find_dir() and its helpers resolve a project name against the workspace root and /opt. The build iteration needs to resolve a module against the workspace only, to tell buildable projects apart from installed ones.

Add a projs_roots parameter to find_dir(), __find_dir() and __proj_dir() that restricts the search to the given roots. With the parameter omitted the previous behavior is unchanged.

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.

App.is_installed(): Add method

The installed state of a project is judged by the proofs of installation, which differ per subpackage: make/project.conf in the dev tree or /opt proves the -devel package or a buildable checkout, a VERSION file in the project directory or /usr/share/doc/packages the -run package.

Add is_installed(), which answers the proof question for a given subpackage by searching the per-subpackage locations.

App.__get_project_refs(): Fix recursion stop conditions

App.__get_project_refs() recurses into the package dependency graph, but the recursion end conditions only work well if all required packages are present. Whether a required package is installed or not is decided upon a wrong condition, however - existence of the project's project directory, which may or may not be misleading for both the -devel and the -run requirements. This can lead to various unwanted outcomes: Missing packages happily inserted into the recursion buffer, process termination instead of recursion stop, path lookup errors instead of a clearer "unmet dependency" message (No project path found for module xyz, Failed to find directory of project foo).

This commit cleanly detects if -run or -devel are installed and makes the walk stop or raise under the appropriate conditions:

  1. -run missing but required, raises unmet dependency
  2. -devel missing but required, raises unmet dependency
  3. -run present, no -devel required, stop recursing
This PR adds a series of commits leading up to cleaner detection of missing build dependencies. #### App.find_dir(): Allow restricting the project roots find_dir() and its helpers resolve a project name against the workspace root and /opt. The build iteration needs to resolve a module against the workspace only, to tell buildable projects apart from installed ones. Add a projs_roots parameter to find_dir(), __find_dir() and __proj_dir() that restricts the search to the given roots. With the parameter omitted the previous behavior is unchanged. #### 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. #### App.is_installed(): Add method The installed state of a project is judged by the proofs of installation, which differ per subpackage: make/project.conf in the dev tree or /opt proves the -devel package or a buildable checkout, a VERSION file in the project directory or /usr/share/doc/packages the -run package. Add is_installed(), which answers the proof question for a given subpackage by searching the per-subpackage locations. #### App.__get_project_refs(): Fix recursion stop conditions App.__get_project_refs() recurses into the package dependency graph, but the recursion end conditions only work well if all required packages are present. Whether a required package is installed or not is decided upon a wrong condition, however - existence of the project's project directory, which may or may not be misleading for both the -devel and the -run requirements. This can lead to various unwanted outcomes: Missing packages happily inserted into the recursion buffer, process termination instead of recursion stop, path lookup errors instead of a clearer "unmet dependency" message (No project path found for module xyz, Failed to find directory of project foo). This commit cleanly detects if -run or -devel are installed and makes the walk stop or raise under the appropriate conditions: 1. -run missing but required, raises unmet dependency 2. -devel missing but required, raises unmet dependency 3. -run present, no -devel required, stop recursing
find_dir() and its helpers resolve a project name against the workspace
root and /opt. The build iteration needs to resolve a module against the
workspace only, to tell buildable projects apart from installed ones.

Add a projs_roots parameter to find_dir(), __find_dir() and __proj_dir()
that restricts the search to the given roots. With the parameter omitted
the previous behavior is unchanged.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
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
The installed state of a project is judged by the proofs of installation,
which differ per subpackage: make/project.conf in the dev tree or /opt
proves the -devel package or a buildable checkout, a VERSION file in the
project directory or /usr/share/doc/packages the -run package.

Add is_installed(), which answers the proof question for a given subpackage
by searching the per-subpackage locations.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
App.__get_project_refs(): Fix recursion stop conditions
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 4m22s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 4m25s
CI / Packaging test (pull_request) Failing after 0s
c52453dc68
App.__get_project_refs() recurses into the package dependency graph, but
the recursion end conditions only work well if all required packages are
present. Whether a required package is installed or not is decided upon a
wrong condition, however - existence of the project's project directory,
which may or may not be misleading for both the -devel and the -run
requirements. This can lead to various unwanted outcomes: Missing packages
happily inserted into the recursion buffer, process termination instead of
recursion stop, path lookup errors instead of a clearer "unmet dependency"
message (No project path found for module xyz, Failed to find directory of
project foo).

This commit cleanly detects if -run or -devel are installed and makes the
walk stop or raise under the appropriate conditions:

1. -run missing but required, raises unmet dependency
2. -devel missing but required, raises unmet dependency
3. -run present, no -devel required, stop recursing

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-09-10 11:44:28 +02:00
Jan Lindemann force-pushed jan/fix/20260910-broken-detection-of-missing-build-dependencies from c52453dc68
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 4m22s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 4m25s
CI / Packaging test (pull_request) Failing after 0s
to 2ae101d93b
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m30s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m37s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m10s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m34s
CI / Packaging test (push) Successful in 0s
2026-09-10 13:06:17 +02:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!94
No description provided.