Skip to content

Commit d946fcf

Browse files
committed
snapshot
1 parent be61180 commit d946fcf

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/4.06.1/bsb_helper.ml

+10-3
Original file line numberDiff line numberDiff line change
@@ -2274,6 +2274,11 @@ let oc_cmi buf namespace source =
22742274
22752275
When ns is turned on, `B` is interprted as `Ns-B` which is a cyclic dependency,
22762276
it can be errored out earlier
2277+
2278+
#5368: It turns out there are many false positives on detecting self-cycles (see: `jscomp/build_tests/zerocycle`)
2279+
To properly solve this, we would need to `jscomp/ml/depend.ml` because
2280+
cmi and cmj is broken in the first place (same problem as in ocaml/ocaml#4618).
2281+
So we will just ignore the self-cycles. Even if there is indeed a self-cycle, it should fail to compile anyway.
22772282
*)
22782283
let oc_deps (ast_file : string) (is_dev : bool) (db : Bsb_db_decode.t)
22792284
(namespace : string option) (buf : Ext_buffer.t) (kind : [ `impl | `intf ])
@@ -2302,9 +2307,11 @@ let oc_deps (ast_file : string) (is_dev : bool) (db : Bsb_db_decode.t)
23022307
while !offset < size do
23032308
let next_tab = String.index_from s !offset magic_sep_char in
23042309
let dependent_module = String.sub s !offset (next_tab - !offset) in
2305-
if dependent_module = cur_module_name then (
2306-
prerr_endline ("FAILED: " ^ cur_module_name ^ " has a self cycle");
2307-
exit 2);
2310+
if dependent_module = cur_module_name then
2311+
(*prerr_endline ("FAILED: " ^ cur_module_name ^ " has a self cycle");
2312+
exit 2*)
2313+
(* #5368 ignore self dependencies *) ()
2314+
else
23082315
(match Bsb_db_decode.find db dependent_module is_dev with
23092316
| None -> ()
23102317
| Some { dir_name; case } ->

0 commit comments

Comments
 (0)