@@ -94,7 +94,7 @@ type builtin = {
9494 copy_resources : t ;
9595 (* * Rules below all need restat *)
9696 build_bin_deps : t ;
97-
97+ build_bin_deps_dev : t ;
9898 ml_cmj_js : t ;
9999 ml_cmj_js_dev : t ;
100100 ml_cmj_cmi_js : t ;
@@ -123,55 +123,53 @@ let make_custom_rules
123123 builtin =
124124 (* * FIXME: We don't need set [-o ${out}] when building ast
125125 since the default is already good -- it does not*)
126- let buf = Buffer . create 100 in
126+ let buf = Ext_buffer . create 100 in
127127 let mk_ml_cmj_cmd
128128 ~read_cmi
129129 ~is_dev
130130 ~postbuild : string =
131- Buffer . clear buf;
132- Buffer . add_string buf " $bsc $g_pkg_flg -color always" ;
131+ Ext_buffer . clear buf;
132+ Ext_buffer . add_string buf " $bsc $g_pkg_flg -color always" ;
133133 if bs_suffix then
134- Buffer . add_string buf " -bs-suffix" ;
134+ Ext_buffer . add_string buf " -bs-suffix" ;
135135 if read_cmi then
136- Buffer . add_string buf " -bs-read-cmi" ;
136+ Ext_buffer . add_string buf " -bs-read-cmi" ;
137137 if is_dev then
138- Buffer. add_string buf " $ g_dev_incls" ;
139- Buffer. add_string buf " $ g_lib_incls" ;
138+ Ext_buffer. add_ninja_prefix_var buf Bsb_ninja_global_vars. g_dev_incls;
139+ Ext_buffer. add_ninja_prefix_var buf Bsb_build_schemas. g_lib_incls;
140140 if is_dev then
141- Buffer. add_string buf " $ g_dpkg_incls" ;
141+ Ext_buffer. add_ninja_prefix_var buf Bsb_ninja_global_vars. g_dpkg_incls;
142142 if not has_builtin then
143- Buffer . add_string buf " -nostdlib" ;
144- Buffer . add_string buf " $warnings $bsc_flags" ;
143+ Ext_buffer . add_string buf " -nostdlib" ;
144+ Ext_buffer . add_string buf " $warnings $bsc_flags" ;
145145 if has_gentype then
146- Buffer. add_string buf " $ gentypeconfig" ;
147- Buffer . add_string buf " -o $out $in" ;
146+ Ext_buffer. add_ninja_prefix_var buf Bsb_ninja_global_vars. gentypeconfig;
147+ Ext_buffer . add_string buf " -o $out $in" ;
148148 if postbuild then
149- Buffer . add_string buf " $postbuild" ;
150- Buffer . contents buf
149+ Ext_buffer . add_string buf " $postbuild" ;
150+ Ext_buffer . contents buf
151151 in
152152 let mk_ast ~(has_pp : bool ) ~has_ppx ~has_reason_react_jsx : string =
153- Buffer . clear buf ;
154- Buffer . add_string buf " $bsc $warnings -color always" ;
153+ Ext_buffer . clear buf ;
154+ Ext_buffer . add_string buf " $bsc $warnings -color always" ;
155155 (match refmt with
156156 | None -> ()
157157 | Some x ->
158- Buffer . add_string buf " -bs-refmt " ;
159- Buffer . add_string buf (Ext_filename. maybe_quote x);
158+ Ext_buffer . add_string buf " -bs-refmt " ;
159+ Ext_buffer . add_string buf (Ext_filename. maybe_quote x);
160160 );
161161 if has_pp then
162- Buffer. add_string buf " $ pp_flags" ;
162+ Ext_buffer. add_ninja_prefix_var buf Bsb_ninja_global_vars. pp_flags;
163163 (match has_reason_react_jsx, reason_react_jsx with
164164 | false , _
165165 | _ , None -> ()
166- | _, Some Jsx_v2
167- -> Buffer. add_string buf " -bs-jsx 2"
168166 | _, Some Jsx_v3
169- -> Buffer . add_string buf " -bs-jsx 3"
167+ -> Ext_buffer . add_string buf " -bs-jsx 3"
170168 );
171169 if has_ppx then
172- Buffer. add_string buf " $ ppx_flags" ;
173- Buffer . add_string buf " $bsc_flags -o $out -bs-syntax-only -bs-binary-ast $in" ;
174- Buffer . contents buf
170+ Ext_buffer. add_ninja_prefix_var buf Bsb_ninja_global_vars. ppx_flags;
171+ Ext_buffer . add_string buf " $bsc_flags -o $out -bs-syntax-only -bs-binary-ast $in" ;
172+ Ext_buffer . contents buf
175173 in
176174 let build_ast =
177175 define
@@ -194,8 +192,14 @@ let make_custom_rules
194192 define
195193 ~restat: ()
196194 ~command:
197- (" $bsdep -hash " ^ digest ^ " $g_ns $bsb_dir_group $in" )
198- " build_deps" in
195+ (" $bsdep -hash " ^ digest ^ " $g_ns $in" )
196+ " mk_deps" in
197+ let build_bin_deps_dev =
198+ define
199+ ~restat: ()
200+ ~command:
201+ (" $bsdep -g -hash " ^ digest ^ " $g_ns $in" )
202+ " mk_deps_dev" in
199203 let aux ~name ~read_cmi ~postbuild =
200204 let postbuild = has_postbuild && postbuild in
201205 define
@@ -239,7 +243,7 @@ let make_custom_rules
239243 copy_resources;
240244 (* * Rules below all need restat *)
241245 build_bin_deps ;
242-
246+ build_bin_deps_dev;
243247 ml_cmj_js ;
244248 ml_cmj_js_dev ;
245249 ml_cmj_cmi_js ;
0 commit comments