Skip to content

Commit a724fcb

Browse files
committed
flatten the dev groups -- treat all dev groups in the same group
1 parent fef665e commit a724fcb

File tree

3 files changed

+48
-48
lines changed

3 files changed

+48
-48
lines changed

jscomp/bsb/bsb_ninja_gen.ml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ let output_ninja_and_namespace_map
177177
Bsb_db_util.sanity_check bs_group;
178178
[|bs_group|], source_dirs, static_resources
179179
else
180-
let bs_groups = Array.init (number_of_dev_groups + 1 ) (fun _ -> Map_string.empty) in
181-
let source_dirs = Array.init (number_of_dev_groups + 1 ) (fun _ -> []) in
180+
(* number_of_dev_groups = 1 -- all devs share the same group *)
181+
let bs_groups = Array.init 2 (fun _ -> Map_string.empty) in
182+
let source_dirs = Array.init 2 (fun _ -> []) in
182183
let static_resources =
183184
Ext_list.fold_left bs_file_groups [] (fun (acc_resources : string list) {sources; dir; resources; dir_index}
184185
->
@@ -187,21 +188,20 @@ let output_ninja_and_namespace_map
187188
source_dirs.(dir_index) <- dir :: source_dirs.(dir_index);
188189
Ext_list.map_append resources acc_resources (fun x -> dir//x)
189190
) in
190-
let lib = bs_groups.((Bsb_dir_index.lib_dir_index :> int)) in
191+
let lib = bs_groups.(0) in
191192
Bsb_db_util.sanity_check lib;
192-
for i = 1 to number_of_dev_groups do
193-
let c = bs_groups.(i) in
194-
Bsb_db_util.sanity_check c;
195-
Map_string.iter c
196-
(fun k a ->
197-
if Map_string.mem lib k then
198-
Bsb_db_util.conflict_module_info k a (Map_string.find_exn lib k)
199-
) ;
200-
Bsb_ninja_targets.output_kv
201-
(Bsb_dir_index.(string_of_bsb_dev_include (of_int i)))
202-
(Bsb_build_util.include_dirs source_dirs.(i)) oc
203-
done ;
204-
bs_groups,source_dirs.((Bsb_dir_index.lib_dir_index:>int)), static_resources
193+
let c = bs_groups.(1) in
194+
Bsb_db_util.sanity_check c;
195+
Map_string.iter c
196+
(fun k a ->
197+
if Map_string.mem lib k then
198+
Bsb_db_util.conflict_module_info k a (Map_string.find_exn lib k)
199+
) ;
200+
Bsb_ninja_targets.output_kv
201+
(Bsb_dir_index.(string_of_bsb_dev_include (of_int 1)))
202+
(Bsb_build_util.include_dirs source_dirs.(1)) oc
203+
;
204+
bs_groups,source_dirs.(0), static_resources
205205
in
206206

207207
let digest = Bsb_db_encode.write_build_cache ~dir:cwd_lib_bs bs_groups in

lib/4.06.1/bsb.ml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13814,8 +13814,9 @@ let output_ninja_and_namespace_map
1381413814
Bsb_db_util.sanity_check bs_group;
1381513815
[|bs_group|], source_dirs, static_resources
1381613816
else
13817-
let bs_groups = Array.init (number_of_dev_groups + 1 ) (fun _ -> Map_string.empty) in
13818-
let source_dirs = Array.init (number_of_dev_groups + 1 ) (fun _ -> []) in
13817+
(* number_of_dev_groups = 1 -- all devs share the same group *)
13818+
let bs_groups = Array.init 2 (fun _ -> Map_string.empty) in
13819+
let source_dirs = Array.init 2 (fun _ -> []) in
1381913820
let static_resources =
1382013821
Ext_list.fold_left bs_file_groups [] (fun (acc_resources : string list) {sources; dir; resources; dir_index}
1382113822
->
@@ -13824,21 +13825,20 @@ let output_ninja_and_namespace_map
1382413825
source_dirs.(dir_index) <- dir :: source_dirs.(dir_index);
1382513826
Ext_list.map_append resources acc_resources (fun x -> dir//x)
1382613827
) in
13827-
let lib = bs_groups.((Bsb_dir_index.lib_dir_index :> int)) in
13828+
let lib = bs_groups.(0) in
1382813829
Bsb_db_util.sanity_check lib;
13829-
for i = 1 to number_of_dev_groups do
13830-
let c = bs_groups.(i) in
13831-
Bsb_db_util.sanity_check c;
13832-
Map_string.iter c
13833-
(fun k a ->
13834-
if Map_string.mem lib k then
13835-
Bsb_db_util.conflict_module_info k a (Map_string.find_exn lib k)
13836-
) ;
13837-
Bsb_ninja_targets.output_kv
13838-
(Bsb_dir_index.(string_of_bsb_dev_include (of_int i)))
13839-
(Bsb_build_util.include_dirs source_dirs.(i)) oc
13840-
done ;
13841-
bs_groups,source_dirs.((Bsb_dir_index.lib_dir_index:>int)), static_resources
13830+
let c = bs_groups.(1) in
13831+
Bsb_db_util.sanity_check c;
13832+
Map_string.iter c
13833+
(fun k a ->
13834+
if Map_string.mem lib k then
13835+
Bsb_db_util.conflict_module_info k a (Map_string.find_exn lib k)
13836+
) ;
13837+
Bsb_ninja_targets.output_kv
13838+
(Bsb_dir_index.(string_of_bsb_dev_include (of_int 1)))
13839+
(Bsb_build_util.include_dirs source_dirs.(1)) oc
13840+
;
13841+
bs_groups,source_dirs.(0), static_resources
1384213842
in
1384313843

1384413844
let digest = Bsb_db_encode.write_build_cache ~dir:cwd_lib_bs bs_groups in

lib/4.06.1/unstable/bsb_native.ml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13963,8 +13963,9 @@ let output_ninja_and_namespace_map
1396313963
Bsb_db_util.sanity_check bs_group;
1396413964
[|bs_group|], source_dirs, static_resources
1396513965
else
13966-
let bs_groups = Array.init (number_of_dev_groups + 1 ) (fun _ -> Map_string.empty) in
13967-
let source_dirs = Array.init (number_of_dev_groups + 1 ) (fun _ -> []) in
13966+
(* number_of_dev_groups = 1 -- all devs share the same group *)
13967+
let bs_groups = Array.init 2 (fun _ -> Map_string.empty) in
13968+
let source_dirs = Array.init 2 (fun _ -> []) in
1396813969
let static_resources =
1396913970
Ext_list.fold_left bs_file_groups [] (fun (acc_resources : string list) {sources; dir; resources; dir_index}
1397013971
->
@@ -13973,21 +13974,20 @@ let output_ninja_and_namespace_map
1397313974
source_dirs.(dir_index) <- dir :: source_dirs.(dir_index);
1397413975
Ext_list.map_append resources acc_resources (fun x -> dir//x)
1397513976
) in
13976-
let lib = bs_groups.((Bsb_dir_index.lib_dir_index :> int)) in
13977+
let lib = bs_groups.(0) in
1397713978
Bsb_db_util.sanity_check lib;
13978-
for i = 1 to number_of_dev_groups do
13979-
let c = bs_groups.(i) in
13980-
Bsb_db_util.sanity_check c;
13981-
Map_string.iter c
13982-
(fun k a ->
13983-
if Map_string.mem lib k then
13984-
Bsb_db_util.conflict_module_info k a (Map_string.find_exn lib k)
13985-
) ;
13986-
Bsb_ninja_targets.output_kv
13987-
(Bsb_dir_index.(string_of_bsb_dev_include (of_int i)))
13988-
(Bsb_build_util.include_dirs source_dirs.(i)) oc
13989-
done ;
13990-
bs_groups,source_dirs.((Bsb_dir_index.lib_dir_index:>int)), static_resources
13979+
let c = bs_groups.(1) in
13980+
Bsb_db_util.sanity_check c;
13981+
Map_string.iter c
13982+
(fun k a ->
13983+
if Map_string.mem lib k then
13984+
Bsb_db_util.conflict_module_info k a (Map_string.find_exn lib k)
13985+
) ;
13986+
Bsb_ninja_targets.output_kv
13987+
(Bsb_dir_index.(string_of_bsb_dev_include (of_int 1)))
13988+
(Bsb_build_util.include_dirs source_dirs.(1)) oc
13989+
;
13990+
bs_groups,source_dirs.(0), static_resources
1399113991
in
1399213992

1399313993
let digest = Bsb_db_encode.write_build_cache ~dir:cwd_lib_bs bs_groups in

0 commit comments

Comments
 (0)