summaryrefslogtreecommitdiff
path: root/utils/build_path_prefix_map.ml
Commit message (Collapse)AuthorAgeFilesLines
* New Build_path_prefix_map module interfaceRichard L Ford2023-03-271-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BUILD_PATH_PREFIX_MAP specification tells how to use that environment variable to achieve reproducible build, i.e. builds of products that do not leak absolute paths from the build environment. See https://reproducible-builds.org/specs/build-path-prefix-map. However, that specification only describes half of the story. Let us call the building of reproducible products the "Build Phase". That is the phase covered by the existing specification. Let us defined the "Deployment phase" as the phase where you accept a built reproducible product and make use of it, i.e. deploy it. An example would be the debugger taking a reproducible binary and letting the user debug it, showing the user the source code, etc. We use the same mechanism in the deployment phase. Then the BUILD_PATH_PREFIX_MAP must be setup with the logical inverse of the mapping used during the build phase. This PR generalized the functions in Build_path_prefix_map and Location to facility the inverse map. Also, this is part of a larger PR, https://github.com/ocaml/ocaml/pull/12126, which itself was part of https://github.com/ocaml/ocaml/pull/12085, that is being split up because it was too large. In addition to these changes, that PR includes ocamltest enhancements plus the tests for these changes. See it for prior discussion and the other changes. For the new functions, see the '.mli' file for details. 1. utils/build_path_prefix_map.{ml,mli} The new api functions are: val rewrite_first : map -> path -> path option val rewrite_all : map -> path -> path list 2. parsing/location.{ml,mli} The new api functions are: val rewrite_find_first_existing: string -> string option val rewrite_find_all_existing_dirs: string -> string list In addition to those new APIs, Location.absolute_path was modified to do rewriting on absolute paths (in addition to relative paths which it was already doing). At the present time their is no code depending on these new APIs, so the only functional change is the change to Location.absolute_path The new API functions are used in the other parts of the PRs mentioned.
* Printexc.catch, Printf.kprintf, Unix.SO_ERROR: add deprecation warning (#10924)Nicolás Ojeda Bär2022-01-211-1/+1
|
* Add missing copyright headersDavid Allsopp2018-06-131-0/+15
| | | | Build_path_prefix_map module missing headers from GPR#1515.
* utils: import build_path_prefix_map libraryGabriel Scherer2018-03-011-0/+104
This library is imported from <https://gitlab.com/gasche/build_path_prefix_map/> commit 811691e479b38c0e6c1c0e5c853c555a63177ee3