Skip to content

Commit 9d19bd9

Browse files
authored
Remove unused -no-stdlib and use-stdlib (#6778)
1 parent 4fdf5e0 commit 9d19bd9

14 files changed

+7
-33
lines changed

docs/docson/build-schema.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,6 @@
472472
"$ref": "#/definitions/package-specs",
473473
"description": "ReScript can currently output to [Commonjs](https://en.wikipedia.org/wiki/CommonJS), and [ES6 modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)"
474474
},
475-
"use-stdlib": {
476-
"type": "boolean",
477-
"description": "(Experimental) whether to use the OCaml standard library. Default: true"
478-
},
479475
"external-stdlib": {
480476
"type": "string",
481477
"description": "Use the external stdlib library instead of the one shipped with the compiler package"

jscomp/bsb/bsb_build_schemas.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ let package_specs = "package-specs"
4545
let type_ = "type"
4646
let export_all = "all"
4747
let export_none = "none"
48-
let use_stdlib = "use-stdlib"
4948
let external_stdlib = "external-stdlib"
5049
let reason = "reason"
5150
let react_jsx = "react-jsx"

jscomp/bsb/bsb_config_parse.ml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ let extract_package_name_and_namespace (map : json_map) : string * string option
8282
bsc -runtime runtime_dir@version
8383
```
8484
*)
85-
let check_stdlib (map : json_map) : bool =
86-
(*built_in_package*)
87-
match map.?(Bsb_build_schemas.use_stdlib) with
88-
| Some (False _) -> false
89-
| None | Some _ -> true
90-
9185
let extract_gentype_config (map : json_map) : Bsb_config_types.gentype_config =
9286
match map.?(Bsb_build_schemas.gentypeconfig) with
9387
| None -> false
@@ -266,9 +260,6 @@ let interpret_json
266260
(* This line has to be before any calls to Bsb_global_backend.backend, because it'll read the entries
267261
array from the bsconfig and set the backend_ref to the first entry, if any. *)
268262

269-
(* The default situation is empty *)
270-
let built_in_package : bool = check_stdlib map in
271-
272263
let pp_flags : string option =
273264
extract_string map Bsb_build_schemas.pp_flags (fun p ->
274265
if p = "" then
@@ -343,7 +334,6 @@ let interpret_json
343334
| Pinned_dependency x | Dependency x -> x.package_specs);
344335
file_groups = groups;
345336
files_to_install = Queue.create ();
346-
built_in_dependency = built_in_package;
347337
reason_react_jsx;
348338
jsx;
349339
generators = extract_generators map;

jscomp/bsb/bsb_config_types.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ type t = {
4747
bs_dependencies : dependencies;
4848
bs_dev_dependencies : dependencies;
4949
pinned_dependencies : Set_string.t;
50-
built_in_dependency : bool;
5150
warning : Bsb_warning.t;
5251
(*TODO: maybe we should always resolve rescript
5352
so that we can calculate correct relative path in

jscomp/bsb/bsb_ninja_gen.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind
156156
package_specs;
157157
file_groups = { files = bs_file_groups };
158158
files_to_install;
159-
built_in_dependency;
160159
reason_react_jsx;
161160
jsx;
162161
uncurried;
@@ -205,7 +204,7 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind
205204
in
206205
let rules : Bsb_ninja_rule.builtin =
207206
Bsb_ninja_rule.make_custom_rules ~gentype_config
208-
~has_postbuild:js_post_build_cmd ~pp_file ~has_builtin:built_in_dependency
207+
~has_postbuild:js_post_build_cmd ~pp_file
209208
~reason_react_jsx ~jsx ~uncurried ~package_specs ~namespace ~digest ~package_name
210209
~warnings ~ppx_files ~bsc_flags ~dpkg_incls (* dev dependencies *)
211210
~lib_incls (* its own libs *)

jscomp/bsb/bsb_ninja_rule.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ type builtin = {
8989

9090
let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
9191
~(has_postbuild : string option) ~(pp_file : string option)
92-
~(has_builtin : bool)
9392
~(reason_react_jsx : Bsb_config_types.reason_react_jsx option)
9493
~(jsx : Bsb_jsx.t) ~(uncurried: bool) ~(digest : string) ~(package_specs : Bsb_package_specs.t)
9594
~(namespace : string option) ~package_name ~warnings
@@ -114,7 +113,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
114113
if is_dev then Ext_buffer.add_char_string buf ' ' dev_incls;
115114
Ext_buffer.add_char_string buf ' ' lib_incls;
116115
if is_dev then Ext_buffer.add_char_string buf ' ' dpkg_incls;
117-
if not has_builtin then Ext_buffer.add_string buf " -nostdlib";
118116
Ext_buffer.add_char_string buf ' ' bsc_flags;
119117
Ext_buffer.add_char_string buf ' ' warnings;
120118
(* we need "-w a" in the end position to take effect

jscomp/bsb/bsb_ninja_rule.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ val make_custom_rules :
6969
gentype_config:Bsb_config_types.gentype_config ->
7070
has_postbuild:string option ->
7171
pp_file:string option ->
72-
has_builtin:bool ->
7372
reason_react_jsx:Bsb_config_types.reason_react_jsx option ->
7473
jsx:Bsb_jsx.t ->
7574
uncurried:bool ->

jscomp/bsc/rescript_compiler_main.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
355355
"-bs-unsafe-empty-array", set Config.unsafe_empty_array,
356356
"*internal* Allow [||] to be polymorphic";
357357

358-
"-nostdlib", set Js_config.no_stdlib,
359-
"*internal* Don't use stdlib";
360-
361358
"-color", string_call set_color_option,
362359
"*internal* Enable or disable colors in compiler messages\n\
363360
The following settings are supported:\n\

jscomp/common/js_config.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ let jsx_module = ref React
5454
let jsx_mode = ref Automatic
5555
let js_stdout = ref true
5656
let all_module_aliases = ref false
57-
let no_stdlib = ref false
5857
let no_export = ref false
5958
let as_ppx = ref false
6059

jscomp/common/js_config.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ val js_stdout : bool ref
8787

8888
val all_module_aliases : bool ref
8989

90-
val no_stdlib : bool ref
91-
9290
val no_export : bool ref
9391

9492
val as_ppx : bool ref

jscomp/others/release.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

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
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
33
bsc_flags = $bsc_primitive_flags -open Belt_internals
44

55
rule cc

jscomp/runtime/release.ninja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

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
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
33
bsc_flags = $bsc_no_open_flags -open Bs_stdlib_mini
44

55
rule cc
@@ -10,7 +10,7 @@ rule cc_cmi
1010
description = $in -> $out
1111

1212
o runtime/bs_stdlib_mini.cmi : cc runtime/bs_stdlib_mini.resi
13-
bsc_flags = -nostdlib -nopervasives
13+
bsc_flags = -nopervasives
1414
o runtime/js.cmj runtime/js.cmi : cc runtime/js.ml
1515
bsc_flags = $bsc_no_open_flags
1616
o runtime/caml.cmj : cc_cmi runtime/caml.res | runtime/caml.cmi runtime/caml_int64_extern.cmj

jscomp/stdlib-406/release.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

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
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
33

44
rule cc
55
command = $bsc -bs-cmi -bs-cmj $bsc_flags -I stdlib-406 $in

scripts/ninja.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var runtimeMliFiles = runtimeFiles.filter(
3030
var runtimeSourceFiles = runtimeMlFiles.concat(runtimeMliFiles);
3131
var 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 -nostdlib `;
33+
var commonBsFlags = `-no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero `;
3434
var js_package = pseudoTarget("js_pkg");
3535
var runtimeTarget = pseudoTarget("runtime");
3636
var othersTarget = pseudoTarget("others");
@@ -842,7 +842,7 @@ ${ninjaQuickBuildList([
842842
"bs_stdlib_mini.resi",
843843
"cc",
844844
ninjaCwd,
845-
[["bsc_flags", "-nostdlib -nopervasives"]],
845+
[["bsc_flags", "-nopervasives"]],
846846
[],
847847
externalDeps,
848848
],

0 commit comments

Comments
 (0)