From bca942c6945fb0068e0e4bb06a3da4b35cb95a62 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Tue, 18 Sep 2018 05:49:21 -0700 Subject: [PATCH] [python] kill python frontend Summary: Undeveloped frontend needs maintenance. We will most probably not pursue Python anyway. Reviewed By: mbouaziz, jvillard Differential Revision: D9894299 fbshipit-source-id: c9707b904 --- Makefile.autoconf.in | 1 - configure.ac | 9 --------- infer/src/Makefile | 1 - infer/src/backend/PerfStats.ml | 6 ------ infer/src/backend/PerfStats.mli | 1 - infer/src/base/Config.ml | 2 -- infer/src/base/Config.mli | 1 - infer/src/base/DB.mli | 3 --- infer/src/base/Language.ml | 6 +++--- infer/src/base/Language.mli | 2 +- infer/src/base/Version.ml.in | 2 -- infer/src/base/Version.mli | 2 -- infer/src/biabduction/Prover.ml | 4 ---- infer/src/biabduction/Rearrange.ml | 2 -- infer/src/biabduction/interproc.ml | 2 -- infer/src/deadcode/Makefile | 2 +- infer/src/dune.common.in | 2 -- infer/src/dune.in | 3 --- infer/src/integration/Driver.ml | 14 -------------- infer/src/integration/Driver.mli | 1 - infer/src/python_stubs/pythonMain.ml | 9 --------- infer/src/python_stubs/pythonMain.mli | 10 ---------- 22 files changed, 5 insertions(+), 80 deletions(-) delete mode 100644 infer/src/python_stubs/pythonMain.ml delete mode 100644 infer/src/python_stubs/pythonMain.mli diff --git a/Makefile.autoconf.in b/Makefile.autoconf.in index 4325959ba..eee107622 100644 --- a/Makefile.autoconf.in +++ b/Makefile.autoconf.in @@ -11,7 +11,6 @@ bindir = @bindir@ BUCK = @BUCK@ BUILD_C_ANALYZERS = @BUILD_C_ANALYZERS@ BUILD_JAVA_ANALYZERS = @BUILD_JAVA_ANALYZERS@ -BUILD_PYTHON_ANALYZERS = @BUILD_PYTHON_ANALYZERS@ CAML_LD_LIBRARY_PATH = @CAML_LD_LIBRARY_PATH@ CC = @CC@ CFLAGS = @CFLAGS@ diff --git a/configure.ac b/configure.ac index a42bc7066..4144c0dcc 100644 --- a/configure.ac +++ b/configure.ac @@ -67,15 +67,6 @@ AC_ARG_ENABLE(java-analyzers, BUILD_JAVA_ANALYZERS=$enable_java_analyzers AC_SUBST([BUILD_JAVA_ANALYZERS]) -AC_ARG_ENABLE(python-analyzers, - AS_HELP_STRING([--disable-python-analyzers], - [do not build the Python analyzers (default is to build them)]), - , - enable_python_analyzers=yes) - -BUILD_PYTHON_ANALYZERS=$enable_python_analyzers -AC_SUBST([BUILD_PYTHON_ANALYZERS]) - AC_ARG_WITH(fcp-clang, AS_HELP_STRING([--with-fcp-clang], [use $CLANG_PREFIX/bin/clang to override the default compiler (default is not to override)]), diff --git a/infer/src/Makefile b/infer/src/Makefile index dd19d674e..2dd3abe32 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -255,7 +255,6 @@ $(GENERATED_FROM_AUTOCONF): $(MAKEFILE_LIST) -e "s|@INFER_GIT_BRANCH[@]|$$INFER_GIT_BRANCH|g" \ -e "s|@BUILD_C_ANALYZERS[@]|$(BUILD_C_ANALYZERS)|g" \ -e "s|@BUILD_JAVA_ANALYZERS[@]|$(BUILD_JAVA_ANALYZERS)|g" \ - -e "s|@BUILD_PYTHON_ANALYZERS[@]|$(BUILD_PYTHON_ANALYZERS)|g" \ -e "s|@OPAMSWITCH[@]|$(OPAMSWITCH)|g" \ -e "s|@XCODE_SELECT[@]|$(XCODE_SELECT)|g" \ -e "s|@INFER_MAN_LAST_MODIFIED[@]|$(INFER_MAN_LAST_MODIFIED)|g" \ diff --git a/infer/src/backend/PerfStats.ml b/infer/src/backend/PerfStats.ml index 05c9957b8..b6dca5ace 100644 --- a/infer/src/backend/PerfStats.ml +++ b/infer/src/backend/PerfStats.ml @@ -34,7 +34,6 @@ type stats_type = | ClangFrontend of SourceFile.t | ClangFrontendLinters of SourceFile.t | JavaFrontend of SourceFile.t - | PythonFrontend of SourceFile.t | TotalFrontend | Backend of SourceFile.t | TotalBackend @@ -46,7 +45,6 @@ let source_file_of_stats_type = function | ClangFrontend source_file | ClangFrontendLinters source_file | JavaFrontend source_file - | PythonFrontend source_file | Backend source_file -> Some source_file | _ -> @@ -74,8 +72,6 @@ let relative_path_of_stats_type stats_type = Config.frontend_stats_dir_name | JavaFrontend _ -> Config.frontend_stats_dir_name - | PythonFrontend _ -> - Config.frontend_stats_dir_name | TotalFrontend -> Config.frontend_stats_dir_name | Backend _ -> @@ -99,8 +95,6 @@ let string_of_stats_type = function "clang_frontend_and_linters" | JavaFrontend _ -> "java_frontend" - | PythonFrontend _ -> - "python_frontend" | TotalFrontend -> "total_frontend" | Backend _ -> diff --git a/infer/src/backend/PerfStats.mli b/infer/src/backend/PerfStats.mli index b58d0eda2..85018af0f 100644 --- a/infer/src/backend/PerfStats.mli +++ b/infer/src/backend/PerfStats.mli @@ -18,7 +18,6 @@ type stats_type = | ClangFrontend of SourceFile.t | ClangFrontendLinters of SourceFile.t | JavaFrontend of SourceFile.t - | PythonFrontend of SourceFile.t | TotalFrontend | Backend of SourceFile.t | TotalBackend diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index eaab8e677..16de0892b 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -85,7 +85,6 @@ type build_system = | BMake | BMvn | BNdk - | BPython | BXcode [@@deriving compare] @@ -114,7 +113,6 @@ let build_system_exe_assoc = ; (BMvn, "mvn") ; (BMvn, "mvnw") ; (BNdk, "ndk-build") - ; (BPython, "python") ; (BXcode, "xcodebuild") ] diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index e3c9cea45..e3a876ac9 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -40,7 +40,6 @@ type build_system = | BMake | BMvn | BNdk - | BPython | BXcode [@@deriving compare] diff --git a/infer/src/base/DB.mli b/infer/src/base/DB.mli index 5cacc7338..91da0f888 100644 --- a/infer/src/base/DB.mli +++ b/infer/src/base/DB.mli @@ -69,9 +69,6 @@ val source_file_encoding : SourceFile.t -> string (** source directory: the directory inside the results dir corresponding to a source file *) type source_dir [@@deriving compare] -val source_dir_to_string : source_dir -> string -(** expose the source dir as a string *) - val source_dir_get_internal_file : source_dir -> string -> filename (** get the path to an internal file with the given extention (.tenv, ...) *) diff --git a/infer/src/base/Language.ml b/infer/src/base/Language.ml index 8528b289c..f14766ccb 100644 --- a/infer/src/base/Language.ml +++ b/infer/src/base/Language.ml @@ -6,15 +6,15 @@ *) open! IStd -type t = Clang | Java | Python [@@deriving compare] +type t = Clang | Java [@@deriving compare] let equal = [%compare.equal: t] -let language_to_string = [(Clang, "C/C++/ObjC"); (Java, "Java"); (Python, "python")] +let language_to_string = [(Clang, "C/C++/ObjC"); (Java, "Java")] let to_string lang = List.Assoc.find_exn language_to_string ~equal lang -let to_explicit_string = function Clang -> "Clang" | Java -> "Java" | Python -> "Python" +let to_explicit_string = function Clang -> "Clang" | Java -> "Java" let of_string s = List.Assoc.find (List.Assoc.inverse language_to_string) ~equal:String.equal s diff --git a/infer/src/base/Language.mli b/infer/src/base/Language.mli index eef344784..894e79fd3 100644 --- a/infer/src/base/Language.mli +++ b/infer/src/base/Language.mli @@ -7,7 +7,7 @@ open! IStd -type t = Clang | Java | Python [@@deriving compare] +type t = Clang | Java [@@deriving compare] val equal : t -> t -> bool diff --git a/infer/src/base/Version.ml.in b/infer/src/base/Version.ml.in index 708c6243f..21c4ccecd 100644 --- a/infer/src/base/Version.ml.in +++ b/infer/src/base/Version.ml.in @@ -43,8 +43,6 @@ let clang_enabled = is_yes "@BUILD_C_ANALYZERS@" let java_enabled = is_yes "@BUILD_JAVA_ANALYZERS@" -let python_enabled = is_yes "@BUILD_PYTHON_ANALYZERS@" - let xcode_enabled = is_not_no "@XCODE_SELECT@" let man_pages_last_modify_date = "@INFER_MAN_LAST_MODIFIED@" diff --git a/infer/src/base/Version.mli b/infer/src/base/Version.mli index 69895730f..bfaf9146c 100644 --- a/infer/src/base/Version.mli +++ b/infer/src/base/Version.mli @@ -23,8 +23,6 @@ val clang_enabled : bool val java_enabled : bool -val python_enabled : bool - val xcode_enabled : bool val man_pages_last_modify_date : string diff --git a/infer/src/biabduction/Prover.ml b/infer/src/biabduction/Prover.ml index ef7df575c..857515587 100644 --- a/infer/src/biabduction/Prover.ml +++ b/infer/src/biabduction/Prover.ml @@ -2326,8 +2326,6 @@ and sigma_imply tenv calc_index_frame calc_missing subs prop1 sigma2 : subst2 * ; "java.lang.String.value" ] in Sil.Estruct (List.map ~f:mk_fld_sexp fields, Sil.inst_none) - | Python -> - L.die InternalError "mk_constant_string_hpred not implemented for Python" in let const_string_texp = match !Language.curr_language with @@ -2344,8 +2342,6 @@ and sigma_imply tenv calc_index_frame calc_missing subs prop1 sigma2 : subst2 * ; nbytes= None ; dynamic_length= None ; subtype= Subtype.exact } - | Python -> - L.die InternalError "const_string_texp not implemented for Python" in Sil.Hpointsto (root, sexp, const_string_texp) in diff --git a/infer/src/biabduction/Rearrange.ml b/infer/src/biabduction/Rearrange.ml index 4ac3c4415..f0331d2a5 100644 --- a/infer/src/biabduction/Rearrange.ml +++ b/infer/src/biabduction/Rearrange.ml @@ -462,8 +462,6 @@ let mk_ptsto_exp_footprint pname tenv orig_prop (lexp, typ) max_stamp inst : Subtype.exact | Java -> Subtype.subtypes - | Python -> - L.die InternalError "Subtypes for Python not implemented" in let create_ptsto footprint_part off0 = match (root, off0, typ.Typ.desc) with diff --git a/infer/src/biabduction/interproc.ml b/infer/src/biabduction/interproc.ml index d97b462e4..1df50b5cd 100644 --- a/infer/src/biabduction/interproc.ml +++ b/infer/src/biabduction/interproc.ml @@ -705,8 +705,6 @@ let prop_init_formals_seed tenv new_formals (prop : 'a Prop.t) : Prop.exposed Pr Exp.Sizeof {typ; nbytes= None; dynamic_length= None; subtype= Subtype.exact} | Java -> Exp.Sizeof {typ; nbytes= None; dynamic_length= None; subtype= Subtype.subtypes} - | Python -> - L.die InternalError "prop_init_formals_seed not implemented for Python" in Prop.mk_ptsto_lvar tenv Prop.Fld_init Sil.inst_formal (pv, texp, None) in diff --git a/infer/src/deadcode/Makefile b/infer/src/deadcode/Makefile index 61796fc1a..2c846debe 100644 --- a/infer/src/deadcode/Makefile +++ b/infer/src/deadcode/Makefile @@ -46,7 +46,7 @@ depend: ocamldep -native \ -I IR -I absint -I atd -I backend -I base -I biabduction -I bufferoverrun -I checkers \ -I clang -I concurrency -I eradicate -I facebook -I integration -I istd \ - -I java -I labs -I python -I quandary -I unit -I unit/clang -I deadcode \ + -I java -I labs -I quandary -I unit -I unit/clang -I deadcode \ $(ml_src_files) > deadcode/.depend # circular dependency... not sure how to fix properly diff --git a/infer/src/dune.common.in b/infer/src/dune.common.in index 95e52c233..e8dd2992d 100644 --- a/infer/src/dune.common.in +++ b/infer/src/dune.common.in @@ -21,8 +21,6 @@ let clang = is_yes "@BUILD_C_ANALYZERS@" let java = is_yes "@BUILD_JAVA_ANALYZERS@" -let python = is_yes "@BUILD_PYTHON_ANALYZERS@" - let facebook = is_yes "@IS_FACEBOOK_TREE@" let extra_cflags = if "@EXTRA_CFLAGS" = "" then [] else ["@EXTRA_CFLAGS@"] diff --git a/infer/src/dune.in b/infer/src/dune.in index cdc539cc7..c981e3c86 100644 --- a/infer/src/dune.in +++ b/infer/src/dune.in @@ -7,7 +7,6 @@ let source_dirs = (if facebook then "facebook" else "opensource") :: ( (if clang then ["clang"; "unit" ^/ "clang"] else ["clang_stubs"; "unit" ^/ "clang_stubs"]) @ [ (if java then "java" else "java_stubs") - ; (if python && facebook then "python" else "python_stubs") ; "absint" ; "backend" ; "biabduction" @@ -45,8 +44,6 @@ let infer_cflags = let stanzas = ( if clang then ["(ocamllex types_lexer ctl_lexer)"; "(menhir (modules types_parser ctl_parser))"] else [] ) - @ ( if python && facebook then ["(ocamllex pythonLexer)"; "(menhir (modules pythonParser))"] - else [] ) @ [ Format.sprintf {| (library diff --git a/infer/src/integration/Driver.ml b/infer/src/integration/Driver.ml index f6d313c51..53bbe2778 100644 --- a/infer/src/integration/Driver.ml +++ b/infer/src/integration/Driver.ml @@ -22,7 +22,6 @@ type mode = | ClangCompilationDB of [`Escaped of string | `Raw of string] list | Javac of Javac.compiler * string * string list | Maven of string * string list - | Python of string list | PythonCapture of Config.build_system * string list | XcodeXcpretty of string * string list [@@deriving compare] @@ -39,8 +38,6 @@ let pp_mode fmt = function args | ClangCompilationDB _ -> F.fprintf fmt "ClangCompilationDB driver mode" - | Python args -> - F.fprintf fmt "Python driver mode:@\nargs = %a" Pp.cli_args args | PythonCapture (bs, args) -> F.fprintf fmt "PythonCapture driver mode:@\nbuild system = '%s'@\nargs = %a" (Config.string_of_build_system bs) @@ -215,9 +212,6 @@ let capture ~changed_files = function | Maven (prog, args) -> L.progress "Capturing in maven mode...@." ; Maven.capture ~prog ~args - | Python args -> - (* pretend prog is the root directory of the project *) - PythonMain.go args | PythonCapture (build_system, build_cmd) -> register_perf_stats_report PerfStats.TotalFrontend ; L.progress "Capturing in %s mode...@." (Config.string_of_build_system build_system) ; @@ -412,8 +406,6 @@ let assert_supported_mode required_analyzer requested_mode_string = Version.clang_enabled | `Java -> Version.java_enabled - | `Python -> - Version.python_enabled | `Xcode -> Version.clang_enabled && Version.xcode_enabled in @@ -424,8 +416,6 @@ let assert_supported_mode required_analyzer requested_mode_string = "clang" | `Java -> "java" - | `Python -> - "python" | `Xcode -> "clang and xcode" in @@ -441,8 +431,6 @@ let assert_supported_build_system build_system = Config.string_of_build_system build_system |> assert_supported_mode `Java | BClang | BMake | BNdk -> Config.string_of_build_system build_system |> assert_supported_mode `Clang - | BPython -> - Config.string_of_build_system build_system |> assert_supported_mode `Python | BXcode -> Config.string_of_build_system build_system |> assert_supported_mode `Xcode | BBuck -> @@ -489,8 +477,6 @@ let mode_of_build_command build_cmd = Javac (Javac.Javac, prog, args) | BMvn -> Maven (prog, args) - | BPython -> - Python args | BXcode when Config.xcpretty -> XcodeXcpretty (prog, args) | BBuck when (not Config.flavors) && Config.reactive_mode -> diff --git a/infer/src/integration/Driver.mli b/infer/src/integration/Driver.mli index 9ac564514..e167c28bf 100644 --- a/infer/src/integration/Driver.mli +++ b/infer/src/integration/Driver.mli @@ -19,7 +19,6 @@ type mode = | ClangCompilationDB of [`Escaped of string | `Raw of string] list | Javac of Javac.compiler * string * string list | Maven of string * string list - | Python of string list | PythonCapture of Config.build_system * string list | XcodeXcpretty of string * string list [@@deriving compare] diff --git a/infer/src/python_stubs/pythonMain.ml b/infer/src/python_stubs/pythonMain.ml deleted file mode 100644 index b6ce06686..000000000 --- a/infer/src/python_stubs/pythonMain.ml +++ /dev/null @@ -1,9 +0,0 @@ -(* - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - *) -open! IStd - -let go _ = () diff --git a/infer/src/python_stubs/pythonMain.mli b/infer/src/python_stubs/pythonMain.mli deleted file mode 100644 index 6a1b09b4e..000000000 --- a/infer/src/python_stubs/pythonMain.mli +++ /dev/null @@ -1,10 +0,0 @@ -(* - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - *) - -open! IStd - -val go : string list -> unit