package obuilder

  1. Overview
  2. Docs

Module Obuilder.Btrfs_storeSource

Store build results as Btrfs subvolumes.

include S.STORE
Sourcetype t
Sourceval root : t -> string

root t returns the root of the store.

Sourceval df : t -> float Lwt.t

df t returns the percentage of free space in the store.

Sourceval build : t -> ?base:S.id -> id:S.id -> (string -> (unit, 'e) Lwt_result.t) -> (unit, 'e) Lwt_result.t

build t ~id fn runs fn tmpdir to add a new item to the store under key id. On success, tmpdir is saved as id, which can be used as the base for further builds, until it is expired from the cache. On failure, nothing is recorded and calling build again will make another attempt at building it. The builder will not request concurrent builds for the same id (it will handle that itself). It will also not ask for a build that already exists (i.e. for which result returns a path).

  • parameter base

    Initialise tmpdir as a clone of base.

Sourceval delete : t -> S.id -> unit Lwt.t

delete t id removes id from the store, if present.

Sourceval result : t -> S.id -> string option Lwt.t

result t id is the path of the build result for id, if present.

Sourceval log_file : t -> S.id -> string Lwt.t

log_file t id is the path of the build logs for id. The file may not exist if the build has never been run, or failed.

Sourceval state_dir : t -> string

state_dir is the path of a directory which can be used to store mutable state related to this store (e.g. an sqlite3 database).

Sourceval cache : user:Obuilder_spec.user -> t -> string -> (string * (unit -> unit Lwt.t)) Lwt.t

cache ~user t name creates a writeable copy of the latest snapshot of the cache name. It returns the path of this fresh copy and a function which must be called to free it when done. If the cache name does not exist, it is first created (as an empty directory, and owned by user). When the copy is released, it is snapshotted to become the new latest version of the cache, unless the cache has already been updated since it was snapshotted, in which case this writeable copy is simply discarded.

Sourceval delete_cache : t -> string -> (unit, [> `Busy ]) Lwt_result.t

delete_cache t name removes the cache name, if present. If the cache is currently in use, the store may instead return Error `Busy.

Sourceval complete_deletes : t -> unit Lwt.t

complete_deletes t attempts to wait for previously executed deletes to finish, so that the free space is accurate.

Sourceval create : string -> t Lwt.t

create path is a new store in btrfs directory path.

OCaml

Innovation. Community. Security.