Skip to content

Commit 850be4d

Browse files
committed
Replace BS_DEBUG with BS_RELEASE_BUILD
By default it is debug build Note we did this since we don’t want to rely on env variable for default build, and we don’t want to add `-D ` to ocamlopt.opt
1 parent d04f8f0 commit 850be4d

18 files changed

+152
-114178
lines changed

jscomp/Makefile

+10-10
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ check: $(EXT_CMXS) $(COMMON_CMXS) $(SYNTAX_CMXS) $(DEPENDS_CMXS) $(CORE_CMXS) $(
430430
../lib/bsb.exe: bs_hash.cmxa ext.cmxa common.cmxa bsb.cmxa main/bsb_main.cmx
431431
$(NATIVE) -I +compiler-libs -g ocamlcommon.cmxa unix.cmxa str.cmxa $^ -o $@
432432

433-
../lib/bsb_helper.exe: bs_hash.cmxa ext.cmxa common.cmxa bsb.cmxa bsb/bsb_helper_main.cmx
433+
../lib/bsb_helper.exe: bs_hash.cmxa ext.cmxa common.cmxa bsb.cmxa main/bsb_helper_main.cmx
434434
$(NATIVE) -I +compiler-libs -g ocamlcommon.cmxa unix.cmxa str.cmxa $^ -o $@
435435

436436
# bin/bsc: ext.cmxa common.cmxa depends.cmxa syntax.cmxa core.cmxa
@@ -442,7 +442,7 @@ check: $(EXT_CMXS) $(COMMON_CMXS) $(SYNTAX_CMXS) $(DEPENDS_CMXS) $(CORE_CMXS) $(
442442
@echo "Linking"
443443
$(NATIVE) -g -linkall -I +compiler-libs ocamlcommon.cmxa $^ -o $@
444444

445-
bin/cmjdump.exe: bs_hash.cmxa ext.cmxa common.cmxa syntax.cmxa depends.cmxa core.cmxa core/cmjdump_main.cmx
445+
bin/cmjdump.exe: bs_hash.cmxa ext.cmxa common.cmxa syntax.cmxa depends.cmxa core.cmxa main/cmjdump_main.cmx
446446
@echo "Linking"
447447
$(NATIVE) -g -linkall -I +compiler-libs ocamlcommon.cmxa $^ -o $@
448448

@@ -462,7 +462,7 @@ bin/jsgen.exe:bs_hash.cmxa ext.cmxa jsgen_main.cmx
462462

463463

464464
depend:
465-
BS_DEBUG=true $(CAMLDEP) -absname -native -I stubs -I ext -I common -I syntax -I depends -I core -I ounit -I ounit_tests -I bsb -I super_errors -I outcome_printer \
465+
$(CAMLDEP) -absname -native -I stubs -I ext -I common -I syntax -I depends -I core -I ounit -I ounit_tests -I bsb -I super_errors -I outcome_printer \
466466
$(addprefix stubs/, $(addsuffix .ml, $(STUB_SRCS))) \
467467
$(addprefix stubs/, $(addsuffix .mli, $(STUB_SRCS))) \
468468
$(addprefix ext/, $(addsuffix .ml, $(EXT_SRCS))) \
@@ -551,22 +551,22 @@ SNAPSHOT_SRCS+=$(addprefix bin/, $(addsuffix .ml, all_ounit_tests))
551551
SNAPSHOT_DEPS=$(SNAPSHOT_SRCS:.ml=.d)
552552

553553
../lib/bsppx.ml:./bin/bspack.exe
554-
$< -U BS_DEBUG -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 main -bs-main Bsppx_main -o $@
554+
$< -D BS_RELEASE_BUILD=true -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 main -bs-main Bsppx_main -o $@
555555

556556
../lib/whole_compiler.ml:./bin/bspack.exe
557-
$< -U BS_DEBUG -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -o $@ -bs-main Js_main -I $(OCAML_SRC_UTILS) -I $(OCAML_SRC_PARSING) -I $(OCAML_SRC_TYPING) -I $(OCAML_SRC_BYTECOMP) -I $(OCAML_SRC_DRIVER)/ -I stubs -I ext -I syntax -I depends -I common -I core -I super_errors -I outcome_printer -I main
557+
$< -D BS_RELEASE_BUILD=true -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -o $@ -bs-main Js_main -I $(OCAML_SRC_UTILS) -I $(OCAML_SRC_PARSING) -I $(OCAML_SRC_TYPING) -I $(OCAML_SRC_BYTECOMP) -I $(OCAML_SRC_DRIVER)/ -I stubs -I ext -I syntax -I depends -I common -I core -I super_errors -I outcome_printer -I main
558558

559559
../lib/bsdep.ml:./bin/bspack.exe
560-
$< -D BS_OCAMLDEP=true -U BS_DEBUG -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 -bs-main Ocamldep -o $@
560+
$< -D BS_OCAMLDEP=true -D BS_RELEASE_BUILD=true -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 -bs-main Ocamldep -o $@
561561

562562
../lib/bsb_helper.ml:./bin/bspack.exe
563-
$< -bs-MD -U BS_DEBUG -I stubs -I common -I ext -I syntax -I depends -I bsb -I main -bs-main Bsb_helper_main -o $@
563+
$< -bs-MD -D BS_RELEASE_BUILD=true -I stubs -I common -I ext -I syntax -I depends -I bsb -I main -bs-main Bsb_helper_main -o $@
564564

565565
../lib/bsb.ml:./bin/bspack.exe
566-
$< -D BS_MIN_LEX_DEPS=true -bs-MD -U BS_DEBUG -I $(OCAML_SRC_UTILS) -I $(OCAML_SRC_PARSING) -I stubs -I common -I ext -I syntax -I depends -I bsb -I ext -I main -bs-main Bsb_main -o $@
566+
$< -D BS_MIN_LEX_DEPS=true -bs-MD -D BS_RELEASE_BUILD=true -I $(OCAML_SRC_UTILS) -I $(OCAML_SRC_PARSING) -I stubs -I common -I ext -I syntax -I depends -I bsb -I ext -I main -bs-main Bsb_main -o $@
567567

568568
../lib/bspp.ml:./bin/bspack.exe
569-
$< -D BS_MIN_LEX_DEPS=true -U BS_DEBUG -bs-MD -module-alias Config=Config_whole_compiler -I $(OCAML_SRC_UTILS) -I $(OCAML_SRC_PARSING)?parser -I common -I ext -I syntax -I depends -I bspp -I core -I main -bs-main Bspp_main -o $@
569+
$< -D BS_MIN_LEX_DEPS=true -D BS_RELEASE_BUILD=true -bs-MD -module-alias Config=Config_whole_compiler -I $(OCAML_SRC_UTILS) -I $(OCAML_SRC_PARSING)?parser -I common -I ext -I syntax -I depends -I bspp -I core -I main -bs-main Bspp_main -o $@
570570

571571
../lib/bspp.exe:../lib/bspp.mli ../lib/bspp.ml
572572
make -C ../lib bspp.exe
@@ -578,7 +578,7 @@ bin/jsoo_reactjs_jsx_ppx_v2.ml:./bin/reactjs_jsx_ppx_v2.bspp.ml ../lib/bspp.exe
578578
BS_COMPILER_IN_BROWSER=true ../lib/bspp.exe $^ > $@
579579

580580
bin/js_compiler.ml:./bin/bspack.exe
581-
./bin/bspack.exe -D BS_COMPILER_IN_BROWSER=true -U BS_DEBUG -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -o $@ -bs-main Jsoo_main -I $(OCAML_SRC_UTILS) -I $(OCAML_SRC_PARSING) -I $(OCAML_SRC_TYPING) -I $(OCAML_SRC_BYTECOMP) -I $(OCAML_SRC_DRIVER) -I stubs -I ext -I syntax -I depends -I common -I core -I super_errors -I bsb -I outcome_printer
581+
./bin/bspack.exe -D BS_COMPILER_IN_BROWSER=true -D BS_RELEASE_BUILD=true -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -o $@ -bs-main Jsoo_main -I $(OCAML_SRC_UTILS) -I $(OCAML_SRC_PARSING) -I $(OCAML_SRC_TYPING) -I $(OCAML_SRC_BYTECOMP) -I $(OCAML_SRC_DRIVER) -I stubs -I ext -I syntax -I depends -I common -I core -I super_errors -I bsb -I outcome_printer
582582

583583
bin/all_ounit_tests.ml:./bin/bspack.exe
584584
$< -bs-MD -I ounit -I ounit_tests -I stubs -I bsb -I common -I ext -I syntax -I depends -I bspp -I core -bs-main Ounit_tests_main -o $@

jscomp/bin/all_ounit_tests.ml

+19-19
Original file line numberDiff line numberDiff line change
@@ -9322,11 +9322,11 @@ end = struct
93229322

93239323

93249324

9325-
# 10
9325+
# 10 "ext/map.cppo.ml"
93269326
type key = string
93279327
let compare_key = Ext_string.compare
93289328

9329-
# 22
9329+
# 22 "ext/map.cppo.ml"
93309330
type 'a t = (key,'a) Map_gen.t
93319331
exception Duplicate_key of key
93329332

@@ -10213,7 +10213,7 @@ let lf = '\010'
1021310213

1021410214
# 124 "ext/ext_json_parse.ml"
1021510215
let __ocaml_lex_tables = {
10216-
Lexing.lex_base =
10216+
Lexing.lex_base =
1021710217
"\000\000\239\255\240\255\241\255\000\000\025\000\011\000\244\255\
1021810218
\245\255\246\255\247\255\248\255\249\255\000\000\000\000\000\000\
1021910219
\041\000\001\000\254\255\005\000\005\000\253\255\001\000\002\000\
@@ -10222,7 +10222,7 @@ let __ocaml_lex_tables = {
1022210222
\001\000\253\255\254\255\023\000\255\255\006\000\246\255\189\000\
1022310223
\248\255\215\000\255\255\249\255\249\000\181\000\252\255\009\000\
1022410224
\063\000\075\000\234\000\251\255\032\001\250\255";
10225-
Lexing.lex_backtrk =
10225+
Lexing.lex_backtrk =
1022610226
"\255\255\255\255\255\255\255\255\013\000\013\000\016\000\255\255\
1022710227
\255\255\255\255\255\255\255\255\255\255\016\000\016\000\016\000\
1022810228
\016\000\016\000\255\255\000\000\012\000\255\255\255\255\255\255\
@@ -10231,7 +10231,7 @@ let __ocaml_lex_tables = {
1023110231
\255\255\255\255\255\255\001\000\255\255\255\255\255\255\008\000\
1023210232
\255\255\255\255\255\255\255\255\006\000\006\000\255\255\006\000\
1023310233
\001\000\002\000\255\255\255\255\255\255\255\255";
10234-
Lexing.lex_default =
10234+
Lexing.lex_default =
1023510235
"\001\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\
1023610236
\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\
1023710237
\255\255\255\255\000\000\255\255\020\000\000\000\255\255\255\255\
@@ -10240,7 +10240,7 @@ let __ocaml_lex_tables = {
1024010240
\042\000\000\000\000\000\255\255\000\000\047\000\000\000\047\000\
1024110241
\000\000\051\000\000\000\000\000\255\255\255\255\000\000\255\255\
1024210242
\255\255\255\255\255\255\000\000\255\255\000\000";
10243-
Lexing.lex_trans =
10243+
Lexing.lex_trans =
1024410244
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
1024510245
\000\000\019\000\018\000\018\000\019\000\017\000\019\000\255\255\
1024610246
\048\000\019\000\255\255\057\000\000\000\000\000\000\000\000\000\
@@ -10310,7 +10310,7 @@ let __ocaml_lex_tables = {
1031010310
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
1031110311
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
1031210312
\000\000";
10313-
Lexing.lex_check =
10313+
Lexing.lex_check =
1031410314
"\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
1031510315
\255\255\000\000\000\000\017\000\000\000\000\000\019\000\020\000\
1031610316
\045\000\019\000\020\000\055\000\255\255\255\255\255\255\255\255\
@@ -10380,22 +10380,22 @@ let __ocaml_lex_tables = {
1038010380
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
1038110381
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
1038210382
\255\255";
10383-
Lexing.lex_base_code =
10383+
Lexing.lex_base_code =
1038410384
"";
10385-
Lexing.lex_backtrk_code =
10385+
Lexing.lex_backtrk_code =
1038610386
"";
10387-
Lexing.lex_default_code =
10387+
Lexing.lex_default_code =
1038810388
"";
10389-
Lexing.lex_trans_code =
10389+
Lexing.lex_trans_code =
1039010390
"";
10391-
Lexing.lex_check_code =
10391+
Lexing.lex_check_code =
1039210392
"";
10393-
Lexing.lex_code =
10393+
Lexing.lex_code =
1039410394
"";
1039510395
}
1039610396

1039710397
let rec lex_json buf lexbuf =
10398-
__ocaml_lex_lex_json_rec buf lexbuf 0
10398+
__ocaml_lex_lex_json_rec buf lexbuf 0
1039910399
and __ocaml_lex_lex_json_rec buf lexbuf __ocaml_lex_state =
1040010400
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
1040110401
| 0 ->
@@ -10497,11 +10497,11 @@ let
1049710497
( error lexbuf (Illegal_character c ))
1049810498
# 408 "ext/ext_json_parse.ml"
1049910499

10500-
| __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
10500+
| __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
1050110501
__ocaml_lex_lex_json_rec buf lexbuf __ocaml_lex_state
1050210502

1050310503
and comment buf lexbuf =
10504-
__ocaml_lex_comment_rec buf lexbuf 40
10504+
__ocaml_lex_comment_rec buf lexbuf 40
1050510505
and __ocaml_lex_comment_rec buf lexbuf __ocaml_lex_state =
1050610506
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
1050710507
| 0 ->
@@ -10519,11 +10519,11 @@ and __ocaml_lex_comment_rec buf lexbuf __ocaml_lex_state =
1051910519
(error lexbuf Unterminated_comment)
1052010520
# 430 "ext/ext_json_parse.ml"
1052110521

10522-
| __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
10522+
| __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
1052310523
__ocaml_lex_comment_rec buf lexbuf __ocaml_lex_state
1052410524

1052510525
and scan_string buf start lexbuf =
10526-
__ocaml_lex_scan_string_rec buf start lexbuf 45
10526+
__ocaml_lex_scan_string_rec buf start lexbuf 45
1052710527
and __ocaml_lex_scan_string_rec buf start lexbuf __ocaml_lex_state =
1052810528
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
1052910529
| 0 ->
@@ -10658,7 +10658,7 @@ let
1065810658
)
1065910659
# 569 "ext/ext_json_parse.ml"
1066010660

10661-
| __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
10661+
| __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
1066210662
__ocaml_lex_scan_string_rec buf start lexbuf __ocaml_lex_state
1066310663

1066410664
;;

0 commit comments

Comments
 (0)