Download sidecar on first launch instead of bundling
Major refactor: sidecar is no longer bundled in the installer. Instead,
it's downloaded on first launch with a setup screen offering CPU vs CUDA
choice. This solves the 2GB+ installer size limit and decouples app/sidecar.
Backend:
- New commands: check_sidecar, download_sidecar, check_sidecar_update
- Streaming download with progress events via reqwest
- Added reqwest + futures-util dependencies
- Removed sidecar.zip from bundle resources
- Restored NSIS target (no longer size-constrained)
CI:
- Each platform builds both CPU and CUDA sidecar variants (except macOS: CPU only)
- Sidecar zips uploaded as separate release assets
- Asset naming: sidecar-{os}-{arch}-{variant}.zip
Frontend:
- SidecarSetup.svelte: first-launch setup with CPU/CUDA radio choice,
progress bar, error/retry handling
- Update banner on launch if newer sidecar version available
- Conditional rendering: setup screen → main app flow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ use crate::sidecar::messages::IPCMessage;
|
||||
/// Resource directory set by the Tauri app during setup.
|
||||
static RESOURCE_DIR: OnceLock<PathBuf> = OnceLock::new();
|
||||
/// App data directory for extracting the sidecar archive.
|
||||
static DATA_DIR: OnceLock<PathBuf> = OnceLock::new();
|
||||
pub(crate) static DATA_DIR: OnceLock<PathBuf> = OnceLock::new();
|
||||
|
||||
/// Initialize directories for sidecar resolution.
|
||||
/// Must be called from the Tauri setup before any sidecar operations.
|
||||
@@ -136,7 +136,7 @@ impl SidecarManager {
|
||||
}
|
||||
|
||||
/// Extract a zip archive to the given directory.
|
||||
fn extract_zip(zip_path: &Path, dest: &Path) -> Result<(), String> {
|
||||
pub(crate) fn extract_zip(zip_path: &Path, dest: &Path) -> Result<(), String> {
|
||||
eprintln!(
|
||||
"[sidecar-rs] Extracting sidecar from {} to {}",
|
||||
zip_path.display(),
|
||||
@@ -185,7 +185,7 @@ impl SidecarManager {
|
||||
|
||||
/// Remove old sidecar-* directories that don't match the current version.
|
||||
/// Called after the current version's sidecar is confirmed ready.
|
||||
fn cleanup_old_sidecars(data_dir: &Path, current_version: &str) {
|
||||
pub(crate) fn cleanup_old_sidecars(data_dir: &Path, current_version: &str) {
|
||||
let current_dir_name = format!("sidecar-{}", current_version);
|
||||
|
||||
let entries = match std::fs::read_dir(data_dir) {
|
||||
|
||||
Reference in New Issue
Block a user