Skip to content

Commit 4aae054

Browse files
authored
Merge pull request #4179 from BuckleScript/bs_config
remove bsppx, use "bsc.exe -as-pppx"
2 parents e7c50e4 + e3d5907 commit 4aae054

36 files changed

+269
-308636
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ odoc_gen/*.cmxs
6666

6767
# for npm publish
6868
*.exe
69-
!bin/bsppx
69+
7070
!bin/bspack
7171
!/bin/bsb
7272
!/bin/bsc

jscomp/.merlin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ B +compiler-libs
3737
# S test
3838
# B test
3939

40-
# FLG -ppx /Users/hongbozhang/git/ocamlscript/lib/bsppx.exe
40+
4141

4242
FLG -w -40-30+6-23

jscomp/artifacts.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"bsb_helper.exe",
2525
"bsb.exe",
2626
"bsc.exe",
27-
"bsppx.exe",
2827
"ninja.exe",
2928
"refmt.exe"
3029
],
@@ -56,12 +55,10 @@
5655
"lib/4.06.1": [
5756
"bsb_helper.ml",
5857
"bsb.ml",
59-
"bsppx.ml",
6058
"refmt_main3.ml",
6159
"whole_compiler.ml",
6260
"bsb_helper.mli",
6361
"bsb.mli",
64-
"bsppx.mli",
6562
"refmt_main3.mli",
6663
"whole_compiler.mli"
6764
],
@@ -1090,7 +1087,6 @@
10901087
"bsb_helper.exe",
10911088
"bsb.exe",
10921089
"bsc.exe",
1093-
"bsppx.exe",
10941090
"ninja.exe",
10951091
"refmt.exe"
10961092
],
@@ -1130,8 +1126,7 @@
11301126
"ninja.COPYING",
11311127
"bsb_helper.exe",
11321128
"bsb.exe",
1133-
"bsc.exe",
1134-
"bsppx.exe",
1129+
"bsc.exe",
11351130
"ninja.exe",
11361131
"refmt.exe"
11371132
]

jscomp/bsb/bsb_global_paths.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ let vendor_bsdep =
6161
Filename.concat bsc_dir "bsb_helper.exe"
6262

6363

64-
let vendor_bsppx =
65-
Filename.concat bsc_dir "bsppx.exe"
6664

6765
;; assert (Sys.file_exists bsc_dir)
6866

jscomp/bsb/bsb_global_paths.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ val vendor_ninja : string
3333

3434
val vendor_bsdep : string
3535

36-
val vendor_bsppx : string
37-
3836
val ocaml_dir : string
3937

4038
val ocaml_lib_dir : string

jscomp/bsb/bsb_merlin_gen.ml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ let warning_to_merlin_flg (warning: Bsb_warning.t ) : string=
9999

100100

101101
let merlin_file_gen ~per_proj_dir:(per_proj_dir:string)
102-
built_in_ppx
103102
({file_groups = res_files ;
104103
generate_merlin;
105104
ppx_files;
@@ -136,14 +135,18 @@ let merlin_file_gen ~per_proj_dir:(per_proj_dir:string)
136135
Buffer.add_string buffer
137136
(merlin_flg_ppx ^
138137
(match reason_react_jsx with
139-
| None -> built_in_ppx
138+
| None ->
139+
let fmt : _ format =
140+
if Ext_sys.is_windows_or_cygwin then
141+
"\"%s -as-ppx \""
142+
else "'%s -as-ppx '" in Printf.sprintf fmt Bsb_global_paths.vendor_bsc
140143
| Some opt ->
141144
let fmt : _ format =
142145
if Ext_sys.is_windows_or_cygwin then
143-
"\"%s -bs-jsx %d\""
144-
else "'%s -bs-jsx %d'"
146+
"\"%s -as-ppx -bs-jsx %d\""
147+
else "'%s -as-ppx -bs-jsx %d'"
145148
in
146-
Printf.sprintf fmt built_in_ppx
149+
Printf.sprintf fmt Bsb_global_paths.vendor_bsc
147150
(match opt with Jsx_v2 -> 2 | Jsx_v3 -> 3)
148151
)
149152
);

jscomp/bsb/bsb_merlin_gen.mli

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@
2626

2727

2828
val merlin_file_gen :
29-
per_proj_dir:string -> string -> Bsb_config_types.t -> unit
29+
per_proj_dir:string ->
30+
Bsb_config_types.t ->
31+
unit

jscomp/bsb/bsb_ninja_regen.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ let regenerate_ninja
7373
config.file_groups
7474
;
7575
Bsb_merlin_gen.merlin_file_gen ~per_proj_dir
76-
(Bsb_global_paths.vendor_bsppx) config;
76+
config;
7777
Bsb_ninja_gen.output_ninja_and_namespace_map
7878
~per_proj_dir ~toplevel config ;
7979

jscomp/build_tests/unicode/.merlin

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
####{BSB GENERATED: NO EDIT
2-
FLG -ppx /Users/hongbozhang/git/bucklescript/lib/bsppx.exe
2+
FLG -ppx '/Users/hongbozhang/git/bucklescript/darwin/bsc.exe -as-ppx '
33
S /Users/hongbozhang/git/bucklescript/jscomp/build_tests/node_modules/bs-platform/lib/ocaml
44
B /Users/hongbozhang/git/bucklescript/jscomp/build_tests/node_modules/bs-platform/lib/ocaml
55
FLG -nostdlib
6-
FLG -w -30-40+6+7+27+32..39+44+45+101
6+
FLG -w +a-4-9-40-41-42-50-61-102
77
S 📕annotation
88
B lib/bs/📕annotation
99
S 📗block

jscomp/common/js_config.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,5 @@ let no_stdlib = ref false
116116
let no_export = ref false
117117

118118
let record_as_js_object = ref false (* otherwise has an attribute *)
119+
120+
let as_ppx = ref false

0 commit comments

Comments
 (0)