From 25ceb2cfe1cd6110622e05fb1036e5d4be75dc0d Mon Sep 17 00:00:00 2001 From: DanS Date: Sun, 11 Oct 2026 06:05:06 -0500 Subject: [PATCH] build(build.sh): add DRAGONX_BUILD_ROOT/DRAGONX_RELEASE_ROOT overrides The release functions always built in build/ and wrote to release/. On Linux and macOS build/ is also the dev build tree, so a release run reconfigures it (--linux-release turns a Lite+backend dev tree into a full-node one), and building a baseline to compare a change against meant overwriting the existing release/ artifacts. build_release_linux, build_release_win and build_release_mac now take their build and output roots from DRAGONX_BUILD_ROOT and DRAGONX_RELEASE_ROOT, defaulting to build/ and release/ as before: DRAGONX_BUILD_ROOT=/tmp/rel-build DRAGONX_RELEASE_ROOT=/tmp/rel \ ./build.sh --win-release With both unset nothing changes. The dev build (./build.sh) and the lite backend artifact dir (build/lite-backend/) do not read them. A full release set (Linux and Windows, full node and Lite) built into override roots left the release/ listings (file sizes and timestamps) and the dev tree's CMakeCache.txt unchanged (same checksums before and after). Known gaps: - the end-of-run summary still prints release/ as the output dir; - configuring a Windows build still writes res/ObsidianDragon.manifest into the source tree, so the last configured variant's version ends up there; - a fresh build root re-downloads the FetchContent dependencies and appimagetool, so it needs network access; - the macOS paths changed the same way but were not run here. Co-Authored-By: Claude Opus 5.5 --- build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 91049e3..74a9df5 100755 --- a/build.sh +++ b/build.sh @@ -363,8 +363,8 @@ build_dev() { # ═══════════════════════════════════════════════════════════════════════════════ build_release_linux() { header "Release: Linux x86_64" - local bd="$SCRIPT_DIR/build/linux" - local out="$SCRIPT_DIR/release/linux" + local bd="${DRAGONX_BUILD_ROOT:-$SCRIPT_DIR/build}/linux" + local out="${DRAGONX_RELEASE_ROOT:-$SCRIPT_DIR/release}/linux" if $CLEAN; then info "Cleaning $bd ..."; rm -rf "$bd" @@ -577,8 +577,8 @@ APPRUN # ═══════════════════════════════════════════════════════════════════════════════ build_release_win() { header "Release: Windows x86_64 (cross-compile)" - local bd="$SCRIPT_DIR/build/windows" - local out="$SCRIPT_DIR/release/windows" + local bd="${DRAGONX_BUILD_ROOT:-$SCRIPT_DIR/build}/windows" + local out="${DRAGONX_RELEASE_ROOT:-$SCRIPT_DIR/release}/windows" if $CLEAN; then info "Cleaning $bd ..."; rm -rf "$bd" @@ -1031,8 +1031,8 @@ build_release_mac() { fi header "Release: macOS ($MAC_ARCH$(${IS_CROSS} && echo ' — cross-compile'))" - local bd="$SCRIPT_DIR/build/mac" - local out="$SCRIPT_DIR/release/mac" + local bd="${DRAGONX_BUILD_ROOT:-$SCRIPT_DIR/build}/mac" + local out="${DRAGONX_RELEASE_ROOT:-$SCRIPT_DIR/release}/mac" if $CLEAN; then info "Cleaning $bd ..."; rm -rf "$bd"