From 5b8f060be3846702606b8807e0c438870ae3b493 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Tue, 28 Nov 2023 12:47:17 +0000 Subject: [PATCH] Remove unneccessary rustc check now MSRV is 1.63 --- build.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/build.rs b/build.rs index 2da2a0600..f41c9813b 100644 --- a/build.rs +++ b/build.rs @@ -9,7 +9,7 @@ use std::{path::PathBuf, process::Command}; use rayon::prelude::*; -use version_check as rustc; +// use version_check as rustc; struct TreeSitterParser { name: &'static str, @@ -19,11 +19,6 @@ struct TreeSitterParser { impl TreeSitterParser { fn build(&self) { - // In rustc 1.61+, we need to specify +whole-archive. - // See https://github.com/rust-lang/rust/blob/1.61.0/RELEASES.md#compatibility-notes - // and https://github.com/Wilfred/difftastic/issues/339. - let rustc_supports_whole_archive = !rustc::is_max_version("1.60.0").unwrap_or(false); - let dir = PathBuf::from(&self.src_dir); let mut c_files = vec!["parser.c"]; @@ -54,16 +49,13 @@ impl TreeSitterParser { .flag_if_supported("-Wno-unused-but-set-variable") // Workaround for: https://github.com/ganezdragon/tree-sitter-perl/issues/16 // should be removed after fixed. - .flag_if_supported("-Wno-return-type"); + .flag_if_supported("-Wno-return-type") + .link_lib_modifier("+whole-archive"); for file in cpp_files { cpp_build.file(dir.join(file)); } - if rustc_supports_whole_archive { - cpp_build.link_lib_modifier("+whole-archive"); - } - cpp_build.compile(&format!("{}-cpp", self.name)); } @@ -76,9 +68,7 @@ impl TreeSitterParser { build.file(dir.join(file)); } - if rustc_supports_whole_archive { - build.link_lib_modifier("+whole-archive"); - } + build.link_lib_modifier("+whole-archive"); build.compile(self.name); }