@@ -6368,11 +6368,11 @@ let handle_list_files dir (s : Ext_json.t array) loc_start loc_end : Ext_file_p
63686368 let dyn_file_array = String_vec. make (Array. length files_array) in
63696369 let files =
63706370 Array. fold_left (fun acc name ->
6371- let new_acc = Binary_cache. map_update ~dir acc name in
6372- if new_acc != acc then (* reference in-equality *)
6373- String_vec. push name dyn_file_array ;
6374- new_acc
6375-
6371+ if Ext_string. is_valid_source_name name then begin
6372+ let new_acc = Binary_cache. map_update ~dir acc name in
6373+ String_vec. push name dyn_file_array ;
6374+ new_acc
6375+ end else acc
63766376 ) String_map. empty files_array in
63776377 [{Ext_file_pp. loc_start ;
63786378 loc_end; action = (`print (print_arrays dyn_file_array))}],
@@ -6499,7 +6499,7 @@ let rec parsing_source (dir_index : int) cwd (x : Ext_json.t String_map.t )
64996499 let res =
65006500 Array. fold_left (fun origin json ->
65016501 match json with
6502- | `Obj m ->
6502+ | `Obj m -> (* could also be a string *)
65036503 parsing_source current_dir_index ! dir m ++ origin
65046504 | _ -> origin ) empty s in
65056505 children := res.files ;
@@ -7579,7 +7579,8 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
75797579 ~output: output_mlastd
75807580 ~input: output_mlast
75817581 ~rule: Rules. build_bin_deps
7582- ?shadows:(if group.dir_index = 0 then None else Some [" group" , `Overwrite (string_of_int group.dir_index)])
7582+ ?shadows:(if group.dir_index = 0 then None
7583+ else Some [Bsb_build_schemas. bsb_dir_group, `Overwrite (string_of_int group.dir_index)])
75837584 ;
75847585 let rule_name , cm_outputs , deps =
75857586 if module_info.mli = Mli_empty then
@@ -8510,27 +8511,37 @@ let () =
85108511 end
85118512 else
85128513 begin
8513- match Ext_array. find_and_split Sys. argv Ext_string. equal " -- " with
8514+ match Ext_array. find_and_split Sys. argv Ext_string. equal separator with
85148515 | `No_split
85158516 ->
85168517 begin
85178518 Arg. parse bsb_main_flags annoymous usage;
85188519 (* [-make-world] should never be combined with [-package-specs] *)
8519- if ! make_world then begin
8520- (* don't regenerate files when we only run [bsb -clean-world] *)
8521- let deps = regenerate_ninja cwd bsc_dir ! force_regenerate in
8522- make_world_deps deps
8520+ begin match ! make_world, ! force_regenerate with
8521+ | false , false -> ()
8522+ | make_world , force_regenerate ->
8523+ (* don't regenerate files when we only run [bsb -clean-world] *)
8524+ let deps = regenerate_ninja cwd bsc_dir force_regenerate in
8525+ if make_world then begin
8526+ make_world_deps deps
8527+ end ;
85238528 end ;
85248529 if ! watch_mode then begin
85258530 watch ()
8526- (* ninja is not triggered in this case *)
8531+ (* ninja is not triggered in this case
8532+ There are several cases we wish ninja will not be triggered.
8533+ [bsb -clean-world]
8534+ [bsb -regen ]
8535+ *)
8536+ end else if ! make_world then begin
8537+ ninja_command ninja [||]
85278538 end
85288539 end
85298540 | `Split (bsb_args,ninja_args)
8530- ->
8541+ -> (* -make-world all dependencies fall into this category *)
85318542 begin
85328543 Arg. parse_argv bsb_args bsb_main_flags annoymous usage ;
8533- let deps = ( regenerate_ninja cwd bsc_dir ! force_regenerate) in
8544+ let deps = regenerate_ninja cwd bsc_dir ! force_regenerate in
85348545 (* [-make-world] should never be combined with [-package-specs] *)
85358546 if ! make_world then
85368547 make_world_deps deps ;
0 commit comments