Build_path_prefix_map(3)
β¨ NAME β¨
Build_path_prefix_map β rewrite paths for reproducible builds, periodt. This is the Build_path_prefix_map(3) page from the OCaml library, and yes bestie, we're getting into some compiler-adjacent path magic πͺπ
π§© Module
Module Build_path_prefix_map : sig end
Rewrite paths for reproducible builds β that's the whole vibe, no cap. π
π Documentation π
β οΈ Warning: this module is unstable and part of Compiler_libs.
See the BUILD_PATH_PREFIX_MAP spec. π
Here's the exact signature, bestie β every type and val, untouched:
type path = string
type path_prefix = string
type error_message = string
val encode_prefix : path_prefix -> string
val decode_prefix : string -> (path_prefix, error_message) result
type pair = {
target : path_prefix ;
source : path_prefix ;
}
val encode_pair : pair -> string
val decode_pair : string -> (pair, error_message) result
type map = pair option list
val encode_map : map -> string
val decode_map : string -> (map, error_message) result
val rewrite_first : map -> path -> path option
val rewrite_all : map -> path -> path list
val rewrite : map -> path -> path
val invert_all : map -> path -> path list
The encode/decode crew is encode_prefix, decode_prefix, encode_pair, decode_pair, encode_map, and decode_map β they're all right there in the signature above, shining like the little icons they are π
rewrite_firstβrewrite_first map pathtries to find asourceinmapthat is a prefix of the inputpath. If it succeeds, it replaces this prefix with the correspondingtarget. If it fails, it just returnsNone. β¨rewrite_allβrewrite_all map pathfinds allsources inmapthat are a prefix of the inputpath. For each matching source, in priority order, it replaces this prefix with the correspondingtargetand adds the result to the returned list. If there are no matches, it just returns[]. πrewriteβrewriteusesrewrite_firstto try to find a mapping forpath. If found, it returns that; otherwise it just returnspath. π«Άinvert_allβinvert_all map pathfinds alltargets inmapthat are a prefix of the inputpath. For each matching target, in priority order, it replaces this prefix with the correspondingsourceand adds the result to the returned list. If there are no matches, it just returns[]. π¦
That's the whole page, bestie. This lil' manual moment was brought to you by OCamldoc on 2026-06-22 for Build_path_prefix_map(3). Go make those builds reproducible, you icon ππ
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms