diff --git a/build.sh b/build.sh index 5fe8ca6..07334be 100755 --- a/build.sh +++ b/build.sh @@ -119,11 +119,15 @@ fi # scripts/build-lite-backend-artifact.sh. Auto-discovers build/lite-backend//; # override the directory with DRAGONX_LITE_BACKEND_DIR. if $DO_LITE_BACKEND; then + # Artifact platform follows the cross target when exactly one non-host release is requested, + # so `--lite-backend --win-release` links the Windows backend (not the host's) automatically. case "$(uname -s)" in Linux) lb_platform="linux" ;; Darwin) lb_platform="macos" ;; *) lb_platform="linux" ;; esac + if $DO_WIN && ! $DO_LINUX && ! $DO_MAC; then lb_platform="windows"; fi + if $DO_MAC && ! $DO_LINUX && ! $DO_WIN; then lb_platform="macos"; fi lb_dir="${DRAGONX_LITE_BACKEND_DIR:-$SCRIPT_DIR/build/lite-backend/$lb_platform}" lb_lib="" for cand in "$lb_dir"/libsilentdragonxlite.a "$lb_dir"/libsilentdragonxlite.so "$lb_dir"/silentdragonxlite.lib; do @@ -145,7 +149,13 @@ if $DO_LITE_BACKEND; then "-DDRAGONX_LITE_BACKEND_ABI=sdxl-c-v1" ) [[ -f "$lb_manifest" ]] && CMAKE_LITE_ARGS+=("-DDRAGONX_LITE_BACKEND_MANIFEST=$lb_manifest") - info "Lite backend enabled: $lb_lib" + # A Rust x86_64-pc-windows-gnu staticlib pulls in Win32 system libs (rustls/schannel, ring, + # dirs, std) that the app doesn't already link. The set is rustc's `--print native-static-libs` + # for the backend (winapi_* shims mapped to the real mingw import libs); all exist in mingw-w64. + if [[ "$lb_platform" == "windows" ]]; then + CMAKE_LITE_ARGS+=("-DDRAGONX_LITE_BACKEND_EXTRA_LIBS=advapi32;ws2_32;kernel32;bcrypt;cfgmgr32;credui;crypt32;cryptnet;fwpuclnt;gdi32;msimg32;ncrypt;ntdll;ole32;opengl32;secur32;shell32;synchronization;user32;winspool;userenv") + fi + info "Lite backend enabled ($lb_platform): $lb_lib" fi should_bundle_full_node_assets() { diff --git a/docs/lite-wallet-implementation-plan-v2-2026-06-04.md b/docs/lite-wallet-implementation-plan-v2-2026-06-04.md index 4a04fba..4d9625c 100644 --- a/docs/lite-wallet-implementation-plan-v2-2026-06-04.md +++ b/docs/lite-wallet-implementation-plan-v2-2026-06-04.md @@ -147,7 +147,7 @@ Each milestone is independently demoable and gated by a fake-backend test. Order - Runtime kill-switch / feature flag / staged rollout. - **Exit demo / test:** A downloadable `ObsidianDragonLite` that creates, syncs, sends, and persists against a real backend. -**Status (2026-06-05): M5a (durability) DONE; Linux release packaging VERIFIED; rest of M5b (CI/signing/macOS/rollout) pending.** +**Status (2026-06-05): M5a (durability) DONE; Linux + Windows release packaging VERIFIED; rest of M5b (CI/signing/macOS/rollout) pending.** Verified against the SDXL Rust source that the backend auto-saves only on new-address / import / rescan — it does **NOT** save after `sync`, `send`, or `shield`, and `litelib_shutdown` only sets a flag (no save). So without intervention a first sync (~30 min) and any sent tx are lost on restart. The controller now triggers `save` at exactly those points: - after the detached `sync` completes (before `syncDone_` is set, so a `syncComplete()` observer sees a persisted wallet); - after a successful `send` / `shield` (skipped on failure); @@ -156,7 +156,11 @@ Verified against the SDXL Rust source that the backend auto-saves only on new-ad Crash/recovery of the wallet *file* (the `.dat`/`.dat.bak` rotation) is already handled inside the backend. Tests: `testLiteWalletControllerM5Persistence` proves saves fire after sync/send/shield and `saveWallet()`, and do NOT fire on a failed send or with no wallet open (fake tracks a save counter). **Linux release packaging VERIFIED (2026-06-05).** `./build.sh --lite-backend --linux-release` produces `release/linux/ObsidianDragonLite--Linux-x64.zip` + `.AppImage` with the SDXL backend linked statically into the binary. Confirmed the lite bundle correctly **excludes** all full-node assets (no `dragonxd`, `dragonx-cli`, `sapling-spend.params`, `sapling-output.params`, `asmap.dat`) and includes `res/` + `xmrig` (pool mining, which works in lite — xmrig connects to `pool.dragonx.is`, no local daemon needed). `release/` is gitignored. (CMake falls back to FetchContent SDL3 when system SDL3 is absent, so no system-SDL3 prerequisite for the build to succeed.) -- **Pending (M5b):** Windows/macOS release packaging, CI backend-artifact build + signing (per `lite-wallet-backend-signing-policy`), dynamic-loader sublane, runtime kill-switch/staged rollout, and end-to-end error/retry UX. Mostly build/CI/infra + GUI, not unit-verifiable here. +**Windows release packaging VERIFIED (2026-06-05).** Cross-compiled end to end on Linux: +1. `./scripts/build-lite-backend-artifact.sh --platform windows` cross-builds the SDXL backend to `x86_64-pc-windows-gnu` (`build/lite-backend/windows/libsilentdragonxlite.a`, ~105 MB). The rustls/ring TLS stack cross-compiles cleanly — no openssl blocker. +2. `./build.sh --lite-backend --win-release` now auto-selects the Windows artifact and links the Win32 system libs the Rust staticlib needs (derived from `rustc --print native-static-libs`: advapi32, ws2_32, kernel32, bcrypt, cfgmgr32, credui, crypt32, cryptnet, fwpuclnt, gdi32, msimg32, ncrypt, ntdll, ole32, opengl32, secur32, shell32, synchronization, user32, winspool, userenv — all present in mingw-w64). Produces `release/windows/ObsidianDragonLite-.exe` (standalone, INCBIN-embedded resources, ~170 MB) + `…-Windows-x64.zip`, verified `PE32+ executable (GUI) x86-64` with the same full-node-asset exclusion as Linux. **Runtime smoke on real Windows is still untested (cross-compiled on Linux; no Wine/Windows run yet).** + +- **Pending (M5b):** runtime test of the Windows `.exe` on real Windows; macOS release packaging; CI backend-artifact build + signing (per `lite-wallet-backend-signing-policy`); dynamic-loader sublane; runtime kill-switch/staged rollout; end-to-end error/retry UX. Mostly build/CI/infra + GUI, not unit-verifiable here. ## What we explicitly drop from the v1 plan