Build\_path\_prefix\_map(3) OCaml library Build\_path\_prefix\_map(3)

# [NAME](#NAME)

Build\_path\_prefix\_map - Rewrite paths for reproducible builds

# [Module](#Module)

Module Build\_path\_prefix\_map

# [Documentation](#Documentation)

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**

*val encode\_prefix* : **path\_prefix -&gt; string**

*val decode\_prefix* : **string -&gt;** **(path\_prefix, error\_message)** **result**

*type pair* = {  
target : **path\_prefix** ;  
source : **path\_prefix** ;  
}

*val encode\_pair* : **pair -&gt; string**

*val decode\_pair* : **string -&gt;** **(pair, error\_message)** **result**

*type map* = **pair option list**

*val encode\_map* : **map -&gt; string**

*val decode\_map* : **string -&gt;** **(map, error\_message)** **result**

*val rewrite\_opt* : **map -&gt;** **path -&gt; path option**

**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** .

*val rewrite* : **map -&gt;** **path -&gt; path**

2026-09-15 OCamldoc

---

Document: Build_path_prefix_map(3o) from ocaml-4 4.14.4-r3 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
