package dkml-install-runner

  1. Overview
  2. Docs
module Arg = Cmdliner.Arg
module Term = Cmdliner.Term
val help : [> `Pager ] as 'a -> string list -> string option -> [> `Error of bool * string | `Help of 'b * string option | `Ok of unit ]
val help_secs : [> `P of string | `S of string ] list
val setup_log : Fmt.style_renderer option -> Logs.level option -> Dkml_install_api.Log_config.t
val quote : string -> string
val err_no : string -> string -> string
val err_not_dir : string -> string
val raw_pp_str : Format.formatter -> string -> unit
val raw_dir : (string -> [> `Error of string | `Ok of string ]) * (Format.formatter -> string -> unit)
val prefix_t : string Cmdliner.Term.t
val exec_dir : Fpath.t

Directory containing dkml-package-setup.bc or whatever executable (perhaps a renamed setup.exe in a non-bin folder) is currently running.

val enduser_archive_dir : unit -> Fpath.t Dkml_install_api.Forward_progress.t

The root directory that was uncompressed at end-user install time

val staging_default_dir_for_package : archive_dir:Fpath.t -> Fpath.t

staging_default_dir_for_package ~archive_dir. For the benefit of Windows and macOS we keep the directory name ("sg") small.

val static_default_dir_for_package : archive_dir:Fpath.t -> Fpath.t

static_default_dir_for_package ~archive_dir. For the benefit of Windows and macOS we keep the directory name ("st") small.

val staging_files_opt_t : string option Cmdliner.Term.t
val static_files_opt_t : string option Cmdliner.Term.t
val opam_context_opt_t : string option Cmdliner.Term.t

staging_files_source_for_package_t is the setup.exe/uninstall.exe Term.t for the staging files directory. It defaults to the sibling directory "staging".

static_files_source_for_package_t is the setup.exe/uninstall.exe Term.t for the static files directory. It defaults to the sibling directory "static".

val unwrap_progress_t : default:'a -> 'b Dkml_install_api.Forward_progress.t Term.t -> 'c Term.t
val unwrap_progress_nodefault_t : 'a Dkml_install_api.Forward_progress.t Term.t -> 'b Term.t

ctx_for_runner_t component_name reg creates a user.exe/admin.exe Term for component component_name that sets up logging and any other global state, and defines the context record.

The package (setup.exe/uninstall.exe) will typically use sudo on Unix or gsudo on Windows to elevate the privileges of `admin.exe`. However it is very unlikely that the environment variables are propagated from the user (setup.exe) to the elevated process (admin.exe). So the staging directory must be specified (`No_staging_default`) when the runner user.exe/admin.exe is launched.

That is, the user process setup.exe can pass its environment variable OPAM_SWITCH_PREFIX (if specified with the no argument `--opam-context` option of setup.exe) into the staging directory argument for admin.exe.

ctx_for_package_t component_name reg creates a setup.exe/uninstall.exe Term for component component_name that sets up logging and any other global state, and defines the context record.

Unlike ctx_for_runner_t the expectation is that setup.exe/uninstall.exe will be directly launched by the user and have access to the user's environment variables, especially OPAM_SWITCH_PREFIX. So the no argument --opam-context option of setup.exe can default to OPAM_SWITCH_PREFIX.

Unlike ctx_for_runner_t the staging directory has a default (`Staging_default_dir`) based on relative paths from setup.exe.

val component_selector_t : install:bool -> string list Cmdliner.Term.t
val common_runner_args : log_config:Dkml_install_api.Log_config.t -> prefix:Fpath.t -> staging_files_source:Path_location.staging_files_source -> Bos.Cmd.t
val help_cmd : unit Term.t * Term.info
val eval_progress : (unit Dkml_install_api.Forward_progress.t Term.t * Term.info) -> [> `Error of [ `Exn | `Parse | `Term ] | `Help | `Ok of unit | `Version ]
OCaml

Innovation. Community. Security.