package dune-private-libs
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Private libraries of Dune
Install
dune-project
Dependency
Authors
Maintainers
Sources
dune-2.5.1.tbz
sha256=8f77d3a87f208e0d7cccaa1c48c4bb1bb87d62d07c3f25e9b8ba298e028ce52b
sha512=f209f12ced10c1abf8782bdb0143f4cec77795f7174d2cc75130afb1e01550b01f2f77b9e3ec4888efdad83d2f9878d179b39126f824f4e522f3ef4da34bf27e
doc/src/dune-private-libs.cache/cache_intf.ml.html
Source file cache_intf.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95open Stdune type metadata = Sexp.t list module File = struct type t = { in_the_cache : Path.t ; in_the_build_directory : Path.Build.t ; digest : Digest.t } end type promotion = | Already_promoted of File.t | Promoted of File.t type repository = { directory : string ; remote : string ; commit : string } type command = Dedup of File.t module Duplication_mode = struct type t = | Copy | Hardlink let all = [ ("copy", Copy); ("hardlink", Hardlink) ] let of_string repr = match List.assoc all repr with | Some mode -> Result.Ok mode | None -> Result.Error (Format.sprintf "invalid duplication mode: %s" repr) let to_string = function | Copy -> "copy" | Hardlink -> "hardlink" end module type Cache = sig type t (** Set the absolute path to the build directory for interpreting relative paths when promoting files. *) val set_build_dir : t -> Path.t -> t (** Set all the version controlled repositories in the workspace to be referred to when promoting files. *) val with_repositories : t -> repository list -> t (** Promote files produced by a build rule into the cache. *) val promote : t -> (Path.Build.t * Digest.t) list -> Key.t -> metadata -> repository:int option -> duplication:Duplication_mode.t option -> (unit, string) Result.t (** Find a build rule in the cache by its key. *) val search : t -> Key.t -> (metadata * File.t list, string) Result.t (** Materialise a cached file in the build directory (using [Copy] or [Hardlink] as per the duplication mode) and return the path to it. *) val retrieve : t -> File.t -> Path.t (** Deduplicate a file, i.e. replace the file [in_the_build_directory] with a hardlink to the one [in_the_cache] if the deduplication mode is set to [Hardlink] (or do nothing if the mode is [Copy]). *) val deduplicate : t -> File.t -> unit (** Remove the local cache and disconnect with a distributed cache client if any. *) val teardown : t -> unit end module type Caching = sig module Cache : Cache val cache : Cache.t end type caching = (module Caching) let command_to_dyn = function | Dedup { in_the_build_directory; in_the_cache; digest } -> let open Dyn.Encoder in record [ ("in_the_build_directory", Path.Build.to_dyn in_the_build_directory) ; ("in_the_cache", Path.to_dyn in_the_cache) ; ("digest", Digest.to_dyn digest) ]
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>