package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

When you read the words "version util" below, try adding the word "info" to them: "version util info" makes a little more sense.

val get_version_util : contents_of_exe:string -> string option

Gets the version util if it exists.

Since 2022-11, this function is guaranteed to be bidirectionally compatible if we ever change the version util format. We guarantee that:

  • New versions of this function will always be able to parse the version util out of all binaries built after 2022-11.
  • Versions of this function which are less than one month old will always be able to parse the version util out of new binaries. Older versions of this function may not be able to parse the version util out of new binaries.

If you care about performance, consider using lib/fast_get_version_util_from_file. It is around 10-20x faster than this function, which can take a small number of seconds for several hundred megabyte binaries.

val insert_version_util : contents_of_exe:string -> Version.t list -> string option

Inserts the given version util into the executable text given. Returns None if this could not happen (maybe this is an executable that doesn't link in the current library).

val remove_version_util : contents_of_exe:string -> string option

Removes the version util from a file. The point of this operation is to make it possible to compare executables up to version util.

module For_tests : sig ... end
OCaml

Innovation. Community. Security.