Bat: Unable to run `cargo install bat`

Created on 4 May 2018  路  4Comments  路  Source: sharkdp/bat

Here is the log:

$ cargo install bat
^V    Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing bat v0.2.3
 Downloading backtrace v0.3.7
 Downloading rustc-demangle v0.1.8
 Downloading cfg-if v0.1.3
 Downloading cmake v0.1.31
   Compiling unicode-normalization v0.1.6
   Compiling stable_deref_trait v1.0.0
   Compiling serde v1.0.45
   Compiling dtoa v0.4.2
   Compiling regex-syntax v0.4.2
   Compiling bitflags v0.9.1
   Compiling void v1.0.2
   Compiling cfg-if v0.1.3
   Compiling matches v0.1.6
   Compiling bitflags v1.0.3
   Compiling safemem v0.2.0
   Compiling regex v0.2.11
   Compiling winapi v0.3.4
   Compiling lazy_static v0.2.11
   Compiling plist v0.2.4
   Compiling byteorder v1.2.2
   Compiling lazy_static v1.0.0
   Compiling pkg-config v0.3.11
   Compiling same-file v1.0.2
   Compiling percent-encoding v1.0.1
   Compiling utf8-ranges v1.0.0
   Compiling ansi_term v0.9.0
   Compiling linked-hash-map v0.5.1
   Compiling unicode-xid v0.1.0
   Compiling num-traits v0.2.2
   Compiling unicode-width v0.1.4
   Compiling fnv v1.0.6
   Compiling cc v1.0.15
   Compiling ansi_term v0.11.0
   Compiling strsim v0.7.0
   Compiling rustc-demangle v0.1.8
   Compiling ucd-util v0.1.1
   Compiling itoa v0.4.1
   Compiling smallvec v0.6.1
   Compiling libc v0.2.40
   Compiling owning_ref v0.3.3
   Compiling unreachable v1.0.0
   Compiling unicode-bidi v0.3.4
   Compiling xml-rs v0.7.0
   Compiling base64 v0.8.0
   Compiling bincode v1.0.0
   Compiling walkdir v2.1.4
   Compiling yaml-rust v0.4.0
   Compiling proc-macro2 v0.3.8
   Compiling num-integer v0.1.36
   Compiling regex-syntax v0.5.6
   Compiling serde_json v1.0.17
   Compiling thread_local v0.3.5
   Compiling term_size v0.3.1
   Compiling clicolors-control v0.2.0
   Compiling rand v0.4.2
   Compiling time v0.1.39
   Compiling atty v0.2.10
   Compiling termios v0.2.2
   Compiling memchr v2.0.1
   Compiling libz-sys v1.0.18
   Compiling backtrace-sys v0.1.16
   Compiling cmake v0.1.31
   Compiling miniz-sys v0.1.10
   Compiling quote v0.5.2
   Compiling textwrap v0.9.0
   Compiling parking_lot_core v0.2.14
   Compiling chrono v0.4.2
error[E0432]: unresolved import `std::sync::atomic::spin_loop_hint`
  --> .cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.2.14/src/spinwait.rs:14:5
   |
14 | use std::sync::atomic::spin_loop_hint;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `spin_loop_hint` in `sync::atomic`

error: aborting due to previous error

error: Could not compile `parking_lot_core`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `bat v0.2.3`, intermediate artifacts can be found at `/tmp/cargo-install.rCS7oWKs408U`

Caused by:
  build failed

Screenshot here:

image

Here is my Ubuntu Linux version info:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

My Ubuntu is run under Bash on Ubuntu on Windows in my Windows 10 ver 1803 (OS Build 17134.1).

Most helpful comment

@sharkdp Installing zlib1g-dev package solved my problem.

sudo apt-get install zlib1g-dev

All 4 comments

Please make sure that you have Rust 1.24 or higher (https://github.com/sharkdp/bat#from-source).

@sharkdp After upgrade rustc to 1.25.0. I got a new error message:

image

@sharkdp Installing zlib1g-dev package solved my problem.

sudo apt-get install zlib1g-dev

Updating rust was enough in my archlinux system.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sharkdp picture sharkdp  路  3Comments

mjlbach picture mjlbach  路  3Comments

niedzielski picture niedzielski  路  3Comments

gAmUssA picture gAmUssA  路  3Comments

samuelcolvin picture samuelcolvin  路  3Comments