WIP: Themes v2 #24

Draft
HorizonCode wants to merge 71 commits from themes-v2 into master
pull from: themes-v2
2 changed files with 20 additions and 2 deletions
Showing only changes of commit e1c04c4f5b - Show all commits

No files matched your search

+18 -2
View File
@@ -63,6 +63,13 @@ function selectRustupToolchain(env: NodeJS.ProcessEnv) {
stdio: ['ignore', 'pipe', 'ignore'], stdio: ['ignore', 'pipe', 'ignore'],
}).trim(); }).trim();
env.PATH = `${path.dirname(cargo)}${path.delimiter}${env.PATH ?? ''}`; 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 { } catch {
// Fall back to the cargo already on PATH. // 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[] { function windowsPrerequisites(env: NodeJS.ProcessEnv): string[] {
const missing: string[] = []; const missing: string[] = [];
@@ -161,8 +176,7 @@ function run(command: string, args: string[], env: NodeJS.ProcessEnv): Promise<v
/** /**
* Vite's static-adapter build can leave the process alive after writing the * Vite's static-adapter build can leave the process alive after writing the
* output. Stop it once the adapter confirms the build is complete, matching * output. Stop it once the adapter confirms the build is complete.
* the behavior of scripts/build.ts.
*/ */
function buildFrontend(command: string, env: NodeJS.ProcessEnv): Promise<void> { function buildFrontend(command: string, env: NodeJS.ProcessEnv): Promise<void> {
console.log(`\n$ ${command} x --bun vite build`); 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}`); for (const requirement of missing) console.error(` - ${requirement}`);
process.exit(1); process.exit(1);
} }
configureCrossWindowsLinker(env);
} }
const tauriArgs = ['x', 'tauri', 'build']; const tauriArgs = ['x', 'tauri', 'build'];
+2
View File
@@ -397,6 +397,8 @@ pub async fn installation_diagnostics(app: AppHandle, folder: String) -> Install
.map(patcher_file_stats) .map(patcher_file_stats)
.unwrap_or_default(); .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 { let mut diagnostics = InstallationDiagnostics {
platform: std::env::consts::OS.to_string(), platform: std::env::consts::OS.to_string(),
os_version: System::long_os_version(), os_version: System::long_os_version(),