package obuilder

  1. Overview
  2. Docs

Sandbox builds.

include S.SANDBOX
type t
val run : cancelled:unit Lwt.t -> ?stdin:Obuilder__.Os.unix_fd -> log:Build_log.t -> t -> Config.t -> string -> (unit, [ `Cancelled | `Msg of string ]) Lwt_result.t

run ~cancelled t config dir runs the operation config in a sandbox with root filesystem dir.

  • parameter cancelled

    Resolving this kills the process (and returns `Cancelled).

  • parameter stdin

    Passed to child as its standard input.

  • parameter log

    Used for child's stdout and stderr.

type config

The type of sandbox configurations

val sexp_of_config : config -> Sexplib0.Sexp.t
val config_of_sexp : Sexplib0.Sexp.t -> config
val cmdliner : config Cmdliner.Term.t

cmdliner is used for command-line interfaces to generate the necessary flags and parameters to setup a specific sandbox's configuration.

val create : state_dir:string -> config -> t Lwt.t

create ~state_dir config is a sandboxing system that keeps state in state_dir and is configured using config.

val finished : unit -> unit Lwt.t

finished is a call back to the sandbox which is triggered when the current job is finished. The sandbox may choose do nothing.

OCaml

Innovation. Community. Security.