diff --git a/.gitignore b/.gitignore index be69cc69f..11c5b726f 100644 --- a/.gitignore +++ b/.gitignore @@ -163,6 +163,7 @@ infer/src/.project /infer/dune-workspace /infer/src/dune.common /infer/src/dune +/infer/src/opensource/dune .merlin # generated when looking for dead code diff --git a/infer/src/Makefile b/infer/src/Makefile index 78601d613..9fdc8b861 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -76,7 +76,7 @@ GENERATED_FROM_AUTOCONF = dune.common ../dune-workspace base/Version.ml .PHONY: dune-workspace dune-workspace: ../dune-workspace -GENERATED_DUNES += dune +GENERATED_DUNES += dune opensource/dune SRC_BUILD_COMMON = $(GENERATED_FROM_AUTOCONF) $(GENERATED_DUNES) $(OCAML_SOURCES) ifeq ($(BUILD_C_ANALYZERS),yes) @@ -243,6 +243,7 @@ $(GENERATED_DUNES): dune.common dune: dune.in deadcode/dune: deadcode/dune.in +opensource/dune: opensource/dune.in .PHONY: clean clean: diff --git a/infer/src/scuba/LogEntry.ml b/infer/src/base/LogEntry.ml similarity index 100% rename from infer/src/scuba/LogEntry.ml rename to infer/src/base/LogEntry.ml diff --git a/infer/src/scuba/LogEntry.mli b/infer/src/base/LogEntry.mli similarity index 100% rename from infer/src/scuba/LogEntry.mli rename to infer/src/base/LogEntry.mli diff --git a/infer/src/scuba/Scuba.ml b/infer/src/base/Scuba.ml similarity index 100% rename from infer/src/scuba/Scuba.ml rename to infer/src/base/Scuba.ml diff --git a/infer/src/scuba/Scuba.mli b/infer/src/base/Scuba.mli similarity index 100% rename from infer/src/scuba/Scuba.mli rename to infer/src/base/Scuba.mli diff --git a/infer/src/scuba/ScubaLogging.ml b/infer/src/base/ScubaLogging.ml similarity index 100% rename from infer/src/scuba/ScubaLogging.ml rename to infer/src/base/ScubaLogging.ml diff --git a/infer/src/scuba/ScubaLogging.mli b/infer/src/base/ScubaLogging.mli similarity index 100% rename from infer/src/scuba/ScubaLogging.mli rename to infer/src/base/ScubaLogging.mli diff --git a/infer/src/base/dune b/infer/src/base/dune index 1300750b0..4906b1231 100644 --- a/infer/src/base/dune +++ b/infer/src/base/dune @@ -6,9 +6,8 @@ (library (name InferBase) (public_name infer.InferBase) - (flags - (:standard -open Core -open InferStdlib -open IStd -open InferGenerated)) + (flags (:standard -open Core -open InferStdlib -open IStd -open InferGenerated -open OpenSource)) (libraries cmdliner core mtime.clock.os parmap re sqlite3 zip InferGenerated - InferStdlib) + InferStdlib OpenSource) (preprocess (pps ppx_compare ppx_enumerate))) diff --git a/infer/src/dune.in b/infer/src/dune.in index 0ae9f503b..76bad75c3 100644 --- a/infer/src/dune.in +++ b/infer/src/dune.in @@ -10,27 +10,24 @@ let ( ^/ ) = Filename.concat let source_dirs = - (if facebook then "facebook" else "opensource") - :: ( ( if clang then ["al"; "clang"; "unit" ^/ "clang"] - else ["clang_stubs"; "unit" ^/ "clang_stubs"] ) - @ [ (if java then "java" else "java_stubs") - ; "absint" - ; "backend" - ; "biabduction" - ; "bufferoverrun" - ; "checkers" - ; "concurrency" - ; "cost" - ; "integration" - ; "labs" - ; "nullsafe" - ; "pulse" - ; "quandary" - ; "scuba" - ; "test_determinator" - ; "topl" - ; "unit" - ; "unit" ^/ "nullsafe" ] ) + (if clang then ["al"; "clang"; "unit" ^/ "clang"] else ["clang_stubs"; "unit" ^/ "clang_stubs"]) + @ [ (if java then "java" else "java_stubs") + ; "absint" + ; "backend" + ; "biabduction" + ; "bufferoverrun" + ; "checkers" + ; "concurrency" + ; "cost" + ; "integration" + ; "labs" + ; "nullsafe" + ; "pulse" + ; "quandary" + ; "test_determinator" + ; "topl" + ; "unit" + ; "unit" ^/ "nullsafe" ] let infer_binaries = ["infer"; "inferunit"] @ if facebook then ["InferCreateTraceViewLinks"] else [] @@ -60,6 +57,8 @@ let infer_cflags = [ "-open" ; "Core" ; "-open" + ; "OpenSource" + ; "-open" ; "InferStdlib" ; "-open" ; "IStd" diff --git a/infer/src/opensource/FbCostModels.ml b/infer/src/opensource/FbCostModels.ml index eb60fb8f0..062f398db 100644 --- a/infer/src/opensource/FbCostModels.ml +++ b/infer/src/opensource/FbCostModels.ml @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. *) -open! IStd - module Call = struct - let dispatch = ProcnameDispatcher.Call.make_dispatcher [] + let dispatch _ _ _ = None end diff --git a/infer/src/opensource/FbCostModels.mli b/infer/src/opensource/FbCostModels.mli index 984656839..b28a7b603 100644 --- a/infer/src/opensource/FbCostModels.mli +++ b/infer/src/opensource/FbCostModels.mli @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. *) -open! IStd - module Call : sig - val dispatch : (Tenv.t, CostUtils.model, unit) ProcnameDispatcher.Call.dispatcher + val dispatch : 'context -> 'procname_t -> 'arg_payload_FuncArg_t_list -> 'f option end diff --git a/infer/src/opensource/FbPatternMatch.ml b/infer/src/opensource/FbPatternMatch.ml index 97877ab14..fa707a079 100644 --- a/infer/src/opensource/FbPatternMatch.ml +++ b/infer/src/opensource/FbPatternMatch.ml @@ -5,6 +5,4 @@ * LICENSE file in the root directory of this source tree. *) -open! IStd - let is_subtype_of_fb_service_handler _tenv _name = false diff --git a/infer/src/opensource/FbPatternMatch.mli b/infer/src/opensource/FbPatternMatch.mli index 57a64a192..60d99bece 100644 --- a/infer/src/opensource/FbPatternMatch.mli +++ b/infer/src/opensource/FbPatternMatch.mli @@ -5,6 +5,4 @@ * LICENSE file in the root directory of this source tree. *) -open! IStd - -val is_subtype_of_fb_service_handler : Tenv.t -> Typ.Name.t -> bool +val is_subtype_of_fb_service_handler : 'tenv_t -> 'typ_Name_t -> bool diff --git a/infer/src/opensource/FbThreadSafety.ml b/infer/src/opensource/FbThreadSafety.ml index 62c07e3db..7e5e7af10 100644 --- a/infer/src/opensource/FbThreadSafety.ml +++ b/infer/src/opensource/FbThreadSafety.ml @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. *) -open! IStd - let is_custom_init _ _ = false let is_logging_method _ = false diff --git a/infer/src/opensource/FbThreadSafety.mli b/infer/src/opensource/FbThreadSafety.mli index eda2a2650..cf35766ec 100644 --- a/infer/src/opensource/FbThreadSafety.mli +++ b/infer/src/opensource/FbThreadSafety.mli @@ -5,12 +5,10 @@ * LICENSE file in the root directory of this source tree. *) -open! IStd +val is_custom_init : 'tenv_t -> 'procname_t -> bool -val is_custom_init : Tenv.t -> Procname.t -> bool +val is_logging_method : 'procname_t -> bool -val is_logging_method : Procname.t -> bool - -val get_fbthreadsafe_class_annot : Procname.t -> Tenv.t -> (string * string) option +val get_fbthreadsafe_class_annot : 'procname_t -> 'tenv_t -> (string * string) option val message_fbthreadsafe_class : string -> string -> string diff --git a/infer/src/opensource/Scribe.ml b/infer/src/opensource/Scribe.ml index 63bec68a8..59aeee6ff 100644 --- a/infer/src/opensource/Scribe.ml +++ b/infer/src/opensource/Scribe.ml @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. *) -open! IStd - type category = InferEvents let log _ _ = () diff --git a/infer/src/opensource/Scribe.mli b/infer/src/opensource/Scribe.mli index fbea98fac..a423f5f57 100644 --- a/infer/src/opensource/Scribe.mli +++ b/infer/src/opensource/Scribe.mli @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. *) -open! IStd - type category = InferEvents val log : category -> string list -> unit diff --git a/infer/src/opensource/dune.in b/infer/src/opensource/dune.in new file mode 100644 index 000000000..ea66ff1bc --- /dev/null +++ b/infer/src/opensource/dune.in @@ -0,0 +1,21 @@ +(* -*- tuareg -*- *) +(* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) +(* NOTE: prepend dune.common to this file! *) + +(* include the open-source modules only in open-source build modes, otherwise this library is empty *) + +;; +Jbuild_plugin.V1.send + (Format.sprintf {| +(library + (name OpenSource) + (public_name infer.OpenSource) + %s +) +|} + (if facebook then "(modules)" else "(modules :standard)"))