fix(build): auto-resolve snapshot dependency closure (#638) - #655
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes fresh-checkout snapshot builds (non-current --version) by ensuring the dependency closure is built first and snapshot headers are staged so downstream snapshot builds can find required headers/libs (e.g., com/rdk/hal/PropertyValue.h from common).
Changes:
- Added
snapshot_deps()to infer snapshot dependencies by parsing${HALIF_INCLUDE_DIR}/<comp>/<ver>/includereferences in snapshotCMakeLists.txt. - Added recursive dependency builds for snapshots prior to configuring/building the requested snapshot.
- Added
stage_snapshot_headers()to copy each snapshot’s committedinclude/tree intoout/build/includeafter a successful snapshot build.
Collaborator
Author
|
Addressed the review note on the smoke_test table: defined the |
Ulrond
added a commit
that referenced
this pull request
Jul 4, 2026
…eview)
- Define the <c> (component) and <v> (version) placeholders above the table.
- Reframe the dependency-closure row as a variant precondition ('the same
build, but with <c>'s dependency snapshots deleted first') so it no longer
reads as a duplicate of the row above.
- Add the 'builds' verb and fix 'dependencies'' -> 'each dependency's'.
Ulrond
added a commit
that referenced
this pull request
Jul 4, 2026
Copilot review: - snapshot_deps: guard the grep so a snapshot with no HAL deps (grep exit 1) doesn't trip set -o pipefail — an empty dep list is normal, not an error. - stage_snapshot_headers: fail (return 1) on mkdir/cp error instead of silently succeeding and leaving dependents to fail later on missing headers. - caller: check stage_snapshot_headers' status and exit non-zero on failure.
A standalone snapshot build (e.g. ./build_modules.sh videosink --version
0.2.0.0) failed on a fresh checkout with 'com/rdk/hal/PropertyValue.h: No
such file or directory': the single-snapshot path assumed dependency headers
were already staged in out/build/include and dependency libraries already
installed, which only the 'manifest' path arranged. On a clean tree neither
exists, so the compile (and then the link) failed.
Resolve the dependency closure before building the target:
- snapshot_deps() reads the (comp, ver) pairs the snapshot already declares
via its ${HALIF_INCLUDE_DIR}/<comp>/<ver>/include references in
CMakeLists.txt — no new metadata.
- Each dependency is built via a recursive build_modules.sh invocation, so
transitive deps resolve and an already-built dependency is skipped (the
common-diamond builds once).
- stage_snapshot_headers() copies each snapshot's committed include/ tree
into out/build/include after a successful build, so dependents resolve it.
Verified: from a wiped closure, 'build_modules.sh videosink --version 0.2.0.0'
builds common -> avclock/videodecoder -> videosink, staging all headers and
producing all four lib*-v0.2.0.0-cpp.so.
Steps 1-4 leave out/build/include + out/target fully populated, so the per-version snapshot step never proves a standalone build can stand up its own dependencies — exactly the gap that hid #638. Add step 5: pick the first released snapshot that declares HAL dependencies, wipe that snapshot and its dependencies' staged headers + libraries + build dirs, then build ONLY that snapshot and assert every closure library is rebuilt and each dependency's headers are re-staged. Documents all build paths in tests/README.md. Verified: full suite 6/6 pass; step 5 wipes audiodecoder/0.1.0.0's common 0.1.0.0 dep and confirms it is auto-resolved.
…eview)
- Define the <c> (component) and <v> (version) placeholders above the table.
- Reframe the dependency-closure row as a variant precondition ('the same
build, but with <c>'s dependency snapshots deleted first') so it no longer
reads as a duplicate of the row above.
- Add the 'builds' verb and fix 'dependencies'' -> 'each dependency's'.
Copilot review: - snapshot_deps: guard the grep so a snapshot with no HAL deps (grep exit 1) doesn't trip set -o pipefail — an empty dep list is normal, not an error. - stage_snapshot_headers: fail (return 1) on mkdir/cp error instead of silently succeeding and leaving dependents to fail later on missing headers. - caller: check stage_snapshot_headers' status and exit non-zero on failure.
Ulrond
force-pushed
the
feature/638-snapshot-dep-resolution
branch
from
July 5, 2026 08:32
0bb7a5b to
0ed48e8
Compare
Copilot stopped reviewing on behalf of
Ulrond due to an error
July 5, 2026 08:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #638.
Problem
./build_modules.sh videosink --version 0.2.0.0fails on a fresh checkout withfatal error: com/rdk/hal/PropertyValue.h: No such file or directory. The single-module snapshot path assumed its dependency headers were already staged inout/build/includeand dependency libraries already installed inout/target/lib/halif— but only themanifestpath arranged that. On a clean tree the compile fails (missing header), and even with headers the link would fail (missinglib<dep>-v<ver>-cpp.so). It "worked" only for anyone who had already run a full/manifest build.Fix
Resolve the dependency closure before building the requested snapshot:
snapshot_deps()reads the(comp, ver)pairs the snapshot already declares via its${HALIF_INCLUDE_DIR}/<comp>/<ver>/includereferences inCMakeLists.txt— no new metadata.build_modules.shinvocation, so transitive deps resolve and an already-built dependency is skipped (thecommondiamond builds once).stage_snapshot_headers()copies each snapshot's committedinclude/tree intoout/build/includeafter a successful build, so dependents resolve it.Test
From a wiped closure (removed staged headers + libs + build dirs for videosink/videodecoder/avclock/common 0.2.0.0):
Result: all four
lib*-v0.2.0.0-cpp.soproduced and all four header trees staged (incl.common/.../PropertyValue.h).bash -nclean.