build(build.sh): add DRAGONX_BUILD_ROOT/DRAGONX_RELEASE_ROOT overrides

The release functions always built in build/<platform> and wrote to
release/<platform>. On Linux and macOS build/<platform> 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/<platform>) 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 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 06:05:06 -05:00
co-authored by Claude Opus 5.5
parent 22e3f104d6
commit 25ceb2cfe1
+6 -6
View File
@@ -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"