diff --git a/scripts/release.ts b/scripts/release.ts index bbc2052..cdaefee 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -63,6 +63,13 @@ function selectRustupToolchain(env: NodeJS.ProcessEnv) { stdio: ['ignore', 'pipe', 'ignore'], }).trim(); env.PATH = `${path.dirname(cargo)}${path.delimiter}${env.PATH ?? ''}`; + + if (process.platform === 'darwin') { + const libDir = path.join(path.dirname(path.dirname(cargo)), 'lib'); + env.DYLD_FALLBACK_LIBRARY_PATH = [libDir, env.DYLD_FALLBACK_LIBRARY_PATH] + .filter(Boolean) + .join(path.delimiter); + } } catch { // Fall back to the cargo already on PATH. } @@ -81,6 +88,14 @@ function hasRustTarget(target: string, env: NodeJS.ProcessEnv): boolean { } } +function configureCrossWindowsLinker(env: NodeJS.ProcessEnv) { + // Microsoft's prebuilt CRT libraries reference PDBs that are not shipped + // with cargo-xwin, so lld-link emits LNK4099 for every library. The debug + // info is unavailable either way, so suppress only that specific warning. + const key = 'CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS'; + env[key] = [env[key], '-C', 'link-arg=/ignore:4099'].filter(Boolean).join(' '); +} + function windowsPrerequisites(env: NodeJS.ProcessEnv): string[] { const missing: string[] = []; @@ -161,8 +176,7 @@ function run(command: string, args: string[], env: NodeJS.ProcessEnv): Promise { console.log(`\n$ ${command} x --bun vite build`); @@ -259,6 +273,8 @@ if (target === 'windows' && host !== 'windows') { for (const requirement of missing) console.error(` - ${requirement}`); process.exit(1); } + + configureCrossWindowsLinker(env); } const tauriArgs = ['x', 'tauri', 'build']; diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index c96a680..0f61a64 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -397,6 +397,8 @@ pub async fn installation_diagnostics(app: AppHandle, folder: String) -> Install .map(patcher_file_stats) .unwrap_or_default(); + // macOS fills in the Wine and FFmpeg fields below. + #[cfg_attr(not(target_os = "macos"), allow(unused_mut))] let mut diagnostics = InstallationDiagnostics { platform: std::env::consts::OS.to_string(), os_version: System::long_os_version(),