repomatic.tooling.nuitka module¶
What repomatic run nuitka adds to a Nuitka build.
The nuitka entry of TOOL_REGISTRY reads
two hooks from here:
nuitka_params(), its computed parameters: the modules the binary leaves out, and the options of the build target this machine compiles for.prepare_nuitka_build(), its preparation: the extras to install, the compile cache to trim and configure, and the environment of the target.
Each of them reads the machine it runs on, so the release workflow hands a compile job nothing but the entry point to build.
- repomatic.tooling.nuitka.MEBIBYTE: Final[int] = 1048576¶
Bytes in a mebibyte, the unit the cache size is logged in.
- repomatic.tooling.nuitka.COMPILE_CACHE_CAP: Final[int] = 2147483648¶
Size past which
prepare_compile_cache()resets the compile cache.Nuitka’s internal clcache prunes by age alone and has no size cap (ccache prunes itself at 5 GiB), so a restore-then-save cycle can still grow the cache. Past this size, the cache starts a fresh lineage.
- repomatic.tooling.nuitka.CCACHE_CONFIG: Final[str] = 'ccache.conf'¶
The file ccache reads its settings from, inside its cache directory.
- repomatic.tooling.nuitka.nuitka_params(metadata)[source]¶
Build the options
repomatic run nuitkapasses after the shared ones.- Parameters:
metadata (
Metadata) – The project the binary is built from.- Return type:
- Returns:
A
--nofollow-import-tooption per module of [tool.repomatic] nuitka.nofollow-imports, then the options of the build target this machine compiles for (seenuitka_flags).
- repomatic.tooling.nuitka.install_extras(extras)[source]¶
Install the optional dependency groups extras into the project venv.
The binary only bundles what the build virtualenv holds, which by default is the base dependencies of the project. An extra listed in
[tool.repomatic] nuitka.extrasadds the packages of an optional feature.The sync is inexact: it adds the extras and removes nothing, so a developer’s virtualenv keeps the dependency groups it had.
- repomatic.tooling.nuitka.prepare_compile_cache(cache_dir, ccache_dir, work_root)[source]¶
Trim the Nuitka compile cache, then write the settings of ccache.
Two duties. The trim resets a cache past
COMPILE_CACHE_CAP. The settings land in theCCACHE_CONFIGfile of ccache_dir, which ccache always reads, and which the cache step of the workflow saves with the objects:compiler_check = contenthashes the compiler binary’s content. The default check reads its modification time and size, which runner VMs do not keep stable.base_dirmakes ccache hash every path below work_root as a relative path, so a work root that moves between machines keeps its keys. Nuitka sets nobase_dirof its own.
- repomatic.tooling.nuitka.prepare_nuitka_build(metadata)[source]¶
Ready this machine for the Nuitka build
repomatic run nuitkastarts.Installs the
[tool.repomatic] nuitka.extras, then prepares the compile cache when the job relocated it underNUITKA_CACHE_DIRand the target keeps one (seecompile_cache). Outside CI the variable is unset, and the cache is left alone.