Ignore all errors while running `ocamlfind printconf path`
This commit is contained in:
parent
48ac99797e
commit
34722a921a
|
@ -1,3 +1,9 @@
|
||||||
|
* 1.0+beta4
|
||||||
|
|
||||||
|
- Improve error messages about invalid/missing pkg.opam files
|
||||||
|
|
||||||
|
- Ignore all errors while running =ocamlfind printconf path=
|
||||||
|
|
||||||
* 1.0+beta3 (15/03/2017)
|
* 1.0+beta3 (15/03/2017)
|
||||||
|
|
||||||
- Print optional dependencies as optional in the output of =jbuilder
|
- Print optional dependencies as optional in the output of =jbuilder
|
||||||
|
|
|
@ -202,7 +202,7 @@ let create ~(kind : Kind.t) ~path ~base_env ~env_extra ~name ~merlin =
|
||||||
| None ->
|
| None ->
|
||||||
return []
|
return []
|
||||||
| Some fn ->
|
| Some fn ->
|
||||||
Future.run_capture_lines ~env (Accept [127])
|
Future.run_capture_lines ~env (Accept All)
|
||||||
(Path.to_string fn) ["printconf"; "path"]
|
(Path.to_string fn) ["printconf"; "path"]
|
||||||
>>| function
|
>>| function
|
||||||
| Ok lines -> List.map lines ~f:Path.absolute
|
| Ok lines -> List.map lines ~f:Path.absolute
|
||||||
|
|
|
@ -134,13 +134,23 @@ let rec all_unit = function
|
||||||
x >>= fun () ->
|
x >>= fun () ->
|
||||||
all_unit l
|
all_unit l
|
||||||
|
|
||||||
|
type accepted_codes =
|
||||||
|
| These of int list
|
||||||
|
| All
|
||||||
|
|
||||||
|
let code_is_ok accepted_codes n =
|
||||||
|
match accepted_codes with
|
||||||
|
| These set -> List.mem n ~set
|
||||||
|
| All -> true
|
||||||
|
|
||||||
type ('a, 'b) failure_mode =
|
type ('a, 'b) failure_mode =
|
||||||
| Strict : ('a, 'a) failure_mode
|
| Strict : ('a, 'a) failure_mode
|
||||||
| Accept : int list -> ('a, ('a, int) result) failure_mode
|
| Accept : accepted_codes -> ('a, ('a, int) result) failure_mode
|
||||||
|
|
||||||
let accepted_codes : type a b. (a, b) failure_mode -> int list = function
|
let accepted_codes : type a b. (a, b) failure_mode -> accepted_codes = function
|
||||||
| Strict -> [0]
|
| Strict -> These [0]
|
||||||
| Accept codes -> 0 :: codes
|
| Accept (These codes) -> These (0 :: codes)
|
||||||
|
| Accept All -> All
|
||||||
|
|
||||||
let map_result
|
let map_result
|
||||||
: type a b. (a, b) failure_mode -> int t -> f:(unit -> a) -> b t
|
: type a b. (a, b) failure_mode -> int t -> f:(unit -> a) -> b t
|
||||||
|
@ -175,7 +185,7 @@ type job =
|
||||||
; stderr_to : std_output_to
|
; stderr_to : std_output_to
|
||||||
; env : string array option
|
; env : string array option
|
||||||
; ivar : int Ivar.t
|
; ivar : int Ivar.t
|
||||||
; ok_codes : int list
|
; ok_codes : accepted_codes
|
||||||
}
|
}
|
||||||
|
|
||||||
let to_run : job Queue.t = Queue.create ()
|
let to_run : job Queue.t = Queue.create ()
|
||||||
|
@ -341,7 +351,7 @@ module Scheduler = struct
|
||||||
~exit_status:status;
|
~exit_status:status;
|
||||||
if not exiting then begin
|
if not exiting then begin
|
||||||
match status with
|
match status with
|
||||||
| WEXITED n when List.mem n ~set:job.job.ok_codes ->
|
| WEXITED n when code_is_ok job.job.ok_codes n ->
|
||||||
if output <> "" then
|
if output <> "" then
|
||||||
Format.eprintf "@{<kwd>Output@}[@{<id>%d@}]:\n%s%!" job.id output;
|
Format.eprintf "@{<kwd>Output@}[@{<id>%d@}]:\n%s%!" job.id output;
|
||||||
if n <> 0 then
|
if n <> 0 then
|
||||||
|
|
|
@ -15,11 +15,15 @@ val all_unit : unit t list -> unit t
|
||||||
|
|
||||||
val with_exn_handler : (unit -> 'a) -> handler:(exn -> Printexc.raw_backtrace -> unit) -> 'a
|
val with_exn_handler : (unit -> 'a) -> handler:(exn -> Printexc.raw_backtrace -> unit) -> 'a
|
||||||
|
|
||||||
|
type accepted_codes =
|
||||||
|
| These of int list
|
||||||
|
| All
|
||||||
|
|
||||||
(** How to handle sub-process failures *)
|
(** How to handle sub-process failures *)
|
||||||
type ('a, 'b) failure_mode =
|
type ('a, 'b) failure_mode =
|
||||||
| Strict : ('a, 'a) failure_mode
|
| Strict : ('a, 'a) failure_mode
|
||||||
(** Fail if the process exits with anything else than [0] *)
|
(** Fail if the process exits with anything else than [0] *)
|
||||||
| Accept : int list -> ('a, ('a, int) result) failure_mode
|
| Accept : accepted_codes -> ('a, ('a, int) result) failure_mode
|
||||||
(** Accept the following non-zero exit codes, and return [Error code] if the process
|
(** Accept the following non-zero exit codes, and return [Error code] if the process
|
||||||
exists with one of these codes. *)
|
exists with one of these codes. *)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue