bat: cargo install failing due to a compilation problem of onig_sys crate
cargo install bat failing on Ubuntu 18.04 due to https://github.com/rust-onig/rust-onig/issues/109 (bat version 0.12.1)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Update README and CHANGELOG, see #650 — committed to sharkdp/bat by sharkdp 4 years ago
apt-get install libclang-devmade it build for me on Debian 10.1 aarch64i’m reaally surprised, that a cli tool to view files has a hard dependency on libclang, though
This can be resolved once https://github.com/rust-onig/rust-onig/pull/126 is merged. This would also remove the need for
libclangto be installed at build time.Another option would be that https://github.com/trishume/syntect/pull/270 gets merged, in which case
onigwould not be a dependency anymore.The PR has been merged today. A new version of
onighas been released. We are now waiting for this to be included in syntect: https://github.com/trishume/syntect/pull/293 (thanks to @Keats).This has been merged a while ago and we have made it possible to use it within
bat, but usingfancy-regexis currently not (yet) an option, as it can not handle all regex features in the custom syntaxes included inbat, see https://github.com/trishume/syntect/issues/287Ah dang. I’ll try and do a point release with the
Sendfix this evening.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.
regexis a really good regex engine, just in the Javascript and Rust benchmarks I use it’s slower.The
fancy-regexmode was just merged and released as v4.0.0! You may want to try using it to fix this issue, although it does halve performance so you may only want to use it on platforms where it’s needed.Still hoping that onig’s build will eventually improve but for now
fancy-regexis a good option.That’s a build-time-only dependency which (although maybe not optimal) is certainly not too surprising.
bathas some C-code dependencies and libclang can be used to automatically generate C-to-Rust bindings.If you want, you can actually get zero-dependency versions of
bat(statically linkedmuslbuilds on the Release page), so I don’t think there is any reason to complain about runtime dependencies.