Skip to content

Commit 58f4cd1

Browse files
authored
Merge pull request #4865 from rescript-lang/fix_4864
fix #4864
2 parents a9cb708 + 3ac685a commit 58f4cd1

6 files changed

+28
-28
lines changed

jscomp/bsb/bsb_file_groups.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type file_group =
4040
sources : Bsb_db.map;
4141
resources : string list ;
4242
public : public ;
43-
dev_index : bool ;
43+
is_dev : bool ;
4444
generators : build_generator list ;
4545
(* output of [generators] should be added to [sources],
4646
if it is [.ml,.mli,.re,.rei]

jscomp/bsb/bsb_file_groups.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type file_group =
4040
sources : Bsb_db.map;
4141
resources : string list ;
4242
public : public ;
43-
dev_index : bool ; (* false means not in dev mode *)
43+
is_dev : bool ; (* false means not in dev mode *)
4444
generators : build_generator list ;
4545
(* output of [generators] should be added to [sources],
4646
if it is [.ml,.mli,.re,.rei]

jscomp/bsb/bsb_ninja_file_groups.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ let handle_files_per_dir
146146
~(namespace : string option)
147147
(group: Bsb_file_groups.file_group )
148148
: unit =
149-
149+
let is_dev = group.is_dev in
150150
handle_generators oc group rules.customs ;
151151
let installable =
152152
match group.public with
@@ -156,12 +156,12 @@ let handle_files_per_dir
156156
fun module_name ->
157157
Set_string.mem set module_name in
158158
Map_string.iter group.sources (fun module_name module_info ->
159-
if installable module_name then
159+
if installable module_name && not is_dev then
160160
Queue.add
161161
module_info files_to_install;
162162
emit_module_build rules
163163
package_specs
164-
group.dev_index
164+
is_dev
165165
oc
166166
namespace module_info
167167
)

jscomp/bsb/bsb_ninja_gen.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ let output_ninja_and_namespace_map
207207
[] (
208208
fun
209209
(acc_resources : string list)
210-
{sources; dir; resources; dev_index}
210+
{sources; dir; resources; is_dev}
211211
->
212-
if dev_index then begin
212+
if is_dev then begin
213213
bs_groups.dev <- Bsb_db_util.merge bs_groups.dev sources ;
214214
source_dirs.dev <- dir :: source_dirs.dev;
215215
end else begin

jscomp/bsb/bsb_parse_sources.ml

+7-7
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let errorf x fmt =
4646

4747
type cxt = {
4848
package_kind : Bsb_package_kind.t ;
49-
dev_index : bool;
49+
is_dev : bool;
5050
cwd : string ;
5151
root : string;
5252
cut_generators : bool;
@@ -266,18 +266,18 @@ let rec
266266
sources = sources;
267267
resources ;
268268
public ;
269-
dev_index = cxt.dev_index ;
269+
is_dev = cxt.is_dev ;
270270
generators = if has_generators then scanned_generators else [] }
271271
?globbed_dir:(
272272
if !cur_globbed_dirs then Some dir else None)
273273
children
274274

275275

276-
and parsing_single_source ({package_kind; dev_index ; cwd} as cxt ) (x : Ext_json_types.t )
276+
and parsing_single_source ({package_kind; is_dev ; cwd} as cxt ) (x : Ext_json_types.t )
277277
: t =
278278
match x with
279279
| Str { str = dir } ->
280-
begin match package_kind, dev_index with
280+
begin match package_kind, is_dev with
281281
| Dependency _ , true ->
282282
Bsb_file_groups.empty
283283
| Dependency _, false
@@ -293,7 +293,7 @@ and parsing_single_source ({package_kind; dev_index ; cwd} as cxt ) (x : Ext_jso
293293
| Some (Str {str="dev"}) ->
294294
true
295295
| Some _ -> Bsb_exception.config_error x {|type field expect "dev" literal |}
296-
| None -> dev_index in
296+
| None -> is_dev in
297297
begin match package_kind, current_dir_index with
298298
| Dependency _ , true ->
299299
Bsb_file_groups.empty
@@ -311,7 +311,7 @@ and parsing_single_source ({package_kind; dev_index ; cwd} as cxt ) (x : Ext_jso
311311

312312
in
313313
parsing_source_dir_map
314-
{cxt with dev_index = current_dir_index;
314+
{cxt with is_dev = current_dir_index;
315315
cwd= Ext_path.concat cwd dir} map
316316
end
317317
| _ -> Bsb_file_groups.empty
@@ -337,7 +337,7 @@ let scan
337337
parse_sources {
338338
ignored_dirs;
339339
package_kind;
340-
dev_index = false;
340+
is_dev = false;
341341
cwd = Filename.current_dir_name;
342342
root ;
343343
cut_generators;

lib/4.06.1/bsb.ml

+14-14
Original file line numberDiff line numberDiff line change
@@ -4822,7 +4822,7 @@ type file_group =
48224822
sources : Bsb_db.map;
48234823
resources : string list ;
48244824
public : public ;
4825-
dev_index : bool ; (* false means not in dev mode *)
4825+
is_dev : bool ; (* false means not in dev mode *)
48264826
generators : build_generator list ;
48274827
(* output of [generators] should be added to [sources],
48284828
if it is [.ml,.mli,.re,.rei]
@@ -4899,7 +4899,7 @@ type file_group =
48994899
sources : Bsb_db.map;
49004900
resources : string list ;
49014901
public : public ;
4902-
dev_index : bool ;
4902+
is_dev : bool ;
49034903
generators : build_generator list ;
49044904
(* output of [generators] should be added to [sources],
49054905
if it is [.ml,.mli,.re,.rei]
@@ -10582,7 +10582,7 @@ let errorf x fmt =
1058210582

1058310583
type cxt = {
1058410584
package_kind : Bsb_package_kind.t ;
10585-
dev_index : bool;
10585+
is_dev : bool;
1058610586
cwd : string ;
1058710587
root : string;
1058810588
cut_generators : bool;
@@ -10802,18 +10802,18 @@ let rec
1080210802
sources = sources;
1080310803
resources ;
1080410804
public ;
10805-
dev_index = cxt.dev_index ;
10805+
is_dev = cxt.is_dev ;
1080610806
generators = if has_generators then scanned_generators else [] }
1080710807
?globbed_dir:(
1080810808
if !cur_globbed_dirs then Some dir else None)
1080910809
children
1081010810

1081110811

10812-
and parsing_single_source ({package_kind; dev_index ; cwd} as cxt ) (x : Ext_json_types.t )
10812+
and parsing_single_source ({package_kind; is_dev ; cwd} as cxt ) (x : Ext_json_types.t )
1081310813
: t =
1081410814
match x with
1081510815
| Str { str = dir } ->
10816-
begin match package_kind, dev_index with
10816+
begin match package_kind, is_dev with
1081710817
| Dependency _ , true ->
1081810818
Bsb_file_groups.empty
1081910819
| Dependency _, false
@@ -10829,7 +10829,7 @@ and parsing_single_source ({package_kind; dev_index ; cwd} as cxt ) (x : Ext_jso
1082910829
| Some (Str {str="dev"}) ->
1083010830
true
1083110831
| Some _ -> Bsb_exception.config_error x {|type field expect "dev" literal |}
10832-
| None -> dev_index in
10832+
| None -> is_dev in
1083310833
begin match package_kind, current_dir_index with
1083410834
| Dependency _ , true ->
1083510835
Bsb_file_groups.empty
@@ -10847,7 +10847,7 @@ and parsing_single_source ({package_kind; dev_index ; cwd} as cxt ) (x : Ext_jso
1084710847

1084810848
in
1084910849
parsing_source_dir_map
10850-
{cxt with dev_index = current_dir_index;
10850+
{cxt with is_dev = current_dir_index;
1085110851
cwd= Ext_path.concat cwd dir} map
1085210852
end
1085310853
| _ -> Bsb_file_groups.empty
@@ -10873,7 +10873,7 @@ let scan
1087310873
parse_sources {
1087410874
ignored_dirs;
1087510875
package_kind;
10876-
dev_index = false;
10876+
is_dev = false;
1087710877
cwd = Filename.current_dir_name;
1087810878
root ;
1087910879
cut_generators;
@@ -13454,7 +13454,7 @@ let handle_files_per_dir
1345413454
~(namespace : string option)
1345513455
(group: Bsb_file_groups.file_group )
1345613456
: unit =
13457-
13457+
let is_dev = group.is_dev in
1345813458
handle_generators oc group rules.customs ;
1345913459
let installable =
1346013460
match group.public with
@@ -13464,12 +13464,12 @@ let handle_files_per_dir
1346413464
fun module_name ->
1346513465
Set_string.mem set module_name in
1346613466
Map_string.iter group.sources (fun module_name module_info ->
13467-
if installable module_name then
13467+
if installable module_name && not is_dev then
1346813468
Queue.add
1346913469
module_info files_to_install;
1347013470
emit_module_build rules
1347113471
package_specs
13472-
group.dev_index
13472+
is_dev
1347313473
oc
1347413474
namespace module_info
1347513475
)
@@ -13726,9 +13726,9 @@ let output_ninja_and_namespace_map
1372613726
[] (
1372713727
fun
1372813728
(acc_resources : string list)
13729-
{sources; dir; resources; dev_index}
13729+
{sources; dir; resources; is_dev}
1373013730
->
13731-
if dev_index then begin
13731+
if is_dev then begin
1373213732
bs_groups.dev <- Bsb_db_util.merge bs_groups.dev sources ;
1373313733
source_dirs.dev <- dir :: source_dirs.dev;
1373413734
end else begin

0 commit comments

Comments
 (0)