package dune-private-libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file messages_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
open Cache_intf
open Stdune

(** A version of the communication protocol between Dune and the cache daemon. *)
type version =
  { major : int
  ; minor : int
  }

(** When Dune successfully executes a build rule, it sends a "promotion" message
    to the cache daemon, listing the produced [files] along with some [metadata]
    and a few other fields relevant for caching. *)
type promotion =
  { key : Key.t
  ; files : (Path.Build.t * Digest.t) list
  ; metadata : Sexp.t list
  ; repository : int option
  ; duplication : Duplication_mode.t option
  }

(** There is one initial message [Lang], which is sent by Dune and the cache
    daemon to each other during the initial negotiation of the version of the
    communication protocol. *)
type initial = Initial

(** Outgoing messages are sent by Dune to the cache daemon. *)
type outgoing = Outgoing

(** Incoming messages are sent by the cache daemon to Dune. *)
type incoming = Incoming

(** Messages of the communication protocol between Dune and the cache daemon. *)
type _ message =
  | Lang : version list -> initial message
      (** Inform the other party about the supported versions of the
          communication protocol. *)
  | SetBuildRoot : Path.t -> outgoing message
      (** Set the absolute path to the build root, to be used when interpreting
          relative paths in subsequent messages. *)
  | SetCommonMetadata : Sexp.t list -> outgoing message
      (** Set the common metadata that should be added to the subsequent
          [Promote] messages. *)
  | SetRepos : repository list -> outgoing message
      (** Set the paths to all the version controlled repositories in the
          workspace along with the associated commit identifiers. *)
  | Promote : promotion -> outgoing message
      (** Promote files produced by a build rule into the cache. *)
  | Dedup : File.t -> incoming message
      (** Inform Dune that a file that was previously promoted can now be
          replaced by a hardlink to the corresponding file stored in cache. *)
OCaml

Innovation. Community. Security.