Merge pull request #797 from rgrinberg/build-job-set

Change Build_job to be set
This commit is contained in:
Rudi Grinberg 2018-05-24 11:15:26 +07:00 committed by GitHub
commit f59fe20344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View File

@ -1044,12 +1044,13 @@ let install_uninstall ~what =
in
Fiber.parallel_iter install_files_by_context
~f:(fun (context, install_files) ->
let install_files_set = Path.Set.of_list install_files in
get_prefix context ~from_command_line:prefix_from_command_line
>>= fun prefix ->
get_libdir context ~libdir_from_command_line
>>= fun libdir ->
Fiber.parallel_iter install_files ~f:(fun path ->
let purpose = Process.Build_job install_files in
let purpose = Process.Build_job install_files_set in
Process.run ~purpose ~env:setup.env Strict opam_installer
([ sprintf "-%c" what.[0]
; Path.to_string path

View File

@ -929,7 +929,6 @@ let exec ~targets ~context t =
| None -> Env.initial
| Some c -> c.env
in
let targets = Path.Set.to_list targets in
let purpose = Process.Build_job targets in
let ectx = { purpose; context } in
exec t ~ectx ~dir:Path.root ~env ~stdout_to:None ~stderr_to:None

View File

@ -46,7 +46,7 @@ and opened_file_desc =
type purpose =
| Internal_job
| Build_job of Path.t list
| Build_job of Path.Set.t
module Temp = struct
let tmp_files = ref Path.Set.empty
@ -157,6 +157,7 @@ module Fancy = struct
split_paths (("alias " ^ Path.to_string name) :: targets_acc)
(add_ctx ctx ctxs_acc) rest
in
let targets = Path.Set.to_list targets in
let target_names, contexts = split_paths [] [] targets in
let target_names_grouped_by_prefix =
List.map target_names ~f:Filename.split_extension_after_dot

View File

@ -34,7 +34,7 @@ and opened_file_desc =
(** Why a Fiber.t was run *)
type purpose =
| Internal_job
| Build_job of Path.t list
| Build_job of Path.Set.t
(** [run ?dir ?stdout_to prog args] spawns a sub-process and wait for its termination *)
val run