Skip to content

flare-winui,packaging,ci: preserve pool settings in desktop bridge, test bridge in CI, and ship Windows flare.exe - #730

Merged
lukealonso merged 1 commit into
mainfrom
fix/windows-release-bridge-and-cli
Dec 4, 2026
Merged

lukealonso merged 1 commit into
mainfrom
fix/windows-release-bridge-and-cli

Conversation

@lukealonso

Copy link
Copy Markdown
Collaborator

Why

Commit 45e1c1ad (#711) added pool_vram_memory and pool_ram_memory to flare::settings::RuntimeSettings in flare/src/runtime_settings.rs. Because runtime_input in flare-winui/bridge/src/lib.rs initializes RuntimeSettings with an exhaustive struct literal, both Windows release jobs (windows-2025 amd64 and windows-11-arm arm64) failed to compile flare-winui-bridge in the v0.6.0 Release run (47278490367), preventing publication.

Pull-request CI in .github/workflows/native-serving.yml did not catch the break because it tested eos, selene, selene-manager, helios, flare, and flare-cli without compiling or testing flare-winui/bridge.

Separately, the Windows release archives (flare-windows-amd64.zip and flare-windows-arm64.zip) shipped only the single-file desktop launcher as Flare.exe without the Windows CLI executable. Including flare.exe in the same flare/ archive directory requires a distinct executable name for the desktop launcher because Windows filesystems are case-insensitive.

What changed

  • Preserve pool memory settings in the desktop bridge (flare-winui/bridge/src/lib.rs):
    • Previously, runtime_input built flare::settings::RuntimeSettings solely from FlareRuntimeSettings and omitted pool_vram_memory and pool_ram_memory.
    • flare_app_set_runtime_settings now reads controller.snapshot().runtime_settings and passes it to runtime_input, which clones the existing pool_vram_memory and pool_ram_memory values instead of changing the FlareRuntimeSettings C ABI or adding WinUI Settings controls.
    • Extended runtime_settings_abi_tests to verify ABI round-trip preservation and added set_runtime_settings_preserves_unexposed_pool_memory_fields, which exercises flare_app_create through flare_app_set_runtime_settings against a desktop-state.json containing pool limits and confirms both fields remain intact after saving another setting.
  • Test the desktop bridge in PR CI and local Windows checks (.github/workflows/native-serving.yml, scripts/dev_windows.ps1, AGENTS.md):
    • Added cargo test --locked --release --manifest-path flare-winui/bridge/Cargo.toml --target-dir flare-cli/target to both the Linux (ubuntu-24.04) and Windows (windows-2022) jobs in Native serving, to scripts/dev_windows.ps1 -Action Test, and to the crate test list in AGENTS.md.
  • Rename the single-file desktop launcher and bundle flare.exe in Windows release archives (flare-winui/package-single-file.ps1, flare-winui/build.ps1, packaging/archive.py, packaging/licenses.py, third_party/rust/):
    • Renamed the single-file launcher output from Flare.exe to flare-app.exe (the launcher resolves its own path via std::env::current_exe() for taskbar relaunch metadata).
    • Changed packaging/archive.py from selecting CLI-only or desktop-only via --winui-packages to accepting --binary (CLI, staged as flare or flare.exe) and --desktop-binary paired with --winui-packages (desktop launcher, staged as flare-app.exe). CLI-only invocations remain unchanged; passing both flags produces a Windows release archive containing flare/flare.exe, flare/flare-app.exe, merged Rust dependency notices across flare-cli/Cargo.toml, flare-winui/bridge/Cargo.toml, and flare-winui/launcher/Cargo.toml, Rust standard library notices, and NuGet notices.
    • Added aarch64-pc-windows-msvc to TARGETS in packaging/licenses.py and regenerated third_party/rust/ (adding windows-sys 0.52.0 and windows_aarch64_msvc 0.52.6/0.53.1).
    • Added tests/cli/test_release_archive.py covering argument validation, CLI-only Linux/Windows archive layouts, and combined Windows release archive layouts for both x86_64-pc-windows-msvc and aarch64-pc-windows-msvc.
  • Build and verify both executables in Windows releases (.github/workflows/release.yml):
    • Added a Build the CLI step to the Windows matrix (windows-2025 amd64 and windows-11-arm arm64) that builds flare-cli/Cargo.toml --bin flare with +crt-static into the shared $localDev\winui-target directory already populated by flare-winui/bridge.
    • Updated packaging to pass both --binary and --desktop-binary to packaging/archive.py.
    • Extended archive verification to run flare.exe from an isolated directory containing no other files: dumpbin /nologo /dependents rejects dynamic Visual C++ runtime DLL imports (vcruntime*, msvcp*, concrt*, vcomp*), flare.exe --version must print flare <VERSION>, run/download/models --help must succeed, and flare.exe agent must exit non-zero, followed by the existing flare-app.exe startup check.
  • Documentation (docs/release.md, docs/windows.md, flare-winui/README.md, flare-winui/Assets/README.md, THIRD_PARTY_NOTICES.md, docs/TODO.txt):
    • Updated executable names (Flare.exe -> flare-app.exe), Windows archive contents, notice inventory targets, and qualification status.

Claimed benefit and result

  • Measured on Linux x86_64: flare-winui-bridge compiles cleanly against flare::settings::RuntimeSettings, passes all 12 unit/C-ABI tests (including preserving pre-existing pool_vram_memory and pool_ram_memory across flare_app_set_runtime_settings), and packaging/archive.py produces combined Windows release zips for both x86_64-pc-windows-msvc and aarch64-pc-windows-msvc with merged Rust and NuGet notices.
  • Expected on GitHub Actions: PR CI in Native serving will fail immediately if future flare changes break flare-winui-bridge on Linux or Windows, and Release will publish both static-CRT flare.exe and flare-app.exe inside flare-windows-amd64.zip and flare-windows-arm64.zip.

Supporting evidence and limitations

Validated on Linux x86_64 CPU at commit 88fae186:

  • cargo test --locked --release --manifest-path flare-winui/bridge/Cargo.toml --target-dir flare-cli/target: 12 passed, 0 failed (including runtime_settings_abi_copies_options_and_borrows_only_snapshot_output and set_runtime_settings_preserves_unexposed_pool_memory_fields).
  • cargo test --locked --release --manifest-path flare/Cargo.toml --target-dir flare-cli/target --tests: 255 passed (247 unit, 7 packed_canonical_download, 1 reference_workflows), 0 failed, 4 ignored. Two earlier parallel unit-test runs each encountered one transient localhost unexpected request / failure in hub::tests (a_killed_acquisition_resumes_the_partial_and_reuses_completed_files and warm_download_repairs_corrupt_entry_from_signed_source), both passing on immediate re-run.
  • cargo test --locked --release --manifest-path flare-cli/Cargo.toml: 250 passed (224 unit, 9 cache_commands, 6 cli, 4 inspect, 7 unverified_payload), 0 failed, 3 ignored.
  • python3 packaging/licenses.py: regenerated third_party/rust/ cleanly across all four CLI targets (373 crates).
  • pytest tests/cli tests/preparation/test_packaging.py: 213 passed, 0 failed (including tests/cli/test_release_archive.py using placeholder executables and fixture NuGet notice files).
  • python3 scripts/set_release_version.py --check 0.0.0 and YAML parsing of .github/workflows/native-serving.yml and .github/workflows/release.yml passed.

Material limitations and unrun checks:

  • Windows builds and checks on GitHub-hosted windows-2025 and windows-11-arm runners—including static-CRT linking of flare.exe, dumpbin /dependents output verification, flare-app.exe launch and window checks, and workflow_dispatch or tag publication—have not run yet.

…est bridge in CI, and ship Windows flare.exe

Why:
Adding pool_vram_memory and pool_ram_memory to flare::settings::RuntimeSettings
broke flare-winui-bridge compilation on tag v0.6.0 because runtime_input in
flare-winui/bridge/src/lib.rs constructs RuntimeSettings with an exhaustive
struct literal. Pull-request CI in .github/workflows/native-serving.yml missed
the failure because it never built or tested flare-winui/bridge. Separately,
the Windows release archives (flare-windows-amd64.zip and
flare-windows-arm64.zip) shipped only the desktop launcher as Flare.exe without
the Windows CLI executable, and keeping the desktop launcher named Flare.exe
would collide with flare.exe on Windows's case-insensitive filesystem.

What changed:
- flare-winui/bridge/src/lib.rs: updated runtime_input to accept the active
  RuntimeSettings from Controller::snapshot() when called by
  flare_app_set_runtime_settings, retaining existing pool_vram_memory and
  pool_ram_memory values instead of omitting them or adding fields to the C ABI
  and desktop UI. Extended runtime_settings_abi_tests with ABI round-trip and
  end-to-end C-bridge persistence tests.
- .github/workflows/native-serving.yml, scripts/dev_windows.ps1, AGENTS.md:
  added `cargo test --locked --release --manifest-path
  flare-winui/bridge/Cargo.toml --target-dir flare-cli/target` to the Linux and
  Windows CI jobs and to the Windows development test runner.
- flare-winui/package-single-file.ps1, flare-winui/build.ps1,
  packaging/archive.py, packaging/licenses.py, third_party/rust/: renamed the
  single-file desktop launcher output from Flare.exe to flare-app.exe; changed
  packaging/archive.py from desktop-or-CLI selection via --winui-packages to
  accepting --binary (CLI) and --desktop-binary paired with --winui-packages,
  allowing Windows release archives to bundle both flare/flare.exe and
  flare/flare-app.exe with merged Rust notices from flare-cli,
  flare-winui/bridge, and flare-winui/launcher plus NuGet notices while keeping
  CLI-only archive invocations unchanged; added aarch64-pc-windows-msvc to
  packaging/licenses.py TARGETS and regenerated third_party/rust/.
- .github/workflows/release.yml: extended the Windows amd64 and arm64 jobs to
  compile flare-cli with +crt-static in the shared winui-target directory,
  package both flare.exe and flare-app.exe, and verify flare.exe from an
  isolated directory (dumpbin check for no dynamic VC++ runtime imports,
  --version, subcommand --help, and rejection of `flare agent`) before running
  the flare-app.exe startup check.
- tests/cli/test_release_archive.py: added argument-validation, CLI-only, and
  combined Windows archive layout tests for packaging/archive.py.
- docs/release.md, docs/windows.md, flare-winui/README.md,
  flare-winui/Assets/README.md, THIRD_PARTY_NOTICES.md, docs/TODO.txt: replaced
  Flare.exe references with flare-app.exe and updated Windows archive contents,
  notice coverage, and qualification statements.

Claimed result:
Restores flare-winui-bridge compilation while preserving pre-existing
pool_vram_memory and pool_ram_memory overrides across desktop saves, catches
future flare API breaks against flare-winui-bridge in pull-request CI on both
Linux and Windows, and is expected to ship both static-CRT flare.exe and
flare-app.exe in flare-windows-amd64.zip and flare-windows-arm64.zip.

Evidence (Linux x86_64 CPU):
- cargo test --locked --release --manifest-path flare-winui/bridge/Cargo.toml
  --target-dir flare-cli/target: 12 passed, 0 failed (including
  runtime_settings_abi_copies_options_and_borrows_only_snapshot_output and
  set_runtime_settings_preserves_unexposed_pool_memory_fields).
- cargo test --locked --release --manifest-path flare/Cargo.toml
  --target-dir flare-cli/target --tests: 255 passed (247 lib, 7
  packed_canonical_download, 1 reference_workflows), 0 failed, 4 ignored; two
  earlier parallel lib runs each hit a transient localhost `unexpected request
  /` failure in hub::tests that passed on immediate re-run.
- cargo test --locked --release --manifest-path flare-cli/Cargo.toml: 250
  passed, 0 failed, 3 ignored.
- python3 packaging/licenses.py regenerated third_party/rust/ across all four
  CLI targets (373 crates, adding windows-sys 0.52.0 and
  windows_aarch64_msvc 0.52.6/0.53.1).
- pytest tests/cli tests/preparation/test_packaging.py: 213 passed, 0 failed
  (including test_release_archive.py covering combined Windows archives for
  x86_64-pc-windows-msvc and aarch64-pc-windows-msvc with placeholder binaries
  and fixture NuGet notices).
- python3 scripts/set_release_version.py --check 0.0.0 and YAML parsing of
  .github/workflows/{native-serving,release}.yml passed.

Limitations:
Windows builds and checks on GitHub-hosted windows-2025 and windows-11-arm
runners—including static-CRT linking of flare.exe, dumpbin inspection,
flare-app.exe startup, and workflow_dispatch or release publication—were not
executed on this Linux host.

Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
Signed-off-by: Luke Alonso <lalonso@gmail.com>
@lukealonso
lukealonso merged commit 22d2ac9 into main Dec 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant