Module Build_path_prefix_map

module Build_path_prefix_map: sig .. end

Rewrite paths for reproducible builds

Warning: this module is unstable and part of compiler-libs.


type path = string;
type path_prefix = string;
type error_message = string;
let encode_prefix: path_prefix => string;
let decode_prefix: string => result(path_prefix, error_message);
type pair = {
   target : path_prefix;
   source : path_prefix;
}
let encode_pair: pair => string;
let decode_pair: string => result(pair, error_message);
type map = list(option(pair));
let encode_map: map => string;
let decode_map: string => result(map, error_message);
let rewrite_opt: (map, path) => option(path);

rewrite_opt map path tries to find a source in map that is a prefix of the input path. If it succeeds, it replaces this prefix with the corresponding target. If it fails, it just returns None.

let rewrite: (map, path) => path;