Superbol_platform.Cache_storeA Superbol_cache.Store backed by the file-system.
This is where the cache's I/O actually happens; the library itself performs none, so that cobol_lsp keeps linking against a platform that cannot touch a disk.
The implementation assumes as little as it can of the file-system holding the cache, because that may well be a network mount --- a build server, or a network home directory. In particular it never replaces an existing file: publishing stages the item next door and then links it into place, so that a reader sees either nothing or the whole item, and so that two instances publishing the same item at once cannot damage each other. link failing with EEXIST is the ordinary outcome of losing that race, not an error.
It also never relies on flock, whose behaviour over NFS and SMB cannot be counted on; the pruner's lock is an exclusively-created file that a later instance may break once it has gone stale.
Directories are created set-group-ID and group-writable, so that everyone in the owning group can publish, refresh and reclaim entries --- including ones another user wrote. The sticky bit is deliberately not set: pruning has to be able to remove entries it does not own.
Bear in mind what that permits: values are read back with Marshal, so anyone who can write to the directory can run code in everybody else's process. A shared cache directory is only ever sound between users who already trust one another.
Group-writable, and set-group-ID so that what is created under a shared directory stays in its group.
How long a lock left behind by a process that died is honoured before a later instance breaks it.
val create : root:string -> unit -> Superbol_cache.Store.TYPES.store