Skip to content

feat(nuitka): add Nuitka --onefile migration design#4

Open
Sodawyx wants to merge 3 commits intomainfrom
feat/nuitka-onefile-migration
Open

feat(nuitka): add Nuitka --onefile migration design#4
Sodawyx wants to merge 3 commits intomainfrom
feat/nuitka-onefile-migration

Conversation

@Sodawyx
Copy link
Copy Markdown
Contributor

@Sodawyx Sodawyx commented Apr 22, 2026

Switches the CLI binary toolchain from PyInstaller to Nuitka so warm invocations hit the payload-hash cache at ~/.agentrun/cache/ and avoid the ~2s per-call re-extraction, unblocking the agent-hot-path scenario.

Sodawyx and others added 3 commits April 22, 2026 10:06
Switches the CLI binary toolchain from PyInstaller to Nuitka so warm
invocations hit the payload-hash cache at ~/.agentrun/cache/ and avoid
the ~2s per-call re-extraction, unblocking the agent-hot-path scenario.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nuitka --onefile compiles all Python to C on every run, which on cold CI
runners routinely takes 15+ minutes in the Scons stage. Two mitigations:

- Persist ~/.cache/ccache across workflow runs via actions/cache, keyed on
  target + Python version + hash of pyproject.toml and build-binary.sh so
  a Nuitka pin bump or flag change buckets into a fresh cache. ccache is
  content-addressed, so changing Python source invalidates only the .o
  files whose generated C actually changed. Windows is skipped because
  MSVC does not integrate with ccache. macOS gains a brew install step.
- Pass --lto=no to Nuitka. LTO roughly doubles link time on gcc 11 and
  the runtime win is not worth paying on every tag push.

Also drops the redundant --standalone flag (--onefile implies it) and
prints ccache stats after each build for visibility into hit rate.

Signed-off-by: Sodawyx <sodawyx@126.com>
This change comments out the Windows AMD64 build configuration due to long compilation times caused by MSVC not being able to use ccache. The build would take over 30 minutes per run on standard GitHub runners. It will be re-enabled once switched to sccache or MinGW-w64.

Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>
Signed-off-by: Sodawyx <sodawyx@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant