Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

fix(desktop): use platform runtime budgets and clean Windows sources

Leggett7966677402b4
diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml
index 63866b3a..67434fd8 100644
--- a/.github/workflows/desktop-release.yml
+++ b/.github/workflows/desktop-release.yml
@@ -159,6 +159,9 @@ jobs:
echo "::error::release Environment 缺少 macOS 签名 Secret:${missing[*]}"
exit 1
fi
+ - name: Preserve source line endings on Windows
+ if: matrix.platform == 'win32'
+ run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- name: 验证并使用 macOS Command Line Tools
if: matrix.platform == 'darwin'
diff --git a/apps/desktop/scripts/package-release.mjs b/apps/desktop/scripts/package-release.mjs
index bc8401fb..b77e2954 100644
--- a/apps/desktop/scripts/package-release.mjs
+++ b/apps/desktop/scripts/package-release.mjs
@@ -222,10 +222,14 @@ const packageWithSigningEnvironment = async builderEnv => {
sha256: font.webSha256.toLowerCase()
};
});
+ const sourceStatus = gitOutput(['status', '--porcelain', '--untracked-files=normal']);
+ if (officialBuild && sourceStatus.length > 0) {
+ throw new Error(`Official Desktop builds require a clean source tree:\n${sourceStatus}`);
+ }
const manifest = {
version: 1,
commit: gitOutput(['rev-parse', 'HEAD']) || 'unknown',
- dirty: gitOutput(['status', '--porcelain', '--untracked-files=normal']).length > 0,
+ dirty: sourceStatus.length > 0,
generatedAt: new Date().toISOString(),
platform,
arch,
diff --git a/apps/desktop/scripts/verify-package.mjs b/apps/desktop/scripts/verify-package.mjs
index 7926098c..81d1d8e2 100644
--- a/apps/desktop/scripts/verify-package.mjs
+++ b/apps/desktop/scripts/verify-package.mjs
@@ -15,6 +15,7 @@ import {
closeSync,
cpSync,
existsSync,
+ lstatSync,
mkdtempSync,
openSync,
readSync,
@@ -123,8 +124,12 @@ assertNoUnexpectedPythonRuntime();
assertNoLocalData();
assertSize('app.asar', appAsar, 80 * 1024 * 1024);
assertSize('Daemon resources', daemonDir, 250 * 1024 * 1024);
-// Includes spaCy dependencies and the English md parser (~126 MiB).
-assertSize('Creator Runtime', creatorRuntimeDir, 512 * 1024 * 1024);
+// Includes spaCy, its English md parser, Python, Node, and pinned media tools.
+// Windows x64 measured 610 MiB; its media tools alone exceed arm64 by 71 MiB.
+// Intel macOS also ships larger x64 media tools and native Python libraries.
+const creatorRuntimeLimitMiB = targetPlatform === 'win32' ? 704
+ : targetPlatform === 'darwin' && targetArch === 'x64' ? 640 : 512;
+assertSize('Creator Runtime', creatorRuntimeDir, creatorRuntimeLimitMiB * 1024 * 1024);
assertSize('Codex Runtime', codexRuntimeDir, 450 * 1024 * 1024);
assertSize('Stickman assets', join(daemonDir, 'runtime', 'stickman-assets'), 16 * 1024 * 1024);
assertSize('Desktop package', packageRoot, 1600 * 1024 * 1024);
@@ -1003,9 +1008,15 @@ function assertExists(path) {
}
function assertSize(label, path, maxBytes) {
- const bytes = statSync(path).isDirectory() ? treeSize(path) : statSync(path).size;
+ const directory = statSync(path).isDirectory();
+ const bytes = directory ? treeSize(path) : statSync(path).size;
if (bytes > maxBytes) {
- throw new Error(`${label} is unexpectedly large: ${bytes} bytes`);
+ const components = directory ? Object.fromEntries(readdirSync(path).map(name => {
+ const child = join(path, name);
+ const childStat = lstatSync(child);
+ return [name, childStat.isDirectory() ? treeSize(child) : childStat.size];
+ })) : undefined;
+ throw new Error(`${label} is unexpectedly large: ${bytes} bytes (limit: ${maxBytes} bytes; components: ${JSON.stringify(components)})`);
}
}