File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -2274,6 +2274,11 @@ let oc_cmi buf namespace source =
2274
2274
2275
2275
When ns is turned on, `B` is interprted as `Ns-B` which is a cyclic dependency,
2276
2276
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.
2277
2282
*)
2278
2283
let oc_deps (ast_file : string ) (is_dev : bool ) (db : Bsb_db_decode.t )
2279
2284
(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)
2302
2307
while ! offset < size do
2303
2308
let next_tab = String. index_from s ! offset magic_sep_char in
2304
2309
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
2308
2315
(match Bsb_db_decode. find db dependent_module is_dev with
2309
2316
| None -> ()
2310
2317
| Some { dir_name; case } ->
You can’t perform that action at this time.
0 commit comments