diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index c0139a7e9f..82d5e24dc0 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -472,10 +472,6 @@ "$ref": "#/definitions/package-specs", "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)" }, - "use-stdlib": { - "type": "boolean", - "description": "(Experimental) whether to use the OCaml standard library. Default: true" - }, "external-stdlib": { "type": "string", "description": "Use the external stdlib library instead of the one shipped with the compiler package" diff --git a/jscomp/bsb/bsb_build_schemas.ml b/jscomp/bsb/bsb_build_schemas.ml index 5436f1cbb2..769f6a7a29 100644 --- a/jscomp/bsb/bsb_build_schemas.ml +++ b/jscomp/bsb/bsb_build_schemas.ml @@ -45,7 +45,6 @@ let package_specs = "package-specs" let type_ = "type" let export_all = "all" let export_none = "none" -let use_stdlib = "use-stdlib" let external_stdlib = "external-stdlib" let reason = "reason" let react_jsx = "react-jsx" diff --git a/jscomp/bsb/bsb_config_parse.ml b/jscomp/bsb/bsb_config_parse.ml index 747a2b7e08..4a9aab131c 100644 --- a/jscomp/bsb/bsb_config_parse.ml +++ b/jscomp/bsb/bsb_config_parse.ml @@ -82,12 +82,6 @@ let extract_package_name_and_namespace (map : json_map) : string * string option bsc -runtime runtime_dir@version ``` *) -let check_stdlib (map : json_map) : bool = - (*built_in_package*) - match map.?(Bsb_build_schemas.use_stdlib) with - | Some (False _) -> false - | None | Some _ -> true - let extract_gentype_config (map : json_map) : Bsb_config_types.gentype_config = match map.?(Bsb_build_schemas.gentypeconfig) with | None -> false @@ -266,9 +260,6 @@ let interpret_json (* This line has to be before any calls to Bsb_global_backend.backend, because it'll read the entries array from the bsconfig and set the backend_ref to the first entry, if any. *) - (* The default situation is empty *) - let built_in_package : bool = check_stdlib map in - let pp_flags : string option = extract_string map Bsb_build_schemas.pp_flags (fun p -> if p = "" then @@ -343,7 +334,6 @@ let interpret_json | Pinned_dependency x | Dependency x -> x.package_specs); file_groups = groups; files_to_install = Queue.create (); - built_in_dependency = built_in_package; reason_react_jsx; jsx; generators = extract_generators map; diff --git a/jscomp/bsb/bsb_config_types.ml b/jscomp/bsb/bsb_config_types.ml index db5c007e4d..c80e3e88bf 100644 --- a/jscomp/bsb/bsb_config_types.ml +++ b/jscomp/bsb/bsb_config_types.ml @@ -47,7 +47,6 @@ type t = { bs_dependencies : dependencies; bs_dev_dependencies : dependencies; pinned_dependencies : Set_string.t; - built_in_dependency : bool; warning : Bsb_warning.t; (*TODO: maybe we should always resolve rescript so that we can calculate correct relative path in diff --git a/jscomp/bsb/bsb_ninja_gen.ml b/jscomp/bsb/bsb_ninja_gen.ml index d10b938591..6c80ffebd4 100644 --- a/jscomp/bsb/bsb_ninja_gen.ml +++ b/jscomp/bsb/bsb_ninja_gen.ml @@ -156,7 +156,6 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind package_specs; file_groups = { files = bs_file_groups }; files_to_install; - built_in_dependency; reason_react_jsx; jsx; uncurried; @@ -205,7 +204,7 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind in let rules : Bsb_ninja_rule.builtin = Bsb_ninja_rule.make_custom_rules ~gentype_config - ~has_postbuild:js_post_build_cmd ~pp_file ~has_builtin:built_in_dependency + ~has_postbuild:js_post_build_cmd ~pp_file ~reason_react_jsx ~jsx ~uncurried ~package_specs ~namespace ~digest ~package_name ~warnings ~ppx_files ~bsc_flags ~dpkg_incls (* dev dependencies *) ~lib_incls (* its own libs *) diff --git a/jscomp/bsb/bsb_ninja_rule.ml b/jscomp/bsb/bsb_ninja_rule.ml index 1103a3ac4c..8904ee0db6 100644 --- a/jscomp/bsb/bsb_ninja_rule.ml +++ b/jscomp/bsb/bsb_ninja_rule.ml @@ -89,7 +89,6 @@ type builtin = { let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config) ~(has_postbuild : string option) ~(pp_file : string option) - ~(has_builtin : bool) ~(reason_react_jsx : Bsb_config_types.reason_react_jsx option) ~(jsx : Bsb_jsx.t) ~(uncurried: bool) ~(digest : string) ~(package_specs : Bsb_package_specs.t) ~(namespace : string option) ~package_name ~warnings @@ -114,7 +113,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config) if is_dev then Ext_buffer.add_char_string buf ' ' dev_incls; Ext_buffer.add_char_string buf ' ' lib_incls; if is_dev then Ext_buffer.add_char_string buf ' ' dpkg_incls; - if not has_builtin then Ext_buffer.add_string buf " -nostdlib"; Ext_buffer.add_char_string buf ' ' bsc_flags; Ext_buffer.add_char_string buf ' ' warnings; (* we need "-w a" in the end position to take effect diff --git a/jscomp/bsb/bsb_ninja_rule.mli b/jscomp/bsb/bsb_ninja_rule.mli index 5760ed8940..e5ede24173 100644 --- a/jscomp/bsb/bsb_ninja_rule.mli +++ b/jscomp/bsb/bsb_ninja_rule.mli @@ -69,7 +69,6 @@ val make_custom_rules : gentype_config:Bsb_config_types.gentype_config -> has_postbuild:string option -> pp_file:string option -> - has_builtin:bool -> reason_react_jsx:Bsb_config_types.reason_react_jsx option -> jsx:Bsb_jsx.t -> uncurried:bool -> diff --git a/jscomp/bsc/rescript_compiler_main.ml b/jscomp/bsc/rescript_compiler_main.ml index c139428e82..33d043cb8e 100644 --- a/jscomp/bsc/rescript_compiler_main.ml +++ b/jscomp/bsc/rescript_compiler_main.ml @@ -355,9 +355,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array = "-bs-unsafe-empty-array", set Config.unsafe_empty_array, "*internal* Allow [||] to be polymorphic"; - "-nostdlib", set Js_config.no_stdlib, - "*internal* Don't use stdlib"; - "-color", string_call set_color_option, "*internal* Enable or disable colors in compiler messages\n\ The following settings are supported:\n\ diff --git a/jscomp/common/js_config.ml b/jscomp/common/js_config.ml index 7602c681e2..379555b5f0 100644 --- a/jscomp/common/js_config.ml +++ b/jscomp/common/js_config.ml @@ -54,7 +54,6 @@ let jsx_module = ref React let jsx_mode = ref Automatic let js_stdout = ref true let all_module_aliases = ref false -let no_stdlib = ref false let no_export = ref false let as_ppx = ref false diff --git a/jscomp/common/js_config.mli b/jscomp/common/js_config.mli index fd9df5785a..c162e0c86c 100644 --- a/jscomp/common/js_config.mli +++ b/jscomp/common/js_config.mli @@ -87,8 +87,6 @@ val js_stdout : bool ref val all_module_aliases : bool ref -val no_stdlib : bool ref - val no_export : bool ref val as_ppx : bool ref diff --git a/jscomp/others/release.ninja b/jscomp/others/release.ninja index 21b03b82eb..462cfaaeee 100644 --- a/jscomp/others/release.ninja +++ b/jscomp/others/release.ninja @@ -1,5 +1,5 @@ -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 +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 bsc_flags = $bsc_primitive_flags -open Belt_internals rule cc diff --git a/jscomp/runtime/release.ninja b/jscomp/runtime/release.ninja index d21ca55b4d..d9214de2c3 100644 --- a/jscomp/runtime/release.ninja +++ b/jscomp/runtime/release.ninja @@ -1,5 +1,5 @@ -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 +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 bsc_flags = $bsc_no_open_flags -open Bs_stdlib_mini rule cc @@ -10,7 +10,7 @@ rule cc_cmi description = $in -> $out o runtime/bs_stdlib_mini.cmi : cc runtime/bs_stdlib_mini.resi - bsc_flags = -nostdlib -nopervasives + bsc_flags = -nopervasives o runtime/js.cmj runtime/js.cmi : cc runtime/js.ml bsc_flags = $bsc_no_open_flags o runtime/caml.cmj : cc_cmi runtime/caml.res | runtime/caml.cmi runtime/caml_int64_extern.cmj diff --git a/jscomp/stdlib-406/release.ninja b/jscomp/stdlib-406/release.ninja index 992f90f652..ccd377821a 100644 --- a/jscomp/stdlib-406/release.ninja +++ b/jscomp/stdlib-406/release.ninja @@ -1,5 +1,5 @@ -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 +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 rule cc command = $bsc -bs-cmi -bs-cmj $bsc_flags -I stdlib-406 $in diff --git a/scripts/ninja.js b/scripts/ninja.js index bce31a4465..1dda2c3a17 100755 --- a/scripts/ninja.js +++ b/scripts/ninja.js @@ -30,7 +30,7 @@ var runtimeMliFiles = runtimeFiles.filter( var runtimeSourceFiles = runtimeMlFiles.concat(runtimeMliFiles); var runtimeJsFiles = [...new Set(runtimeSourceFiles.map(baseName))]; -var commonBsFlags = `-no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib `; +var commonBsFlags = `-no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero `; var js_package = pseudoTarget("js_pkg"); var runtimeTarget = pseudoTarget("runtime"); var othersTarget = pseudoTarget("others"); @@ -842,7 +842,7 @@ ${ninjaQuickBuildList([ "bs_stdlib_mini.resi", "cc", ninjaCwd, - [["bsc_flags", "-nostdlib -nopervasives"]], + [["bsc_flags", "-nopervasives"]], [], externalDeps, ],