Skip to main content

Module cache

Module cache 

Source

Modules§

go_stdlib
prelude
types

Structs§

CachedFile
CompiledModule
EmitStamp
ModuleInterface

Constants§

CACHE_FORMAT_VERSION
Current cache format version. Bump this when making breaking changes to the cache format.
COMPILER_VERSION_HASH
Compiler version hash. Caches from different compiler versions are invalid.
GO_STDLIB_HASH
Go stdlib-only content hash (typedefs/*.d.lis).
PRELUDE_HASH
Prelude-only content hash (prelude.d.lis).
STDLIB_HASH
Combined stdlib content hash. Changes to any stdlib file (prelude.d.lis or any typedefs/*.d.lis) will change this hash, invalidating all user module caches.

Functions§

apply_emit_stamps
Set or clear the emit_stamp for each module’s cache file. Missing files are skipped; undecodable (e.g. pre-bump) files are unlinked and skipped; other read errors propagate so the debug pre-write clear can hard-fail rather than leave a stale stamp over freshly-overwritten Go.
cache_file_name
cache_path
compute_emit_artifact_hash
Hash over the non-debug Go-artifact inputs for one module.
compute_module_hash
Compute a module’s hash from its source hash and dependency hashes. This ensures transitive invalidation: if C changes, B’s module_hash changes (even though B’s source didn’t), which invalidates A’s cache.
get_dependency_module_hashes
hash_module_sources
is_cache_disabled
is_cache_valid
register_cached_module
Register a cached module in the store. display_path for each cached file is recomputed from the project layout against the current cwd, so warm and cold builds render the same diagnostic paths even though the cache stores only bare names.
save_module_cache
try_load_cache