Revert name change
This commit is contained in:
parent
cd359538b0
commit
987d437a99
|
@ -166,7 +166,7 @@ let run ?(dir=Path.root) ?stdout_to ?env ?(extra_targets=[]) prog args =
|
||||||
|
|
||||||
module Shexp = struct
|
module Shexp = struct
|
||||||
open Future
|
open Future
|
||||||
open User_action.Mini_shexp
|
open Action.Mini_shexp
|
||||||
|
|
||||||
let run ~dir ~env ~env_extra ~stdout_to ~tail prog args =
|
let run ~dir ~env ~env_extra ~stdout_to ~tail prog args =
|
||||||
let stdout_to : Future.stdout_to =
|
let stdout_to : Future.stdout_to =
|
||||||
|
@ -247,9 +247,9 @@ module Shexp = struct
|
||||||
exec t ~dir ~env ~env_extra:String_map.empty ~stdout_to:None ~tail:true
|
exec t ~dir ~env ~env_extra:String_map.empty ~stdout_to:None ~tail:true
|
||||||
end
|
end
|
||||||
|
|
||||||
let user_action action ~dir ~env ~targets =
|
let action action ~dir ~env ~targets =
|
||||||
prim ~targets (fun () ->
|
prim ~targets (fun () ->
|
||||||
match (action : _ User_action.t) with
|
match (action : _ Action.t) with
|
||||||
| Bash cmd ->
|
| Bash cmd ->
|
||||||
Future.run Strict ~dir:(Path.to_string dir) ~env
|
Future.run Strict ~dir:(Path.to_string dir) ~env
|
||||||
"/bin/bash" ["-e"; "-u"; "-o"; "pipefail"; "-c"; cmd]
|
"/bin/bash" ["-e"; "-u"; "-o"; "pipefail"; "-c"; cmd]
|
||||||
|
|
|
@ -64,8 +64,8 @@ val run
|
||||||
-> 'a Arg_spec.t list
|
-> 'a Arg_spec.t list
|
||||||
-> ('a, unit) t
|
-> ('a, unit) t
|
||||||
|
|
||||||
val user_action
|
val action
|
||||||
: string User_action.t
|
: string Action.t
|
||||||
-> dir:Path.t
|
-> dir:Path.t
|
||||||
-> env:string array
|
-> env:string array
|
||||||
-> targets:Path.t list
|
-> targets:Path.t list
|
||||||
|
|
|
@ -1293,16 +1293,16 @@ module Gen(P : Params) = struct
|
||||||
| User actions |
|
| User actions |
|
||||||
+-----------------------------------------------------------------+ *)
|
+-----------------------------------------------------------------+ *)
|
||||||
|
|
||||||
module User_action_interpret : sig
|
module Action_interpret : sig
|
||||||
val run
|
val run
|
||||||
: User_action.Unexpanded.t
|
: Action.Unexpanded.t
|
||||||
-> dir:Path.t
|
-> dir:Path.t
|
||||||
-> dep_kind:Build.lib_dep_kind
|
-> dep_kind:Build.lib_dep_kind
|
||||||
-> targets:Path.t list
|
-> targets:Path.t list
|
||||||
-> deps:Dep_conf.t list
|
-> deps:Dep_conf.t list
|
||||||
-> (unit, unit) Build.t
|
-> (unit, unit) Build.t
|
||||||
end = struct
|
end = struct
|
||||||
module U = User_action.Unexpanded
|
module U = Action.Unexpanded
|
||||||
|
|
||||||
type resolved_forms =
|
type resolved_forms =
|
||||||
{ (* Mapping from ${...} forms to their resolutions *)
|
{ (* Mapping from ${...} forms to their resolutions *)
|
||||||
|
@ -1380,7 +1380,7 @@ module Gen(P : Params) = struct
|
||||||
in
|
in
|
||||||
let forms = extract_artifacts ~dir t in
|
let forms = extract_artifacts ~dir t in
|
||||||
let t =
|
let t =
|
||||||
User_action.Unexpanded.expand dir t
|
Action.Unexpanded.expand dir t
|
||||||
~f:(expand_string_with_vars ~artifacts:forms.artifacts ~targets ~deps)
|
~f:(expand_string_with_vars ~artifacts:forms.artifacts ~targets ~deps)
|
||||||
in
|
in
|
||||||
let build =
|
let build =
|
||||||
|
@ -1390,7 +1390,7 @@ module Gen(P : Params) = struct
|
||||||
>>>
|
>>>
|
||||||
Build.paths (String_map.values forms.artifacts)
|
Build.paths (String_map.values forms.artifacts)
|
||||||
>>>
|
>>>
|
||||||
Build.user_action t ~dir ~env:ctx.env ~targets
|
Build.action t ~dir ~env:ctx.env ~targets
|
||||||
in
|
in
|
||||||
match forms.failures with
|
match forms.failures with
|
||||||
| [] -> build
|
| [] -> build
|
||||||
|
@ -1406,7 +1406,7 @@ module Gen(P : Params) = struct
|
||||||
add_rule
|
add_rule
|
||||||
(Dep_conf_interpret.dep_of_list ~dir rule.deps
|
(Dep_conf_interpret.dep_of_list ~dir rule.deps
|
||||||
>>>
|
>>>
|
||||||
User_action_interpret.run
|
Action_interpret.run
|
||||||
rule.action
|
rule.action
|
||||||
~dir
|
~dir
|
||||||
~dep_kind:Required
|
~dep_kind:Required
|
||||||
|
@ -1420,7 +1420,7 @@ module Gen(P : Params) = struct
|
||||||
let action =
|
let action =
|
||||||
match alias_conf.action with
|
match alias_conf.action with
|
||||||
| None -> Sexp.Atom "none"
|
| None -> Sexp.Atom "none"
|
||||||
| Some a -> List [Atom "some" ; User_action.Unexpanded.sexp_of_t a] in
|
| Some a -> List [Atom "some" ; Action.Unexpanded.sexp_of_t a] in
|
||||||
Sexp.List [deps ; action]
|
Sexp.List [deps ; action]
|
||||||
|> Sexp.to_string
|
|> Sexp.to_string
|
||||||
|> Digest.string
|
|> Digest.string
|
||||||
|
@ -1435,7 +1435,7 @@ module Gen(P : Params) = struct
|
||||||
| None -> deps
|
| None -> deps
|
||||||
| Some action ->
|
| Some action ->
|
||||||
deps
|
deps
|
||||||
>>> User_action_interpret.run
|
>>> Action_interpret.run
|
||||||
action
|
action
|
||||||
~dir
|
~dir
|
||||||
~dep_kind:Required
|
~dep_kind:Required
|
||||||
|
|
|
@ -546,13 +546,13 @@ module Rule = struct
|
||||||
type t =
|
type t =
|
||||||
{ targets : string list (** List of files in the current directory *)
|
{ targets : string list (** List of files in the current directory *)
|
||||||
; deps : Dep_conf.t list
|
; deps : Dep_conf.t list
|
||||||
; action : User_action.Unexpanded.t
|
; action : Action.Unexpanded.t
|
||||||
}
|
}
|
||||||
|
|
||||||
let common =
|
let common =
|
||||||
field "targets" (list file_in_current_dir) >>= fun targets ->
|
field "targets" (list file_in_current_dir) >>= fun targets ->
|
||||||
field "deps" (list Dep_conf.t) ~default:[] >>= fun deps ->
|
field "deps" (list Dep_conf.t) ~default:[] >>= fun deps ->
|
||||||
field "action" User_action.Unexpanded.t >>= fun action ->
|
field "action" Action.Unexpanded.t >>= fun action ->
|
||||||
return { targets; deps; action }
|
return { targets; deps; action }
|
||||||
|
|
||||||
let v1 = record common
|
let v1 = record common
|
||||||
|
@ -660,13 +660,13 @@ module Alias_conf = struct
|
||||||
type t =
|
type t =
|
||||||
{ name : string
|
{ name : string
|
||||||
; deps : Dep_conf.t list
|
; deps : Dep_conf.t list
|
||||||
; action : User_action.Unexpanded.t option
|
; action : Action.Unexpanded.t option
|
||||||
}
|
}
|
||||||
|
|
||||||
let common =
|
let common =
|
||||||
field "name" string >>= fun name ->
|
field "name" string >>= fun name ->
|
||||||
field "deps" (list Dep_conf.t) ~default:[] >>= fun deps ->
|
field "deps" (list Dep_conf.t) ~default:[] >>= fun deps ->
|
||||||
field_o "action" User_action.Unexpanded.t >>= fun action ->
|
field_o "action" Action.Unexpanded.t >>= fun action ->
|
||||||
return
|
return
|
||||||
{ name
|
{ name
|
||||||
; deps
|
; deps
|
||||||
|
|
Loading…
Reference in New Issue