diff --git a/CHANGELOG.md b/CHANGELOG.md index 751a837ea3..21dc19ecfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Remove unused `-bs-D` and `-bs-list-conditionals` flags. https://github.com/rescript-lang/rescript/pull/7631 - Remove obsolete jsx options. https://github.com/rescript-lang/rescript/pull/7633 - Remove obsolete option `-bs-unsafe-empty-array`. https://github.com/rescript-lang/rescript/pull/7635 +- Clean up `config.ml`. https://github.com/rescript-lang/rescript/pull/7636 # 12.0.0-beta.1 diff --git a/analysis/src/Shared.ml b/analysis/src/Shared.ml index 058ede6163..ffd74f9888 100644 --- a/analysis/src/Shared.ml +++ b/analysis/src/Shared.ml @@ -5,18 +5,14 @@ let tryReadCmt cmt = else match Cmt_format.read_cmt cmt with | exception Cmi_format.Error err -> - Log.log - ("Failed to load " ^ cmt ^ " as a cmt w/ ocaml version " ^ "406" - ^ ", error: " - ^ - (Cmi_format.report_error Format.str_formatter err; - Format.flush_str_formatter ())); + let error_message = + Cmi_format.report_error Format.str_formatter err; + Format.flush_str_formatter () + in + Log.log ("Invalid cmt format " ^ cmt ^ ": " ^ error_message); None | exception err -> - Log.log - ("Invalid cmt format " ^ cmt - ^ " - probably wrong ocaml version, expected " ^ Config.version ^ " : " - ^ Printexc.to_string err); + Log.log ("Invalid cmt format " ^ cmt ^ ": " ^ Printexc.to_string err); None | x -> Some x diff --git a/compiler/ext/config.ml b/compiler/ext/config.ml index 7e14bd9d9c..c6e1619d4f 100644 --- a/compiler/ext/config.ml +++ b/compiler/ext/config.ml @@ -1,5 +1,3 @@ -let version = "4.06.1+BS" - (* This resolves the location of the standard library starting from the location of bsc.exe, handling different supported package layouts. *) let standard_library = @@ -31,8 +29,6 @@ let standard_library = | _ :: _ :: _ :: _ :: rest -> build_path rest ["lib"; "ocaml"] | _ -> "" -let standard_library_default = standard_library - let cmi_magic_number = "Caml1999I022" and ast_impl_magic_number = "Caml1999M022" @@ -42,20 +38,3 @@ and ast_intf_magic_number = "Caml1999N022" and cmt_magic_number = "Caml1999T022" let load_path = ref ([] : string list) - -(* This is normally the same as in obj.ml, but we have to define it - separately because it can differ when we're in the middle of a - bootstrapping phase. *) - -let print_config oc = - let p name valu = Printf.fprintf oc "%s: %s\n" name valu in - p "version" version; - p "standard_library_default" standard_library_default; - p "standard_library" standard_library; - - (* print the magic number *) - p "cmi_magic_number" cmi_magic_number; - p "ast_impl_magic_number" ast_impl_magic_number; - p "ast_intf_magic_number" ast_intf_magic_number; - p "cmt_magic_number" cmt_magic_number; - flush oc diff --git a/compiler/ext/config.mli b/compiler/ext/config.mli index 63d200f81d..4cc5d8a996 100644 --- a/compiler/ext/config.mli +++ b/compiler/ext/config.mli @@ -15,9 +15,6 @@ (* System configuration *) -val version : string -(* The current version number of the system *) - val standard_library : string (* The directory containing the standard libraries *) @@ -35,5 +32,3 @@ val ast_impl_magic_number : string (* Magic number for file holding an implementation syntax tree *) val cmt_magic_number : string (* Magic number for compiled interface files *) - -val print_config : out_channel -> unit