Skip to main content

Module cache

Module cache 

Source
Expand description

Per-JAR stub cache keyed by SHA-256 hash of the JAR file.

Cache location: .sqry/classpath/jars/{hash}.stub Format: postcard binary serialization of Vec<ClassStub>

The cache is content-addressed: the cache key is derived from the full SHA-256 hash of the JAR file contents. When a JAR’s contents change, its hash changes and the old cache entry becomes orphaned (eventually cleaned up by a cache sweep, or left harmlessly on disk).

§Atomic writes

Cache writes use a temporary file with rename to prevent reads of partially-written files. This makes the cache safe for concurrent readers (though not for concurrent writers to the same key — which is fine because each JAR is processed once).

Structs§

StubCache
Per-JAR stub cache keyed by SHA-256 hash of the JAR file.