Skip to content

build: nest snapshot build dir as build/<module>/<version> (#651) - #652

Merged
Ulrond merged 1 commit into
developfrom
feature/651-nested-snapshot-build-dir
Jul 5, 2026
Merged

build: nest snapshot build dir as build/<module>/<version> (#651)#652
Ulrond merged 1 commit into
developfrom
feature/651-nested-snapshot-build-dir

Conversation

@Ulrond

@Ulrond Ulrond commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Closes #651.

Snapshot/manifest builds wrote their CMake build tree to a flat build/<module>-<version> (e.g. build/audiodecoder-0.1.0.0), which doesn't match the nested source layout <module>/<version>/.

This nests the build output to mirror the source tree:

build/<module>-<version>build/<module>/<version>

e.g. build/audiodecoder/0.1.0.0, build/audiodecoder/0.2.0.0.

Single-line change to the SNAPSHOT_BUILD_DIR assignment in the snapshot-build path of build_modules.sh. Everything downstream (cmake -B, --build, --install, --clean rm) flows through that variable, so nothing else changes. build/current (whole-cohort) and build/binder keep their names.

bash -n build_modules.sh clean.

Mirror the source tree layout (<module>/<version>/) in the snapshot build
output. The CMake build tree for a released snapshot now lands at
build/<module>/<version> (e.g. build/audiodecoder/0.2.0.0) instead of the
flat build/<module>-<version>. Single-line change to SNAPSHOT_BUILD_DIR;
cmake -B/--build/--install and --clean all flow through it. build/current
and build/binder are unaffected.
Copilot AI review requested due to automatic review settings June 29, 2026 16:59
@github-project-automation github-project-automation Bot moved this to Architecture Review Required in halif_aidl Jun 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the snapshot/manifest build path in build_modules.sh so released-version (“snapshot”) CMake build trees are written under build/<module>/<version> instead of the previous flat build/<module>-<version>, aligning build output layout with the nested source layout <module>/<version>/.

Changes:

  • Change snapshot build directory from build/<module>-<version> to build/<module>/<version>.
Comments suppressed due to low confidence (1)

build_modules.sh:590

  • Now that SNAPSHOT_BUILD_DIR is constructed as "$ROOT_DIR/build/$MODULE/$VERSION", an unexpected VERSION like ".." will path-traverse (e.g. build//.. → build/) and make --clean remove the entire build tree. Since VERSION comes directly from --version and is only checked for a CMakeLists.txt in the resolved SNAPSHOT_DIR, this can succeed accidentally (or be abused) if $ROOT_DIR/CMakeLists.txt exists.

Please validate that VERSION is a single path segment (no '/' and no '..') before using it in SNAPSHOT_DIR/SNAPSHOT_BUILD_DIR.

    SNAPSHOT_BUILD_DIR="$ROOT_DIR/build/$MODULE/$VERSION"
    if [[ "$CLEAN" == true ]]; then
        echo "🧹 Cleaning snapshot build directory: $SNAPSHOT_BUILD_DIR"
        rm -rf "$SNAPSHOT_BUILD_DIR"
    fi

@Ulrond Ulrond self-assigned this Jul 3, 2026
@Ulrond Ulrond added this to the Next Release milestone Jul 3, 2026
@Ulrond Ulrond moved this from Architecture Review Required to Under Review in halif_aidl Jul 4, 2026
@Ulrond Ulrond added scope:infrastructure Repo tooling, CI/CD, scripts, governance docs Minor Change Additive, backwards-compatible interface change — bumps minor; the default for real work enhancement New feature or request labels Jul 4, 2026
@Ulrond
Ulrond merged commit 128f1a3 into develop Jul 5, 2026
5 checks passed
@Ulrond
Ulrond deleted the feature/651-nested-snapshot-build-dir branch July 5, 2026 08:31
@github-project-automation github-project-automation Bot moved this from Under Review to Resolved in halif_aidl Jul 5, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request Minor Change Additive, backwards-compatible interface change — bumps minor; the default for real work scope:infrastructure Repo tooling, CI/CD, scripts, governance docs

Projects

Status: Resolved

Development

Successfully merging this pull request may close these issues.

build: nest snapshot build dir as build/<module>/<version> to mirror source layout

2 participants