···11+type t = All | Archives | Never
22+33+let to_string = function
44+ | All -> "all"
55+ | Archives -> "archives"
66+ | Never -> "never"
77+88+let of_string s =
99+ match String.lowercase_ascii (String.trim s) with
1010+ | "all" -> Ok All
1111+ | "archives" -> Ok Archives
1212+ | "never" -> Ok Never
1313+ | other ->
1414+ Error
1515+ (Fmt.str
1616+ "unknown --use-registry value %S (expected: all|archives|never)"
1717+ other)
1818+1919+let pp ppf t = Format.pp_print_string ppf (to_string t)
+15
lib/oi/use_registry.mli
···11+(** What to consult the remote registry for, on a per-fetch basis. The two
22+ fetches the pipeline performs (binary layers, source archives) are gated
33+ independently so a CI registry-build can reuse cached source archives while
44+ regenerating every binary from scratch. *)
55+66+type t =
77+ | All (** Binary layers AND source archives. *)
88+ | Archives (** Source archives only; build every layer from source. *)
99+ | Never (** Skip the registry; upstream source fetches still happen. *)
1010+1111+val of_string : string -> (t, string) result
1212+(** [of_string "all"] / ["archives"] / ["never"]. Case-insensitive. *)
1313+1414+val to_string : t -> string
1515+val pp : Format.formatter -> t -> unit