BurntSushi / xsv

A fast CSV command line toolkit written in Rust.
The Unlicense
10.34k stars 320 forks source link

bash: xsv: command not found... in CentOS 7 #268

Open monacv opened 3 years ago

monacv commented 3 years ago
(phosa) [jalal@goku scratch3]$ git clone git://github.com/BurntSushi/xsv
Cloning into 'xsv'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 2706 (delta 3), reused 17 (delta 3), pack-reused 2683
Receiving objects: 100% (2706/2706), 568.35 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1962/1962), done.
(phosa) [jalal@goku scratch3]$ cd xsv
(phosa) [jalal@goku xsv]$ cargo build --release
  Downloaded filetime v0.1.15
  Downloaded rand v0.5.5
  Downloaded crossbeam-channel v0.2.4
  Downloaded csv-index v0.1.5
  Downloaded serde_derive v1.0.75
  Downloaded streaming-stats v0.2.0
  Downloaded tabwriter v1.1.0
  Downloaded threadpool v1.7.1
  Downloaded byteorder v1.2.4
  Downloaded num_cpus v1.8.0
  Downloaded regex v1.0.3
  Downloaded docopt v1.0.1
  Downloaded csv v1.0.1
  Downloaded crossbeam-epoch v0.5.2
  Downloaded parking_lot v0.6.3
  Downloaded smallvec v0.6.5
  Downloaded quote v0.6.8
  Downloaded rand_core v0.2.1
  Downloaded libc v0.2.43
  Downloaded crossbeam-utils v0.5.0
  Downloaded num-traits v0.2.5
  Downloaded syn v0.14.9
  Downloaded proc-macro2 v0.4.13
  Downloaded unreachable v1.0.0
  Downloaded lazy_static v1.1.0
  Downloaded lock_api v0.1.3
  Downloaded parking_lot_core v0.2.14
  Downloaded regex-syntax v0.6.2
  Downloaded memchr v2.0.1
  Downloaded memoffset v0.2.1
  Downloaded arrayvec v0.4.7
  Downloaded csv-core v0.1.4
  Downloaded aho-corasick v0.6.6
  Downloaded utf8-ranges v1.0.0
  Downloaded scopeguard v0.3.3
  Downloaded owning_ref v0.3.3
  Downloaded void v1.0.2
  Downloaded rand v0.4.3
  Downloaded ucd-util v0.1.1
  Downloaded nodrop v0.1.12
  Downloaded version_check v0.1.4
  Downloaded stable_deref_trait v1.1.1
  Downloaded cfg-if v0.1.5
  Downloaded serde v1.0.75
   Compiling version_check v0.1.4
   Compiling proc-macro2 v0.4.13
   Compiling void v1.0.2
   Compiling unicode-xid v0.1.0
   Compiling libc v0.2.43
   Compiling stable_deref_trait v1.1.1
   Compiling serde v1.0.75
   Compiling nodrop v0.1.12
   Compiling ucd-util v0.1.1
   Compiling scopeguard v0.3.3
   Compiling num-traits v0.2.5
   Compiling regex v1.0.3
   Compiling utf8-ranges v1.0.0
   Compiling cfg-if v0.1.5
   Compiling rand_core v0.2.1
   Compiling memoffset v0.2.1
   Compiling crossbeam-utils v0.5.0
   Compiling unicode-width v0.1.5
   Compiling strsim v0.7.0
   Compiling byteorder v1.2.4
   Compiling owning_ref v0.3.3
   Compiling arrayvec v0.4.7
   Compiling unreachable v1.0.0
   Compiling regex-syntax v0.6.2
   Compiling rand v0.4.3
   Compiling memchr v2.0.1
   Compiling num_cpus v1.8.0
   Compiling rand v0.5.5
   Compiling filetime v0.1.15
   Compiling smallvec v0.6.5
   Compiling lazy_static v1.1.0
   Compiling tabwriter v1.1.0
   Compiling lock_api v0.1.3
   Compiling csv-core v0.1.4
   Compiling aho-corasick v0.6.6
   Compiling threadpool v1.7.1
   Compiling parking_lot_core v0.2.14
   Compiling parking_lot v0.6.3
   Compiling thread_local v0.3.6
   Compiling crossbeam-epoch v0.5.2
   Compiling crossbeam-channel v0.2.4
   Compiling streaming-stats v0.2.0
   Compiling quote v0.6.8
   Compiling syn v0.14.9
   Compiling csv v1.0.1
   Compiling serde_derive v1.0.75
   Compiling csv-index v0.1.5
   Compiling docopt v1.0.1
   Compiling xsv v0.13.0 (/scratch3/xsv)
    Finished release [optimized + debuginfo] target(s) in 8m 09s
(phosa) [jalal@goku scratch3]$ curl -LO https://burntsushi.net/stuff/worldcitiespop.csv
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  144M  100  144M    0     0  16.1M      0  0:00:08  0:00:08 --:--:-- 26.3M
(phosa) [jalal@goku scratch3]$ xsv headers worldcitiespop.csv
bash: xsv: command not found...
monacv commented 3 years ago

