Skip to content

Commit 556545d

Browse files
authored
Remove internal/unused -bs-v flag (#7627)
* Remove internal/unused -bs-v flag * CHANGELOG
1 parent 507a751 commit 556545d

File tree

14 files changed

+10
-73
lines changed

14 files changed

+10
-73
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
1313
# 12.0.0-beta.2 (Unreleased)
1414

15+
#### :house: Internal
16+
17+
- Remove internal/unused `-bs-v` flag. https://github.com/rescript-lang/rescript/pull/7627
18+
1519
# 12.0.0-beta.1
1620

1721
#### :rocket: New Feature

cli/rescript.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ try {
1717
if (
1818
subcommand === "build" ||
1919
subcommand === "watch" ||
20-
subcommand === "clean" ||
21-
subcommand === "compiler-args"
20+
subcommand === "clean"
2221
) {
2322
child_process.execFileSync(
2423
rescript_exe,

compiler/bsb/bsb_ninja_gen.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let output_static_resources (static_resources : string list) copy_rule oc =
6666

6767
(*
6868
FIXME: check if the trick still works
69-
phony build.ninja : | resources
69+
phony build.ninja : | resources
7070
*)
7171
let mark_rescript oc = output_string oc "rescript = 1\n"
7272

@@ -197,7 +197,7 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind
197197
~dpkg_incls (* dev dependencies *)
198198
~lib_incls (* its own libs *)
199199
~dev_incls (* its own devs *)
200-
~bs_dependencies ~bs_dev_dependencies generators
200+
generators
201201
in
202202

203203
let oc = open_out_bin (cwd_lib_bs // Literals.build_ninja) in

compiler/bsb/bsb_ninja_rule.ml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
9191
~(jsx : Bsb_jsx.t) ~(digest : string) ~(package_specs : Bsb_package_specs.t)
9292
~(namespace : string option) ~package_name ~warnings
9393
~(ppx_files : Bsb_config_types.ppx list) ~bsc_flags ~(dpkg_incls : string)
94-
~(lib_incls : string) ~(dev_incls : string) ~bs_dependencies
95-
~bs_dev_dependencies (custom_rules : command Map_string.t) : builtin =
94+
~(lib_incls : string) ~(dev_incls : string)
95+
(custom_rules : command Map_string.t) : builtin =
9696
let bs_dep = Ext_filename.maybe_quote Bsb_global_paths.vendor_bsdep in
9797
let bsc = Ext_filename.maybe_quote Bsb_global_paths.vendor_bsc in
9898
(* FIXME: We don't need set [-o ${out}] when building ast
@@ -127,11 +127,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
127127
Ext_buffer.add_string buf
128128
(Bsb_package_specs.package_flag_of_package_specs package_specs
129129
~dirname:"$in_d"));
130-
(match (bs_dependencies, bs_dev_dependencies) with
131-
| [], [] -> ()
132-
| _, _ ->
133-
Ext_buffer.add_string buf " -bs-v";
134-
Ext_buffer.add_ninja_prefix_var buf Bsb_ninja_global_vars.g_finger);
135130
Ext_buffer.add_string buf " $i";
136131
(match postbuild with
137132
| None -> ()
@@ -145,8 +140,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
145140
Ext_buffer.clear buf;
146141
Ext_buffer.add_string buf bsc;
147142
Ext_buffer.add_char_string buf ' ' warnings;
148-
Ext_buffer.add_string buf " -bs-v ";
149-
Ext_buffer.add_string buf Bs_version.version;
150143
(match ppx_files with
151144
| [] -> ()
152145
| _ ->

compiler/bsb/bsb_ninja_rule.mli

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type builtin = {
5454
(***********************************************************)
5555

5656
(** rules are generally composed of built-in rules and customized rules, there are two design choices:
57-
1. respect custom rules with the same name, then we need adjust our built-in
57+
1. respect custom rules with the same name, then we need adjust our built-in
5858
rules dynamically in case the conflict.
5959
2. respect our built-in rules, then we only need re-load custom rules for each rescript.json
6060
*)
@@ -79,7 +79,5 @@ val make_custom_rules :
7979
dpkg_incls:string ->
8080
lib_incls:string ->
8181
dev_incls:string ->
82-
bs_dependencies:Bsb_config_types.dependencies ->
83-
bs_dev_dependencies:Bsb_config_types.dependencies ->
8482
command Map_string.t ->
8583
builtin

compiler/bsc/rescript_compiler_main.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
302302
Js_config.debug := true;
303303
Pp.replace_directive_bool "DEBUG" true),
304304
"Debug mode" );
305-
("-bs-v", string_call ignore, "*internal* version check to force a rebuild");
306305
( "-bs-package-name",
307306
string_call Js_packages_state.set_package_name,
308307
"*internal* Set package name, useful when you want to produce npm \

rewatch/src/build.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ pub struct CompilerArgs {
5858

5959
pub fn get_compiler_args(
6060
path: &Path,
61-
rescript_version: Option<String>,
62-
bsc_path: Option<PathBuf>,
6361
build_dev_deps: bool,
6462
) -> Result<String> {
6563
let filename = &helpers::get_abs_path(path);
@@ -69,15 +67,6 @@ pub fn get_compiler_args(
6967
let root_rescript_config =
7068
packages::read_config(&workspace_root.to_owned().unwrap_or(package_root.to_owned()))?;
7169
let rescript_config = packages::read_config(&package_root)?;
72-
let rescript_version = if let Some(rescript_version) = rescript_version {
73-
rescript_version
74-
} else {
75-
let bsc_path = match bsc_path {
76-
Some(bsc_path) => helpers::get_abs_path(&bsc_path),
77-
None => helpers::get_bsc(&package_root, &workspace_root),
78-
};
79-
helpers::get_rescript_version(&bsc_path)
80-
};
8170

8271
// make PathBuf from package root and get the relative path for filename
8372
let relative_filename = filename.strip_prefix(PathBuf::from(&package_root)).unwrap();
@@ -89,7 +78,6 @@ pub fn get_compiler_args(
8978
&rescript_config,
9079
&root_rescript_config,
9180
&relative_filename,
92-
&rescript_version,
9381
&workspace_root,
9482
workspace_root.as_ref().unwrap_or(&package_root),
9583
&contents,
@@ -106,7 +94,6 @@ pub fn get_compiler_args(
10694
&rescript_config,
10795
&root_rescript_config,
10896
&ast_path,
109-
&rescript_version,
11097
&relative_filename,
11198
is_interface,
11299
has_interface,
@@ -141,7 +128,6 @@ pub fn initialize_build(
141128
None => helpers::get_bsc(&project_root, &workspace_root),
142129
};
143130
let root_config_name = packages::read_package_name(&project_root)?;
144-
let rescript_version = helpers::get_rescript_version(&bsc_path);
145131

146132
if !snapshot_output && show_progress {
147133
print!("{} {}Building package tree...", style("[1/7]").bold().dim(), TREE);
@@ -190,7 +176,6 @@ pub fn initialize_build(
190176
root_config_name,
191177
packages,
192178
workspace_root,
193-
rescript_version,
194179
bsc_path,
195180
);
196181
packages::parse_packages(&mut build_state);

rewatch/src/build/build_types.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ pub struct BuildState {
9494
pub project_root: PathBuf,
9595
pub root_config_name: String,
9696
pub deleted_modules: AHashSet<String>,
97-
pub rescript_version: String,
9897
pub bsc_path: PathBuf,
9998
pub workspace_root: Option<PathBuf>,
10099
pub deps_initialized: bool,
@@ -113,7 +112,6 @@ impl BuildState {
113112
root_config_name: String,
114113
packages: AHashMap<String, Package>,
115114
workspace_root: Option<PathBuf>,
116-
rescript_version: String,
117115
bsc_path: PathBuf,
118116
) -> Self {
119117
Self {
@@ -124,7 +122,6 @@ impl BuildState {
124122
root_config_name,
125123
deleted_modules: AHashSet::new(),
126124
workspace_root,
127-
rescript_version,
128125
bsc_path,
129126
deps_initialized: false,
130127
}

rewatch/src/build/clean.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ pub fn clean(
354354
None => helpers::get_bsc(&project_root, &workspace_root),
355355
};
356356

357-
let rescript_version = helpers::get_rescript_version(&bsc_path);
358357

359358
let timing_clean_compiler_assets = Instant::now();
360359
if !snapshot_output && show_progress {
@@ -412,7 +411,6 @@ pub fn clean(
412411
root_config_name,
413412
packages,
414413
workspace_root,
415-
rescript_version,
416414
bsc_path,
417415
);
418416
packages::parse_packages(&mut build_state);

rewatch/src/build/compile.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ pub fn compile(
165165
root_package,
166166
&helpers::get_ast_path(&path),
167167
module,
168-
&build_state.rescript_version,
169168
true,
170169
&build_state.bsc_path,
171170
&build_state.packages,
@@ -182,7 +181,6 @@ pub fn compile(
182181
root_package,
183182
&helpers::get_ast_path(&source_file.implementation.path),
184183
module,
185-
&build_state.rescript_version,
186184
false,
187185
&build_state.bsc_path,
188186
&build_state.packages,
@@ -354,7 +352,6 @@ pub fn compiler_args(
354352
config: &config::Config,
355353
root_config: &config::Config,
356354
ast_path: &Path,
357-
version: &str,
358355
file_path: &Path,
359356
is_interface: bool,
360357
has_interface: bool,
@@ -475,7 +472,6 @@ pub fn compiler_args(
475472
// "-I".to_string(),
476473
// abs_node_modules_path.to_string() + "/rescript/ocaml",
477474
// ],
478-
vec!["-bs-v".to_string(), format!("{}", version)],
479475
vec![ast_path.to_string_lossy().to_string()],
480476
]
481477
.concat()
@@ -568,7 +564,6 @@ fn compile_file(
568564
root_package: &packages::Package,
569565
ast_path: &Path,
570566
module: &Module,
571-
version: &str,
572567
is_interface: bool,
573568
bsc_path: &Path,
574569
packages: &AHashMap<String, packages::Package>,
@@ -592,7 +587,6 @@ fn compile_file(
592587
&package.config,
593588
&root_package.config,
594589
ast_path,
595-
version,
596590
implementation_file_path,
597591
is_interface,
598592
has_interface,

0 commit comments

Comments
 (0)