-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo install failing due to a compilation problem of onig_sys crate #650
Comments
Build fails on onig_sys on CentOS 7 as well. |
On fix I had for this to install is to modify the Cargo.toml file and fix the syntect version to 3.2.0 --- a/Cargo.toml
+++ b/Cargo.toml
@@ -33,7 +33,7 @@ default-features = false
features = []
[dependencies.syntect]
-version = "3.2.1"
+version = "=3.2.0"
default-features = false
features = ["parsing", "yaml-load", "dump-load", "dump-create"] I was able to install afterwards |
@alaaibrahim Thank you for your feedback. Unfortunately, pinning the version to 3.2.0 would re-introduce this bug: #626 (build failure on certain architectures). |
FYI... fails on Debian 9 but compiles fine (without clang/llvm) on Fedora 30. |
i'm reaally surprised, that a cli tool to view files has a hard dependency on libclang, though |
That's a build-time-only dependency which (although maybe not optimal) is certainly not too surprising. If you want, you can actually get zero-dependency versions of |
oh good that it's build-time-only, hadn't noticed that ! |
This can be resolved once rust-onig/rust-onig#126 is merged. This would also remove the need for Another option would be that trishume/syntect#270 gets merged, in which case |
The Still hoping that onig's build will eventually improve but for now |
Thank you very much for the update! Unfortunately, updating is not completely trivial because
(due to the This could be fixed by using diff --git a/src/parsing/regex.rs b/src/parsing/regex.rs
index 064c232..b0aeac2 100644
--- a/src/parsing/regex.rs
+++ b/src/parsing/regex.rs
@@ -32,7 +32,7 @@ impl Regex {
}
/// Check whether the pattern compiles as a valid regex or not.
- pub fn try_compile(regex_str: &str) -> Option<Box<dyn Error>> {
+ pub fn try_compile(regex_str: &str) -> Option<Box<dyn Error + Send>> {
regex_impl::Regex::new(regex_str).err()
}
@@ -142,7 +142,7 @@ mod regex_impl {
}
impl Regex {
- pub fn new(regex_str: &str) -> Result<Regex, Box<dyn Error>> {
+ pub fn new(regex_str: &str) -> Result<Regex, Box<dyn Error + Send>> {
let result = onig::Regex::with_options(
regex_str,
RegexOptions::REGEX_OPTION_CAPTURE_GROUP,
@@ -210,7 +210,7 @@ mod regex_impl {
}
impl Regex {
- pub fn new(regex_str: &str) -> Result<Regex, Box<dyn Error>> {
+ pub fn new(regex_str: &str) -> Result<Regex, Box<dyn Error + Send>> {
let result = fancy_regex::Regex::new(regex_str);
match result {
Ok(regex) => Ok(Regex { regex }),
diff --git a/src/parsing/yaml_load.rs b/src/parsing/yaml_load.rs
index dd66503..6353bb4 100644
--- a/src/parsing/yaml_load.rs
+++ b/src/parsing/yaml_load.rs
@@ -18,7 +18,7 @@ pub enum ParseSyntaxError {
/// Some keys are required for something to be a valid `.sublime-syntax`
MissingMandatoryKey(&'static str),
/// Invalid regex
- RegexCompileError(String, Box<dyn Error>),
+ RegexCompileError(String, Box<dyn Error + Send>),
/// A scope that syntect's scope implementation can't handle
InvalidScope(ParseScopeError),
/// A reference to another file that is invalid or we have to work around this in I wanted to run
Interestingly, the
|
Ah dang. I'll try and do a point release with the I think the crash is due to something I forgot to put in the release notes and maybe should have better monitoring for in general but you need to re-generate your pack files for the new version. The format is the same so nothing immediately fails but the regexes get rewritten to be compatible with fancy-regex before being saved in the pack file, to reduce loading time. And yah seems plausible that sometimes fancy-regex will be much faster. |
That sounds great, but there is absolutely no hurry! 😄 I have opened a PR: trishume/syntect#285
Oh 🤦♂️. I thought about it shortly, but apparently came to the wrong conclusion 😄 |
The PR has been merged today. A new version of
This has been merged a while ago and we have made it possible to use it within |
closed via #1012. |
Released in bat v0.15.2. Feedback would be appreciated! |
Install worked for me via cargo install-update. Somehow it even worked yesterday (updating to 0.15.1 but #1012 had landed). |
cargo install bat
failing on Ubuntu 18.04 due to rust-onig/rust-onig#109 (bat version0.12.1
)The text was updated successfully, but these errors were encountered: