Skip to content

Commit 432f750

Browse files
committed
Add a post-process pass to whole_compiler.ml/bsppx.ml
1 parent fb9e9b2 commit 432f750

File tree

5 files changed

+94
-62
lines changed

5 files changed

+94
-62
lines changed

jscomp/bsb/templates/tea/bsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@
1212
"suffix": ".bs.js",
1313
"bs-dependencies": [
1414
"bucklescript-tea"
15-
],
16-
"warnings": {
17-
"error" : "+101"
18-
}
15+
]
1916
}

jscomp/snapshot.ninja

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
releaseMode = -D BS_RELEASE_BUILD=true
22
rule bspack
3-
command = ./bin/bspack.exe $flags -bs-main $main -o $out
3+
command = ./bin/bspack.exe $flags -bs-main $main -o $out $post_process
44
depfile = $out.d
55
generator = true
66

7-
7+
LTO= ../scripts/buckle_lto.js
88
OCAML_SRC_UTILS=$native_ocaml_path/utils
99
OCAML_SRC_PARSING=$native_ocaml_path/parsing
1010
OCAML_SRC_TYPING=$native_ocaml_path/typing
@@ -19,12 +19,12 @@ build snapshot: phony $SNAP/whole_compiler.ml $SNAP/bsppx.ml $SNAP/bsdep.ml $SN
1919
build $SNAP/whole_compiler.ml: bspack | ./bin/bspack.exe
2020
flags = ${releaseMode} -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I $OCAML_SRC_TYPING -I $OCAML_SRC_BYTECOMP -I $OCAML_SRC_DRIVER ${includes}
2121
main = Js_main
22-
22+
post_process = && node $LTO $SNAP/whole_compiler.ml
2323

2424
build $SNAP/bsppx.ml: bspack | ./bin/bspack.exe
2525
flags = ${releaseMode} -bs-MD -module-alias Config=Config_whole_compiler -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I stubs -I common -I ext -I syntax -I core -I js_parser -I main
2626
main = Bsppx_main
27-
27+
post_process = && node $LTO $SNAP/bsppx.ml
2828

2929
build $SNAP/bsdep.ml: bspack | ./bin/bspack.exe
3030
flags = -D BS_OCAMLDEP=true ${releaseMode} -bs-MD -module-alias Config=Config_whole_compiler -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I $OCAML_SRC_DRIVER -I $OCAML_SRC_TOOLS -I common -I ext -I syntax -I depends -I core -I stubs -I main

lib/4.06.1/bsppx.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3791,7 +3791,7 @@ let defaults_w = "+a-4-6-7-9-27-29-32..42-44-45-48-50-60-102";;
37913791
let defaults_warn_error = "-a+31";;
37923792

37933793
let () =
3794-
if not !Config.bs_only then (
3794+
if not true then (
37953795
parse_options false defaults_w;
37963796
parse_options true defaults_warn_error;
37973797
)
@@ -303337,7 +303337,7 @@ let app_exp_mapper
303337303337
Ast_attributes.is_bs with
303338303338
| None -> default_expr_mapper self e
303339303339
| Some pexp_attributes ->
303340-
if !Config.bs_only then
303340+
if true then
303341303341
{e with pexp_desc = Ast_util.uncurry_fn_apply e.pexp_loc self fn (check_and_discard args) ;
303342303342
pexp_attributes }
303343303343
else {e with pexp_attributes } (* BS_NATIVE branch*)

0 commit comments

Comments
 (0)