File tree Expand file tree Collapse file tree 9 files changed +17
-8
lines changed Expand file tree Collapse file tree 9 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 4747- Convert OCaml codebase to snake case style. https://github.com/rescript-lang/rescript-compiler/pull/6702
4848- Fix location of let bindings with attributes. https://github.com/rescript-lang/rescript-compiler/pull/6791
4949- Refactor uppercase exotic ident handling. https://github.com/rescript-lang/rescript-compiler/pull/6779
50+ - Fix ` -nostdlib ` internal compiler option. https://github.com/rescript-lang/rescript-compiler/pull/6824
5051
5152#### :nail_care : Polish
5253
6061- In generated code, use ` let ` instead of ` var ` . https://github.com/rescript-lang/rescript-compiler/pull/6102
6162- Turn off transformation for closures inside loops when capturing loop variables, now that ` let ` is emitted instead of ` var ` . https://github.com/rescript-lang/rescript-compiler/pull/6480
6263- Improve unused attribute warning message. https://github.com/rescript-lang/rescript-compiler/pull/6787
63- - Remove unused -no- stdlib compiler option . https://github.com/rescript-lang/rescript-compiler/pull/6778
64+ - Remove internal option ` use- stdlib` from build schema . https://github.com/rescript-lang/rescript-compiler/pull/6778
6465
6566# 11.1.1
6667
Original file line number Diff line number Diff line change @@ -352,6 +352,9 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
352352 " -bs-unsafe-empty-array" , set Config. unsafe_empty_array,
353353 " *internal* Allow [||] to be polymorphic" ;
354354
355+ " -nostdlib" , set Js_config. no_stdlib,
356+ " *internal* Don't use stdlib" ;
357+
355358 " -color" , string_call set_color_option,
356359 " *internal* Enable or disable colors in compiler messages\n \
357360 The following settings are supported:\n \
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ let jsx_module = ref React
5454let jsx_mode = ref Automatic
5555let js_stdout = ref true
5656let all_module_aliases = ref false
57+ let no_stdlib = ref false
5758let no_export = ref false
5859let as_ppx = ref false
5960
Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ val js_stdout : bool ref
8787
8888val all_module_aliases : bool ref
8989
90+ val no_stdlib : bool ref
91+
9092val no_export : bool ref
9193
9294val as_ppx : bool ref
Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ let init_path () =
2727 let exp_dirs =
2828 List. map (Misc. expand_directory Config. standard_library) dirs
2929 in
30- Config. load_path := List. rev_append exp_dirs [Config. standard_library];
30+ Config. load_path :=
31+ if ! Js_config. no_stdlib then exp_dirs
32+ else (List. rev_append exp_dirs [Config. standard_library]);
3133 Env. reset_cache ()
3234
3335(* Return the initial environment in which compilation proceeds. *)
Original file line number Diff line number Diff line change 11
2- bsc_primitive_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -bs-cross-module-opt -make-runtime -nopervasives -unsafe -w +50 -warn-error A
2+ bsc_primitive_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -make-runtime -nopervasives -unsafe -w +50 -warn-error A
33bsc_flags = $bsc_primitive_flags -open Belt_internals
44
55rule cc
Original file line number Diff line number Diff line change 11
2- bsc_no_open_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -bs-cross-module-opt -make-runtime -nopervasives -unsafe -w +50 -warn-error A
2+ bsc_no_open_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -make-runtime -nopervasives -unsafe -w +50 -warn-error A
33bsc_flags = $bsc_no_open_flags -open Bs_stdlib_mini
44
55rule cc
@@ -10,7 +10,7 @@ rule cc_cmi
1010 description = $in -> $out
1111
1212o runtime/bs_stdlib_mini.cmi : cc runtime/bs_stdlib_mini.resi
13- bsc_flags = -nopervasives
13+ bsc_flags = -nostdlib - nopervasives
1414o runtime/js.cmj runtime/js.cmi : cc runtime/js.ml
1515 bsc_flags = $bsc_no_open_flags
1616o runtime/caml.cmj : cc_cmi runtime/caml.res | runtime/caml.cmi runtime/caml_int64_extern.cmj
Original file line number Diff line number Diff line change 11
2- bsc_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -bs-cross-module-opt -make-runtime -w -9-3-106 -warn-error A -I others
2+ bsc_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -make-runtime -w -9-3-106 -warn-error A -I others
33
44rule cc
55 command = $bsc -bs-cmi -bs-cmj $bsc_flags -I stdlib-406 $in
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ var runtimeMliFiles = runtimeFiles.filter(
3030var runtimeSourceFiles = runtimeMlFiles . concat ( runtimeMliFiles ) ;
3131var runtimeJsFiles = [ ...new Set ( runtimeSourceFiles . map ( baseName ) ) ] ;
3232
33- var commonBsFlags = `-no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero ` ;
33+ var commonBsFlags = `-no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib ` ;
3434var js_package = pseudoTarget ( "js_pkg" ) ;
3535var runtimeTarget = pseudoTarget ( "runtime" ) ;
3636var othersTarget = pseudoTarget ( "others" ) ;
@@ -843,7 +843,7 @@ ${ninjaQuickBuildList([
843843 "bs_stdlib_mini.resi" ,
844844 "cc" ,
845845 ninjaCwd ,
846- [ [ "bsc_flags" , "-nopervasives" ] ] ,
846+ [ [ "bsc_flags" , "-nostdlib - nopervasives" ] ] ,
847847 [ ] ,
848848 externalDeps ,
849849 ] ,
You can’t perform that action at this time.
0 commit comments