Skip to content

Commit bc0f356

Browse files
authored
Clean up config.ml (#7636)
* Clean up config.ml * CHANGELOG
1 parent fecb194 commit bc0f356

File tree

4 files changed

+7
-36
lines changed

4 files changed

+7
-36
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Remove unused `-bs-D` and `-bs-list-conditionals` flags. https://github.com/rescript-lang/rescript/pull/7631
1919
- Remove obsolete jsx options. https://github.com/rescript-lang/rescript/pull/7633
2020
- Remove obsolete option `-bs-unsafe-empty-array`. https://github.com/rescript-lang/rescript/pull/7635
21+
- Clean up `config.ml`. https://github.com/rescript-lang/rescript/pull/7636
2122

2223
# 12.0.0-beta.1
2324

analysis/src/Shared.ml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@ let tryReadCmt cmt =
55
else
66
match Cmt_format.read_cmt cmt with
77
| exception Cmi_format.Error err ->
8-
Log.log
9-
("Failed to load " ^ cmt ^ " as a cmt w/ ocaml version " ^ "406"
10-
^ ", error: "
11-
^
12-
(Cmi_format.report_error Format.str_formatter err;
13-
Format.flush_str_formatter ()));
8+
let error_message =
9+
Cmi_format.report_error Format.str_formatter err;
10+
Format.flush_str_formatter ()
11+
in
12+
Log.log ("Invalid cmt format " ^ cmt ^ ": " ^ error_message);
1413
None
1514
| exception err ->
16-
Log.log
17-
("Invalid cmt format " ^ cmt
18-
^ " - probably wrong ocaml version, expected " ^ Config.version ^ " : "
19-
^ Printexc.to_string err);
15+
Log.log ("Invalid cmt format " ^ cmt ^ ": " ^ Printexc.to_string err);
2016
None
2117
| x -> Some x
2218

compiler/ext/config.ml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
let version = "4.06.1+BS"
2-
31
(* This resolves the location of the standard library starting from the location of bsc.exe,
42
handling different supported package layouts. *)
53
let standard_library =
@@ -31,8 +29,6 @@ let standard_library =
3129
| _ :: _ :: _ :: _ :: rest -> build_path rest ["lib"; "ocaml"]
3230
| _ -> ""
3331

34-
let standard_library_default = standard_library
35-
3632
let cmi_magic_number = "Caml1999I022"
3733

3834
and ast_impl_magic_number = "Caml1999M022"
@@ -42,20 +38,3 @@ and ast_intf_magic_number = "Caml1999N022"
4238
and cmt_magic_number = "Caml1999T022"
4339

4440
let load_path = ref ([] : string list)
45-
46-
(* This is normally the same as in obj.ml, but we have to define it
47-
separately because it can differ when we're in the middle of a
48-
bootstrapping phase. *)
49-
50-
let print_config oc =
51-
let p name valu = Printf.fprintf oc "%s: %s\n" name valu in
52-
p "version" version;
53-
p "standard_library_default" standard_library_default;
54-
p "standard_library" standard_library;
55-
56-
(* print the magic number *)
57-
p "cmi_magic_number" cmi_magic_number;
58-
p "ast_impl_magic_number" ast_impl_magic_number;
59-
p "ast_intf_magic_number" ast_intf_magic_number;
60-
p "cmt_magic_number" cmt_magic_number;
61-
flush oc

compiler/ext/config.mli

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515

1616
(* System configuration *)
1717

18-
val version : string
19-
(* The current version number of the system *)
20-
2118
val standard_library : string
2219
(* The directory containing the standard libraries *)
2320

@@ -35,5 +32,3 @@ val ast_impl_magic_number : string
3532
(* Magic number for file holding an implementation syntax tree *)
3633
val cmt_magic_number : string
3734
(* Magic number for compiled interface files *)
38-
39-
val print_config : out_channel -> unit

0 commit comments

Comments
 (0)