Expand description
§Package Cache Module
High-performance package payload caching for rez-next.
This module provides disk-based caching of package variant payloads to avoid fetching from shared storage at runtime. It follows SOLID principles and incorporates lessons learned from the original rez implementation.
§Design Decisions (based on rez issues analysis)
- Cross-platform case handling: Normalizes paths for Windows case-insensitivity
- Disk space pre-check: Fail fast with clear error when disk is full
- Configurable logging: Accepts optional logger instead of hardcoding
- Corrupted data handling: Skips malformed cache entries instead of crashing
- Thread-safe operations: Uses file locking for multi-process safety
§Cache Directory Structure
<cache_root>/<package_name>/<version>/<hash_prefix>/<increment>/
└─ payload files
<increment>.json └─ variant metadataThe hash is the first 4 chars of SHA1(variant.handle), and increment (a, b, …) handles hash collisions.
Structs§
- Cache
Config - Configuration for package cache behavior.
- Cached
Variant Info - Metadata stored alongside a cached variant payload.
- Clean
Stats - Statistics from a cache cleaning operation.
- Package
Cache - High-performance package payload cache.
- Variant
Handle - Serializable representation of a variant handle.
Enums§
- Cache
Status - Status of a variant in the cache.
- Package
Cache Error - Errors that can occur during cache operations.