package yocaml

  1. Overview
  2. Docs

Module Yocaml.CacheSource

The cache is an artifact of the previous build that tracks information about build targets, including dynamic dependencies, and maintains a hashed version of the targets.

Types

Sourcetype t

A representation of the cache (a map indexed by Path.t).

Sourcetype entry

An entry of the cache.

Building

Sourceval entry : ?last_build_date:int -> string -> Deps.t -> entry

entry ?last_build_date hashed_content deps creates an entry.

Sourceval empty : t

empty returns an empty cache.

Sourceval from_list : (Path.t * entry) list -> t

from_list l creates a cache from a list.

Cache interaction

Sourceval update : t -> Path.t -> ?deps:Deps.t -> now:int -> string -> t

update cache path ?deps ~now content updates the cache for the path entry. If an entry already existed at the given key, it will be deleted.

Sourceval get : t -> Path.t -> (string * Deps.t * int option) option

get cache path returns the associated hash content, deps set and the last build date for a given path.

Serialization/Deserialization

Supports serialization and deserialization of cache.

Sourceval to_sexp : t -> Sexp.t

to_sexp cache Converts a cache into a Sexp.

Sourceval from_sexp : Sexp.t -> (t, Sexp.invalid) result

from_sexp sexp try to converts a Sexp into a cache.

Utils

Sourceval pp : Format.formatter -> t -> unit

Pretty printer for caches.

Sourceval equal : t -> t -> bool

Equality between caches.

OCaml

Innovation. Community. Security.