Superbol_cache.WitnessBuilding witnesses.
Whether two paths differing only in case denote one file is a property of the host rather than of any one cache, so it is settled once for the process. It defaults to what the system name implies and is corrected by whoever creates a concrete store, which is the only place the actual file-system is known --- macOS is case-insensitive by default but need not be, and a Linux host may have a share mounted that is not.
set_case_insensitive b declares whether the host tells two paths differing only in case apart. Call it before anything is cached; changing it later invalidates every witness recorded so far, which costs misses rather than wrong hits.
case_insensitive () is what set_case_insensitive last established.
val file : name:string -> contents:string -> Types.witnessfile ~name ~contents witnesses that the file name was read and held contents.
val dir :
?exts:string list ->
name:string ->
entries:string list ->
unit ->
Types.witnessdir ?exts ~name ~entries () witnesses that the directory name was searched and held exactly entries.
This is what keeps a copybook lookup honest: resolving a copybook in one directory of a search path asserts that the directories before it held no candidate, so a copybook added to one of them must be a miss even though no file that was read has changed.
When exts is given, only the entries whose extension (in lowercase, as Filename.extension renders it: ".cpy", or "" for none) belongs to exts are witnessed, so that adding or removing any other entry leaves the witness intact. entries may then be the whole listing: the restriction is applied here, which is what lets a resolver rebuild the witness from the same listing.
ext_of entry is the extension of entry as dir compares it against exts: in lowercase, with its leading period, or "" for none.
val env : var:string -> value:string option -> Types.witnessenv ~var ~value witnesses that var was consulted and found unset (None) or set to a given value.
val sub : Types.key -> Types.witnesssub key witnesses that the entry key was reused.