revert(windows): drop unproven packaging I/O pool default

This commit is contained in:
winewill committed 2026-10-20 20:33:54 +08:00
1 parent d0664c9a7c
commit a12c0dfe46
5 files changed
+2 -30

No files matched your search

-1
View File
@@ -441,7 +441,6 @@ export async function packageTarget(
DSH_DESKTOP_TARGET_PLATFORM: target.platform,
DSH_DESKTOP_TARGET_ARCH: target.arch,
}
if (target.platform === 'win32') targetEnv.UV_THREADPOOL_SIZE ??= '8'
const downloadEnv = macOSDownloadEnvironment(targetEnv, mac?.downloadProxy)
const electronBuilderEnv = desktopElectronBuilderEnvironment(downloadEnv, invocation.unsigned)
if (target.platform === 'win32') {
@@ -122,29 +122,6 @@ it.each(['pack', 'runtime'] as const)('drains the other Windows preparation afte
}
})
it.each([
{ target: 'win-x64', platform: 'win32', arch: 'x64', pool: undefined, expected: '8' },
{ target: 'win-x64', platform: 'win32', arch: 'x64', pool: '2', expected: '2' },
{ target: 'mac-arm64', platform: 'darwin', arch: 'arm64', pool: undefined, expected: undefined },
{ target: 'mac-arm64', platform: 'darwin', arch: 'arm64', pool: '16', expected: '16' },
] as const)('selects the I/O pool for $target assembly without changing compiler or pack settings ($pool)', async ({ target, platform, arch, pool, expected }) => {
const { run } = supervisor()
await packageTarget(parseDesktopPackageInvocation([target, '--unsigned'], platform, arch), {
...environment, ...(pool === undefined ? {} : { UV_THREADPOOL_SIZE: pool }),
}, run)
const preparation = run.run.mock.calls.filter(([stage]) => stage.startsWith('run prepare:'))
const builder = run.run.mock.calls.find(([stage]) => stage.startsWith('exec electron-builder '))
const smoke = run.run.mock.calls.find(([stage]) => stage.startsWith('exec tsx scripts/smoke-packaged-runtime.ts'))
expect(preparation).toHaveLength(3)
expect(builder).toBeDefined()
expect(smoke).toBeDefined()
for (const call of [...preparation, builder!, smoke!]) expect(call[3].env.UV_THREADPOOL_SIZE).toBe(expected)
const compilationAndPacking = run.run.mock.calls.filter(([stage]) => !stage.startsWith('run prepare:')
&& !stage.startsWith('exec electron-builder ') && !stage.startsWith('exec tsx scripts/smoke-packaged-runtime.ts'))
expect(compilationAndPacking.length).toBeGreaterThan(0)
for (const call of compilationAndPacking) expect(call[3].env.UV_THREADPOOL_SIZE).toBe(pool)
})
it.each([undefined, '3'])('passes the package cache and selected compression to their subprocesses (%s)', async (level) => {
const { run } = supervisor()
const cache = resolve('fixture-package-cache')
@@ -33,8 +33,8 @@
en: 5401b605a2f3a44e
zh: fc1f6ee667bcd20d
/windows-signing-and-runner-operations/signature-cache-and-concurrent-stages:
en: 0abcf9d4186d66ba
zh: b1c934b1697409bd
en: 6e8208d19ad510e5
zh: eee42e8938c0f603
/windows-signing-and-runner-operations/verification-limits:
en: 94a471410c84a1c7
zh: 115228e4ca36581d
-2
View File
@@ -92,8 +92,6 @@ Cache-hit copying, hashing and per-file candidate trust checks run with `DSH_DES
PE discovery reads every regular file's header with at most eight open files, rejects links and malformed Windows executables, and drains active reads and closes before reporting failure. Packaging records `windows:enumerate-code` and `windows:inspect-signatures` as nested phases of signing and artifact verification; their timings are included in the enclosing stages.
Windows runtime preparation, signing, installer assembly and verification subprocesses default Node's `UV_THREADPOOL_SIZE` to `8` for file I/O. An explicit environment value takes precedence. Compiler and tarball subprocesses retain their original setting; hardware signing remains serial.
Windows packaging reads `DSH_DESKTOP_WINDOWS_PACK_CONCURRENCY` from `.env.windows` or the selected preset: a positive integer, defaulting to `4`. Packaging batches first-party and vendor tarballs with bounded workers, then validates every payload and records publication order. After the complete build succeeds, tarball packing overlaps Electron and primary-runtime preparation in separate output directories. Both must finish successfully before runtime signing; preparation failure stops new packing commands and drains active processes before returning. Setting the limit to `1` selects serial tarball workers; standalone `release:pack` defaults to `1`.
Each runtime stage writes `SIGNATURE_CACHE_SUMMARY` to stdout and its packaging journal, including the actual directory, policy identity, hit/miss counts, newly published and retained entries, signing requests, avoided signing requests and validation failures. Timings distinguish signing, trust verification of restored and newly signed files, and restoration; restoration includes its trust check and staging cleanup. These counters exclude preflight, final artifact signing and the outer runtime signature checks. Stage lock events record waiting separately. Concurrent timings sum per-file work rather than stage wall time.
@@ -92,8 +92,6 @@ Windows 打包命令通过 `DESKTOP_PACKAGING_RECORD` 输出 `.desktop-build/pac
PE 发现会读取每个普通文件的头部,同时最多打开八个文件,拒绝链接和损坏的 Windows 可执行文件,并在报告失败前等待在途读取和关闭结束。打包将 `windows:enumerate-code` 与 `windows:inspect-signatures` 记录为签名和产物验证的嵌套阶段;其耗时已包含在外层阶段中。
Windows 运行时准备、签名、安装器组装与验证子进程默认将 Node 的 `UV_THREADPOOL_SIZE` 设为 `8`,用于文件 I/O。显式环境值优先。编译器和 tarball 子进程保留原有设置;硬件签名仍串行执行。
Windows 打包从 `.env.windows` 或所选预设读取 `DSH_DESKTOP_WINDOWS_PACK_CONCURRENCY`:必须为正整数,默认 `4`。Windows 使用有界 worker 批量打包第一方和 vendor tarball,随后校验每个产物并记录发布顺序。完整构建成功后,tarball 打包与 Electron、主要运行时准备在各自输出目录中并行执行。两者都成功结束后才开始运行时签名;准备失败会停止新的打包命令,并等待在途进程结束后返回。设为 `1` 时 tarball worker 串行执行;独立的 `release:pack` 默认使用 `1`。
每个运行时阶段向标准输出及打包日志写入 `SIGNATURE_CACHE_SUMMARY`,包含实际目录、策略标识、命中及未命中数、新发布及保留项数、签名请求数、省去的签名请求数和验证失败数。计时区分签名、恢复文件和新签名文件的信任验证及恢复;恢复耗时包含其信任检查和暂存清理。这些统计不包含预检、最终产物签名及外层运行时验签。阶段锁事件单独记录等待时间。 并发计时累加逐文件工作耗时,不代表阶段墙钟时间。