Skip to content

Commit e945ea0

Browse files
authored
Merge pull request #4432 from BuckleScript/build_dev
fix #4406
2 parents 69c3185 + f688276 commit e945ea0

File tree

4 files changed

+39
-18
lines changed

4 files changed

+39
-18
lines changed

jscomp/bsb/bsb_ninja_rule.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ let make_custom_rules
129129
~is_dev
130130
~postbuild : string =
131131
Ext_buffer.clear buf;
132-
Ext_buffer.add_string buf "$bsc $g_pkg_flg -color always";
132+
Ext_buffer.add_string buf "$bsc -color always";
133+
Ext_buffer.add_ninja_prefix_var buf Bsb_ninja_global_vars.g_pkg_flg;
133134
if bs_suffix then
134135
Ext_buffer.add_string buf " -bs-suffix";
135136
if read_cmi then

jscomp/bsb/bsb_warning.ml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,17 @@ let prepare_warning_concat ~(beg : bool) s =
5454
let to_merlin_string x =
5555
"-w " ^ Bsc_warnings.defaults_w
5656
^
57-
(match x with
58-
| Some {number =None}
59-
| None -> Ext_string.empty
60-
| Some {number = Some x} ->
61-
prepare_warning_concat ~beg:false x )
57+
(let customize = (match x with
58+
| Some {number =None}
59+
| None -> Ext_string.empty
60+
| Some {number = Some x} ->
61+
prepare_warning_concat ~beg:false x
62+
) in
63+
if customize = "" then customize
64+
else customize ^ "-40-42-61")
65+
(* see #4406 to avoid user pass A
66+
Sync up with {!Warnings.report}
67+
*)
6268

6369

6470

lib/4.06.1/bsb.ml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7114,11 +7114,17 @@ let prepare_warning_concat ~(beg : bool) s =
71147114
let to_merlin_string x =
71157115
"-w " ^ Bsc_warnings.defaults_w
71167116
^
7117-
(match x with
7118-
| Some {number =None}
7119-
| None -> Ext_string.empty
7120-
| Some {number = Some x} ->
7121-
prepare_warning_concat ~beg:false x )
7117+
(let customize = (match x with
7118+
| Some {number =None}
7119+
| None -> Ext_string.empty
7120+
| Some {number = Some x} ->
7121+
prepare_warning_concat ~beg:false x
7122+
) in
7123+
if customize = "" then customize
7124+
else customize ^ "-40-42-61")
7125+
(* see #4406 to avoid user pass A
7126+
Sync up with {!Warnings.report}
7127+
*)
71227128

71237129

71247130

@@ -12812,7 +12818,8 @@ let make_custom_rules
1281212818
~is_dev
1281312819
~postbuild : string =
1281412820
Ext_buffer.clear buf;
12815-
Ext_buffer.add_string buf "$bsc $g_pkg_flg -color always";
12821+
Ext_buffer.add_string buf "$bsc -color always";
12822+
Ext_buffer.add_ninja_prefix_var buf Bsb_ninja_global_vars.g_pkg_flg;
1281612823
if bs_suffix then
1281712824
Ext_buffer.add_string buf " -bs-suffix";
1281812825
if read_cmi then

lib/4.06.1/unstable/bsb_native.ml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7120,11 +7120,17 @@ let prepare_warning_concat ~(beg : bool) s =
71207120
let to_merlin_string x =
71217121
"-w " ^ Bsc_warnings.defaults_w
71227122
^
7123-
(match x with
7124-
| Some {number =None}
7125-
| None -> Ext_string.empty
7126-
| Some {number = Some x} ->
7127-
prepare_warning_concat ~beg:false x )
7123+
(let customize = (match x with
7124+
| Some {number =None}
7125+
| None -> Ext_string.empty
7126+
| Some {number = Some x} ->
7127+
prepare_warning_concat ~beg:false x
7128+
) in
7129+
if customize = "" then customize
7130+
else customize ^ "-40-42-61")
7131+
(* see #4406 to avoid user pass A
7132+
Sync up with {!Warnings.report}
7133+
*)
71287134

71297135

71307136

@@ -12961,7 +12967,8 @@ let make_custom_rules
1296112967
~is_dev
1296212968
~postbuild : string =
1296312969
Ext_buffer.clear buf;
12964-
Ext_buffer.add_string buf "$bsc $g_pkg_flg -color always";
12970+
Ext_buffer.add_string buf "$bsc -color always";
12971+
Ext_buffer.add_ninja_prefix_var buf Bsb_ninja_global_vars.g_pkg_flg;
1296512972
if bs_suffix then
1296612973
Ext_buffer.add_string buf " -bs-suffix";
1296712974
if read_cmi then

0 commit comments

Comments
 (0)