also

(phosa) [jalal@goku scratch3]$ cargo install xsv
    Updating crates.io index
  Downloaded xsv v0.13.0
  Downloaded 1 crates (57.4 KB) in 6.82s
  Installing xsv v0.13.0
  Downloaded threadpool v1.8.1
  Downloaded cfg-if v0.1.10
  Downloaded rand v0.4.6
  Downloaded csv-index v0.1.6
  Downloaded serde v1.0.125
  Downloaded chan v0.1.23
  Downloaded byteorder v1.4.3
  Downloaded csv v1.1.6
  Downloaded libc v0.2.92
  Downloaded tabwriter v1.2.1
  Downloaded regex v1.4.5
  Downloaded streaming-stats v0.2.3
  Downloaded num_cpus v1.13.0
  Downloaded bstr v0.2.15
  Downloaded itoa v0.4.7
  Downloaded ryu v1.0.5
  Downloaded regex-syntax v0.6.23
  Downloaded memchr v2.3.4
  Downloaded aho-corasick v0.7.15
  Downloaded csv-core v0.1.10
  Downloaded rand v0.3.23
  Downloaded unicode-width v0.1.8
  Downloaded lazy_static v1.4.0
  Downloaded regex-automata v0.1.9
  Downloaded num-traits v0.2.14
  Downloaded docopt v1.1.1
  Downloaded serde_derive v1.0.125
  Downloaded autocfg v1.0.1
  Downloaded strsim v0.10.0
  Downloaded proc-macro2 v1.0.24
  Downloaded syn v1.0.67
  Downloaded quote v1.0.9
  Downloaded unicode-xid v0.2.1
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.67
   Compiling serde_derive v1.0.125
   Compiling libc v0.2.92
   Compiling memchr v2.3.4
   Compiling serde v1.0.125
   Compiling autocfg v1.0.1
   Compiling ryu v1.0.5
   Compiling byteorder v1.4.3
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.23
   Compiling itoa v0.4.7
error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
  --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:74:5
   |
74 |     convert::TryInto, fmt::Debug, hash::Hash, ptr::copy_nonoverlapping, slice,
   |     ^^^^^^^^^^^^^^^^

   Compiling cfg-if v0.1.10
error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
    --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:1973:37
     |
1973 |         u16::from_be_bytes(buf[..2].try_into().unwrap())
     |                                     ^^^^^^^^

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
    --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:1978:37
     |
1978 |         u32::from_be_bytes(buf[..4].try_into().unwrap())
     |                                     ^^^^^^^^

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
    --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:1983:37
     |
1983 |         u64::from_be_bytes(buf[..8].try_into().unwrap())
     |                                     ^^^^^^^^

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
    --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:1988:39
     |
1988 |         u128::from_be_bytes(buf[..16].try_into().unwrap())
     |                                       ^^^^^^^^

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
    --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:2189:37
     |
2189 |         u16::from_le_bytes(buf[..2].try_into().unwrap())
     |                                     ^^^^^^^^

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
    --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:2194:37
     |
2194 |         u32::from_le_bytes(buf[..4].try_into().unwrap())
     |                                     ^^^^^^^^

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
    --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:2199:37
     |
2199 |         u64::from_le_bytes(buf[..8].try_into().unwrap())
     |                                     ^^^^^^^^

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
    --> /home/grad3/jalal/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.3/src/lib.rs:2204:39
     |
2204 |         u128::from_le_bytes(buf[..16].try_into().unwrap())
     |                                       ^^^^^^^^

error: aborting due to 9 previous errors

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `byteorder`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `xsv v0.13.0`, intermediate artifacts can be found at `/tmp/cargo-install1CnYLX`

Caused by:
  build failed
BurntSushi commented 3 years ago

When reporting compilation errors, please include the version of the compiler you're using.

Your first attempt worked. xsv just isn't in your PATH. Something like find ./ -name xsv would tell you where it is if you weren't sure. But it should be at ./target/release/xsv.

Your second attempt failed for two reasons. Firstly, cargo install does not use the lock file from the project by default, so it will try to use updated versions of all dependencies. Secondly, your compiler appears quite old and is thus not new enough to compile the updates to some of those dependencies. The only way to fix that at the moment is to update your compiler.

BurntSushi commented 3 years ago

Note also that I publish xsv binaries that you should be able to use directly: https://github.com/BurntSushi/xsv/releases

BurntSushi commented 3 years ago

Firstly, cargo install does not use the lock file from the project by default, so it will try to use updated versions of all dependencies.

Note that this is a long standing issue that has caused massive amounts of confusion and pain: https://github.com/rust-lang/cargo/issues/7169

You can force Cargo use the lock file that was published with the crate via the --locked flag, but lock files weren't included in published crates until a couple years ago. But the last xsv release was actually older than that, so the --locked flag won't work here unfortunately.