build: nest snapshot build dir as build/<module>/<version> (#651) - #652
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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>tobuild/<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
--cleanremove the entire build tree. Since VERSION comes directly from--versionand is only checked for a CMakeLists.txt in the resolved SNAPSHOT_DIR, this can succeed accidentally (or be abused) if$ROOT_DIR/CMakeLists.txtexists.
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
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 #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_DIRassignment in the snapshot-build path ofbuild_modules.sh. Everything downstream (cmake -B,--build,--install,--cleanrm) flows through that variable, so nothing else changes.build/current(whole-cohort) andbuild/binderkeep their names.bash -n build_modules.shclean.