@@ -27,13 +27,33 @@ module Action_output_limit = struct
2727 let equal = Int. equal
2828end
2929
30+ module Workspace_root_for_build_prefix_map = struct
31+ type t =
32+ | Unset
33+ | Set of string
34+
35+ let equal x y =
36+ match x, y with
37+ | Unset , Unset -> true
38+ | Unset , _ | _ , Unset -> false
39+ | Set x , Set y -> String. equal x y
40+ ;;
41+
42+ let to_dyn =
43+ let open Dyn in
44+ function
45+ | Unset -> variant " Unset" []
46+ | Set s -> variant " Set" [ string s ]
47+ ;;
48+ end
49+
3050type t =
3151 { action_stdout_on_success : Action_output_on_success .t
3252 ; action_stderr_on_success : Action_output_on_success .t
3353 ; action_stdout_limit : Action_output_limit .t
3454 ; action_stderr_limit : Action_output_limit .t
3555 ; expand_aliases_in_sandbox : bool
36- ; add_workspace_root_to_build_path_prefix_map : bool
56+ ; workspace_root_to_build_path_prefix_map : Workspace_root_for_build_prefix_map .t
3757 ; should_remove_write_permissions_on_generated_files : bool
3858 }
3959
@@ -43,7 +63,7 @@ let equal
4363 ; action_stdout_limit
4464 ; action_stderr_limit
4565 ; expand_aliases_in_sandbox
46- ; add_workspace_root_to_build_path_prefix_map
66+ ; workspace_root_to_build_path_prefix_map
4767 ; should_remove_write_permissions_on_generated_files
4868 }
4969 t
@@ -53,9 +73,9 @@ let equal
5373 && Action_output_limit. equal action_stdout_limit t.action_stdout_limit
5474 && Action_output_limit. equal action_stderr_limit t.action_stderr_limit
5575 && Bool. equal expand_aliases_in_sandbox t.expand_aliases_in_sandbox
56- && Bool . equal
57- add_workspace_root_to_build_path_prefix_map
58- t.add_workspace_root_to_build_path_prefix_map
76+ && Workspace_root_for_build_prefix_map . equal
77+ workspace_root_to_build_path_prefix_map
78+ t.workspace_root_to_build_path_prefix_map
5979 && Bool. equal
6080 should_remove_write_permissions_on_generated_files
6181 t.should_remove_write_permissions_on_generated_files
@@ -67,7 +87,7 @@ let hash
6787 ; action_stdout_limit
6888 ; action_stderr_limit
6989 ; expand_aliases_in_sandbox
70- ; add_workspace_root_to_build_path_prefix_map
90+ ; workspace_root_to_build_path_prefix_map
7191 ; should_remove_write_permissions_on_generated_files
7292 }
7393 =
@@ -77,7 +97,7 @@ let hash
7797 , action_stdout_limit
7898 , action_stderr_limit
7999 , expand_aliases_in_sandbox
80- , add_workspace_root_to_build_path_prefix_map
100+ , workspace_root_to_build_path_prefix_map
81101 , should_remove_write_permissions_on_generated_files )
82102;;
83103
@@ -87,7 +107,7 @@ let to_dyn
87107 ; action_stdout_limit
88108 ; action_stderr_limit
89109 ; expand_aliases_in_sandbox
90- ; add_workspace_root_to_build_path_prefix_map
110+ ; workspace_root_to_build_path_prefix_map
91111 ; should_remove_write_permissions_on_generated_files
92112 }
93113 =
@@ -97,8 +117,9 @@ let to_dyn
97117 ; " action_stdout_limit" , Action_output_limit. to_dyn action_stdout_limit
98118 ; " action_stderr_limit" , Action_output_limit. to_dyn action_stderr_limit
99119 ; " expand_aliases_in_sandbox" , Bool expand_aliases_in_sandbox
100- ; ( " add_workspace_root_to_build_path_prefix_map"
101- , Bool add_workspace_root_to_build_path_prefix_map )
120+ ; ( " workspace_root_to_build_path_prefix_map"
121+ , Workspace_root_for_build_prefix_map. to_dyn workspace_root_to_build_path_prefix_map
122+ )
102123 ; ( " should_remove_write_permissions_on_generated_files"
103124 , Bool should_remove_write_permissions_on_generated_files )
104125 ]
@@ -110,7 +131,7 @@ let builtin_default =
110131 ; action_stdout_limit = Action_output_limit. default
111132 ; action_stderr_limit = Action_output_limit. default
112133 ; expand_aliases_in_sandbox = true
113- ; add_workspace_root_to_build_path_prefix_map = true
134+ ; workspace_root_to_build_path_prefix_map = Set " /workspace_root "
114135 ; should_remove_write_permissions_on_generated_files = true
115136 }
116137;;
@@ -121,20 +142,16 @@ let set_action_stdout_limit x t = { t with action_stdout_limit = x }
121142let set_action_stderr_limit x t = { t with action_stderr_limit = x }
122143let set_expand_aliases_in_sandbox x t = { t with expand_aliases_in_sandbox = x }
123144
124- let set_add_workspace_root_to_build_path_prefix_map x t =
125- { t with add_workspace_root_to_build_path_prefix_map = x }
145+ let set_workspace_root_to_build_path_prefix_map x t =
146+ { t with workspace_root_to_build_path_prefix_map = x }
126147;;
127148
128149let set_should_remove_write_permissions_on_generated_files x t =
129150 { t with should_remove_write_permissions_on_generated_files = x }
130151;;
131152
132153let expand_aliases_in_sandbox t = t.expand_aliases_in_sandbox
133-
134- let add_workspace_root_to_build_path_prefix_map t =
135- t.add_workspace_root_to_build_path_prefix_map
136- ;;
137-
154+ let workspace_root_to_build_path_prefix_map t = t.workspace_root_to_build_path_prefix_map
138155let action_stdout_on_success t = t.action_stdout_on_success
139156let action_stderr_on_success t = t.action_stderr_on_success
140157let action_stdout_limit t = t.action_stdout_limit
0 commit comments