Skip to main content

Module cache

Module cache 

Source

Modules§

go_stdlib
prelude
types

Structs§

CachedFile
CompiledModule
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§

cache_path
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. This loads the cached definitions and source files without running inference.
save_module_cache
try_load_cache