@@ -6378,33 +6378,33 @@ let (//) = Ext_path.combine
6378
6378
let ninja_clean bsc_dir proj_dir =
6379
6379
try
6380
6380
let cmd = bsc_dir // "ninja.exe" in
6381
- let cwd = proj_dir // Bsb_config.lib_bs in
6381
+ let cwd = proj_dir // Bsb_config.lib_bs in
6382
6382
if Sys.file_exists cwd then
6383
6383
let eid =
6384
- ( Bsb_unix.run_command_execv { cmd ; args = [|cmd; "-t"; "clean"|] ; cwd }) in
6384
+ Bsb_unix.run_command_execv {cmd ; args = [|cmd; "-t"; "clean"|] ; cwd} in
6385
6385
if eid <> 0 then
6386
6386
Bsb_log.warn "@{<warning>ninja clean failed@}@."
6387
6387
with e ->
6388
6388
Bsb_log.warn "@{<warning>ninja clean failed@} : %s @." (Printexc.to_string e)
6389
6389
6390
6390
let clean_bs_garbage bsc_dir proj_dir =
6391
6391
Bsb_log.info "@{<info>Cleaning:@} in %s@." proj_dir ;
6392
- let aux x =
6393
- let x = ( proj_dir // x) in
6392
+ let try_remove x =
6393
+ let x = proj_dir // x in
6394
6394
if Sys.file_exists x then
6395
6395
Bsb_unix.remove_dir_recursive x in
6396
6396
try
6397
6397
ninja_clean bsc_dir proj_dir ;
6398
- List.iter aux Bsb_config.all_lib_artifacts;
6398
+ List.iter try_remove Bsb_config.all_lib_artifacts;
6399
6399
with
6400
6400
e ->
6401
6401
Bsb_log.warn "@{<warning>Failed@} to clean due to %s" (Printexc.to_string e)
6402
6402
6403
6403
6404
6404
let clean_bs_deps bsc_dir proj_dir =
6405
- Bsb_build_util.walk_all_deps proj_dir (fun { cwd} ->
6405
+ Bsb_build_util.walk_all_deps proj_dir (fun pkg_cxt ->
6406
6406
(* whether top or not always do the cleaning *)
6407
- clean_bs_garbage bsc_dir cwd
6407
+ clean_bs_garbage bsc_dir pkg_cxt. cwd
6408
6408
)
6409
6409
6410
6410
let clean_self bsc_dir proj_dir = clean_bs_garbage bsc_dir proj_dir
@@ -9993,8 +9993,7 @@ let extract_generators
9993
9993
begin match String_map.find_opt Bsb_build_schemas.generators input with
9994
9994
| Some (Arr { content ; loc_start}) ->
9995
9995
(* Need check is dev build or not *)
9996
- for i = 0 to Array.length content - 1 do
9997
- let x = Array.unsafe_get content i in
9996
+ Array.iter begin fun (x : Ext_json_types.t) ->
9998
9997
match x with
9999
9998
| Obj { map = generator; loc} ->
10000
9999
begin match String_map.find_opt Bsb_build_schemas.name generator,
@@ -10021,7 +10020,7 @@ let extract_generators
10021
10020
Bsb_exception.errorf ~loc "Invalid generator format"
10022
10021
end
10023
10022
| _ -> Bsb_exception.errorf ~loc:(Ext_json.loc_of x) "Invalid generator format"
10024
- done ;
10023
+ end content
10025
10024
| Some x -> Bsb_exception.errorf ~loc:(Ext_json.loc_of x ) "Invalid generator format"
10026
10025
| None -> ()
10027
10026
end ;
0 commit comments