package octez-libs

  1. Overview
  2. Docs

Version information.

This module provides the current version number.

type additional_info = Tezos_version_parser.additional_info =
  1. | Dev
  2. | Beta of int
  3. | Beta_dev of int
  4. | RC of int
  5. | RC_dev of int
  6. | Release

Additional version information.

Dev means "Development Version". All non-release branches should use this.

Beta refers to a version that is not believed to be stable but contains features for the next release. For each release, the first beta version has number 1.

Beta_dev refers to a beta version "in development".

RC means "Release Candidate". For each release, the first release candidate has number 1.

RC_dev means "Release Candidate in development". This is a release branch where the release candidate tag is not associated to the HEAD of the branch.

Release means "no additional information". This is an actual released version. No additional info is printed.

Documentation on the semantics of version numbers is available at docs/releases/releases.rst.

val string_of_additional_info : additional_info -> string

Convert additional version information to a string.

The result is a string of the form "+dev", "~rcX", "~rcX+dev" or "".

type product = Tezos_version_parser.product =
  1. | Octez

Product information.

val string_of_product : product -> string

Convert the product information to a string.

type t = Tezos_version_parser.t = {
  1. product : product;
  2. major : int;
  3. minor : int;
  4. additional_info : additional_info;
}

Version information of the product.

Major versions include significant new features and are usually released in new branches which start from master.

Minor versions include mostly bug fixes and are usually released in branches which start from the previous release. When the major version is incremented, the minor version is reset to 0.

val to_string : t -> string

Convert a version to a string.

Examples:

  • to_string { major = 7; minor = 0; additional_info = Release } = "7.0"
  • to_string { major = 7; minor = 0; additional_info = Dev } = "7.0+dev"
  • to_string { major = 7; minor = 0; additional_info = RC 1 } = "7.0~rc1"
  • to_string { major = 7; minor = 0; additional_info = RC_dev 1 } = "7.0~rc1+dev"
val to_json : t -> string -> string

to_json version commit_hash json representation of a version and commit_hash as string.

Returns, as a string, a json object with the fields:

  • product, major, minor, info corresponding to the given fields of version.
  • hash, containing commit_hash.
val pp : Format.formatter -> t -> unit

Version printer.

pp f x prints to_string x in f

val pp_simple : Format.formatter -> t -> unit

A simpler version printer.

Same as pp but does not print the product name.

val parse_version : string -> t option

Parse an Octez version.

Returns None if the version cannot be parsed.

OCaml

Innovation. Community. Security.