ci: 构建前安装 zstandard,启用 Nuitka onefile 压缩(Linux 产物 250MB → ~40MB) - #110
Merged
This-is-XiaoDeng merged 1 commit intoAug 13, 2026
Conversation
Linux 产物 250MB 而 Windows/macOS 仅 ~37MB 的原因:Nuitka onefile 默认 用 zstandard 压缩 payload,但 Ubuntu runner 上找不到带 zstandard 的 Python,构建日志警告 'Onefile mode cannot compress without zstandard package installed',payload 原样打包。 修复:每个构建 job 在编译前 poetry run pip install zstandard (Nuitka 会扫描当前 Python),Linux 产物预计压缩到 ~40MB 级别。
This-is-XiaoDeng
merged commit Aug 13, 2026
2eb58a4
into
ITCraftDevelopmentTeam:master
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
Linux 产物 250MB,Windows/macOS 仅 ~37MB。
根因:Nuitka onefile 默认用 zstandard 压缩 payload,但 Ubuntu runner 上没有
带 zstandard 的 Python 可用,构建日志警告:
Onefile mode cannot compress without 'zstandard' package installed,payload 原样打包(已确认二进制内 0 个 zstd 魔数)。
修复
每个构建 job 在 Nuitka 编译前增加
poetry run pip install zstandard。Nuitka 的
findInstalledPython会优先扫描当前 Python,安装后即可启用压缩。预期
Linux 产物从 250MB 压缩到 ~40MB 级别,运行时行为不变(onefile 自动解压)。