@@ -4171,8 +4171,9 @@ val unsafe_string : bool ref
41714171val opaque : bool ref
41724172
41734173
4174+ type mli_status = Mli_na | Mli_exists | Mli_non_exists
41744175val no_implicit_current_dir : bool ref
4175- val assume_no_mli : bool ref
4176+ val assume_no_mli : mli_status ref
41764177
41774178
41784179end = struct
@@ -4294,8 +4295,9 @@ let keep_locs = ref false (* -keep-locs *)
42944295let unsafe_string = ref true;; (* -safe-string / -unsafe-string *)
42954296
42964297
4298+ type mli_status = Mli_na | Mli_exists | Mli_non_exists
42974299let no_implicit_current_dir = ref false
4298- let assume_no_mli = ref false
4300+ let assume_no_mli = ref Mli_na
42994301
43004302
43014303end
@@ -56655,7 +56657,8 @@ let type_implementation_more sourcefile outputprefix modulename initial_env ast
5665556657 let sourceintf =
5665656658 Misc.chop_extension_if_any sourcefile ^ !Config.interface_suffix in
5665756659
56658- if not !Clflags.assume_no_mli && Sys.file_exists sourceintf then begin
56660+ let mli_status = !Clflags.assume_no_mli in
56661+ if (mli_status = Clflags.Mli_na && Sys.file_exists sourceintf) || (mli_status = Clflags.Mli_exists) then begin
5665956662
5666056663 let intf_file =
5666156664 try
@@ -56754,7 +56757,8 @@ let package_units initial_env objfiles cmifile modulename =
5675456757 let prefix = chop_extension_if_any cmifile in
5675556758 let mlifile = prefix ^ !Config.interface_suffix in
5675656759
56757- if not !Clflags.assume_no_mli && Sys.file_exists mlifile then begin
56760+ let mli_status = !Clflags.assume_no_mli in
56761+ if (mli_status = Clflags.Mli_na && Sys.file_exists mlifile) || (mli_status = Clflags.Mli_exists) then begin
5675856762
5675956763 if not (Sys.file_exists cmifile) then begin
5676056764 raise(Error(Location.in_file mlifile, Env.empty,
@@ -105089,9 +105093,12 @@ let define_variable s =
105089105093let buckle_script_flags =
105090105094 ("-bs-no-implicit-include", Arg.Set Clflags.no_implicit_current_dir
105091105095 , " Don't include current dir implicitly")
105096+ ::
105097+ ("-bs-assume-has-mli", Arg.Unit (fun _ -> Clflags.assume_no_mli := Clflags.Mli_exists),
105098+ " (internal) Assume mli always exist ")
105092105099 ::
105093- ("-bs-assume-no-mli", Arg.Set Clflags.assume_no_mli,
105094- " Don't lookup whether mli exist or not")
105100+ ("-bs-assume-no-mli", Arg.Unit (fun _ -> Clflags.assume_no_mli := Clflags.Mli_non_exists) ,
105101+ " (internal) Don't lookup whether mli exist or not")
105095105102 ::
105096105103 ("-bs-D", Arg.String define_variable,
105097105104 " Define conditional variable e.g, -D DEBUG=true"
0 commit comments