diff --git a/infer/src/integration/Buck.ml b/infer/src/integration/Buck.ml index 58a672d6d..deb34db1f 100644 --- a/infer/src/integration/Buck.ml +++ b/infer/src/integration/Buck.ml @@ -228,11 +228,12 @@ let add_flavors_to_buck_arguments ~filter_kind ~dep_depth ~extra_flavors origina let parsed_args = parse_cmd_args empty_parsed_args args in let targets = match (filter_kind, dep_depth, parsed_args) with - | false, None, {pattern_targets= []; alias_targets= []; normal_targets} -> + | (`No | `Auto), None, {pattern_targets= []; alias_targets= []; normal_targets} -> normal_targets - | false, None, {pattern_targets= []; alias_targets; normal_targets} -> + | `No, None, {pattern_targets= []; alias_targets; normal_targets} -> alias_targets |> resolve_alias_targets |> List.rev_append normal_targets - | _, _, {pattern_targets; alias_targets; normal_targets} -> + | (`Yes | `No | `Auto), _, {pattern_targets; alias_targets; normal_targets} -> + let filter_kind = match filter_kind with `No -> false | `Yes | `Auto -> true in pattern_targets |> List.rev_append alias_targets |> List.rev_append normal_targets |> resolve_pattern_targets ~filter_kind ~dep_depth in diff --git a/infer/src/integration/Buck.mli b/infer/src/integration/Buck.mli index cd487e96e..251a63767 100644 --- a/infer/src/integration/Buck.mli +++ b/infer/src/integration/Buck.mli @@ -12,8 +12,8 @@ open! IStd type flavored_arguments = {command: string; rev_not_targets: string list; targets: string list} val add_flavors_to_buck_arguments : - filter_kind:bool -> dep_depth:int option option -> extra_flavors:string list -> string list - -> flavored_arguments + filter_kind:[< `Yes | `No | `Auto] -> dep_depth:int option option -> extra_flavors:string list + -> string list -> flavored_arguments (** Add infer flavors to the targets in the given buck arguments, depending on the infer analyzer. For instance, in capture mode, the buck command: build //foo/bar:baz#some,flavor diff --git a/infer/src/integration/CaptureCompilationDatabase.ml b/infer/src/integration/CaptureCompilationDatabase.ml index 1dc5b1751..920711d3c 100644 --- a/infer/src/integration/CaptureCompilationDatabase.ml +++ b/infer/src/integration/CaptureCompilationDatabase.ml @@ -94,7 +94,7 @@ let get_compilation_database_files_buck ~prog ~args = match Config.buck_compilation_database with Some Deps depth -> Some depth | _ -> None in match - Buck.add_flavors_to_buck_arguments ~filter_kind:true ~dep_depth + Buck.add_flavors_to_buck_arguments ~filter_kind:`Yes ~dep_depth ~extra_flavors:Config.append_buck_flavors args with | {command= "build" as command; rev_not_targets; targets} -> diff --git a/infer/src/integration/Driver.ml b/infer/src/integration/Driver.ml index 5ecf97c49..b9b828776 100644 --- a/infer/src/integration/Driver.ml +++ b/infer/src/integration/Driver.ml @@ -289,7 +289,7 @@ let capture ~changed_files mode = Unix.putenv ~key:CLOpt.args_env_var ~data:infer_args_with_buck ; let prog, buck_args = IList.uncons_exn build_cmd in let {Buck.command; rev_not_targets; targets} = - Buck.add_flavors_to_buck_arguments ~filter_kind:false ~dep_depth:None + Buck.add_flavors_to_buck_arguments ~filter_kind:`Auto ~dep_depth:None ~extra_flavors:[] buck_args in let all_args = List.rev_append rev_not_targets targets in