sunchao / parquet-rs

Apache Parquet implementation in Rust
Apache License 2.0
149 stars 20 forks source link

Failed to install parquet using "cargo install" #160

Closed sadikovi closed 5 years ago

sadikovi commented 6 years ago

Rust version: rustc 1.30.0-nightly (551244f05 2018-09-10) Parquet version: 0.3 (the latest is released on crates.io) It was working okay in 1.28. I am not sure why it needs to compile files that are used for testing only.

When I run cargo install parquet, I get the following error:

$ cargo install --force parquet
    Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing parquet v0.3.0                                                                                                                                                   
 Downloading lz4-sys v1.8.2
   Compiling serde v1.0.78                                                                                                                                                    
   Compiling byteorder v1.2.6
   Compiling unicode-width v0.1.5
   Compiling libc v0.2.43
   Compiling num-traits v0.2.5
   Compiling gcc v0.3.54
   Compiling glob v0.2.11
   Compiling remove_dir_all v0.5.1
   Compiling bitflags v0.5.0
   Compiling version_check v0.1.4
   Compiling cfg-if v0.1.5
   Compiling cc v1.0.24
   Compiling void v1.0.2
   Compiling num-integer v0.1.39
   Compiling byteorder v0.5.3
   Compiling integer-encoding v1.0.5
   Compiling alloc-no-stdlib v1.3.0
   Compiling try_from v0.2.2
   Compiling rustc-serialize v0.3.24
   Compiling x86intrin v0.4.5
   Compiling quick-error v1.2.2
   Compiling getopts v0.2.18
   Compiling log v0.4.5
   Compiling base64 v0.5.2
   Compiling rand v0.4.3
   Compiling num_cpus v1.8.0
   Compiling time v0.1.40
   Compiling lazy_static v1.1.0
   Compiling unreachable v1.0.0
   Compiling brotli-decompressor v1.3.1
   Compiling log v0.3.9
   Compiling pulldown-cmark v0.0.8
   Compiling threadpool v1.7.1
   Compiling tempdir v0.3.7
   Compiling lz4-sys v1.8.2
   Compiling miniz-sys v0.1.10
   Compiling num-traits v0.1.43
   Compiling thrift v0.0.4
   Compiling snap v0.2.5
   Compiling ordered-float v0.5.1
   Compiling brotli v2.5.0
   Compiling chrono v0.4.6
   Compiling num-bigint v0.1.44
   Compiling skeptic v0.9.0
   Compiling flate2 v0.2.20
   Compiling parquet-format v2.4.0
   Compiling lz4 v1.22.0
   Compiling blob v0.2.0
   Compiling zstd-sys v1.4.4+zstd.1.3.5
   Compiling zstd-safe v1.4.4+zstd.1.3.5
   Compiling zstd v0.4.19+zstd.1.3.5
   Compiling parquet v0.3.0
error[E0277]: the trait bound `rand::distributions::Standard: rand::distributions::Distribution<<T as data_type::DataType>::T>` is not satisfied
  --> /Users/sadikovi/.cargo/registry/src/github.com-1ecc6299db9ec823/parquet-0.3.0/src/util/test_common.rs:42:9
   |
42 |     rng.gen::<T::T>()
   |         ^^^ the trait `rand::distributions::Distribution<<T as data_type::DataType>::T>` is not implemented for `rand::distributions::Standard`
   |
   = help: consider adding a `where rand::distributions::Standard: rand::distributions::Distribution<<T as data_type::DataType>::T>` bound

error[E0277]: the trait bound `rand::distributions::Standard: rand::distributions::Distribution<T>` is not satisfied
  --> /Users/sadikovi/.cargo/registry/src/github.com-1ecc6299db9ec823/parquet-0.3.0/src/util/test_common.rs:82:21
   |
82 |     result.push(rng.gen::<T>());
   |                     ^^^ the trait `rand::distributions::Distribution<T>` is not implemented for `rand::distributions::Standard`
   |
   = help: consider adding a `where rand::distributions::Standard: rand::distributions::Distribution<T>` bound

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
error: failed to compile `parquet v0.3.0`, intermediate artifacts can be found at `/var/folders/_s/lqppl_bx7gs__gtw7_r49tkw0000gp/T/cargo-installbzdKdr`

Caused by:
  Could not compile `parquet`.
sadikovi commented 5 years ago

Still happens with rustc 1.30.0-nightly (90d36fb59 2018-09-13); I will have a look later today.

sadikovi commented 5 years ago

Yes, parquet 0.3 uses rand 0.4.3 dependency that contains major changes that break the compilation. We patched this in our main repo, that is why cargo install --git https://github.com/sunchao/parquet-rs.git works (I actually tested on my fork). The fix is releasing a new version on crates.io.

@sunchao Are there any major blockers for releasing parquet 0.4? Or any features you would like to see in that version? Thanks!

sadikovi commented 5 years ago

One of the solutions here could be using ~X.Y.Z versions in Cargo.toml, instead of X.Y, this would give confidence that no significant changes would affect other libraries or cargo install.

sunchao commented 5 years ago

Thanks @sadikovi !

Yes, parquet 0.3 uses rand 0.4.3 dependency that contains major changes that break the compilation.

Hmm.. how do you know that rand 0.4.3 has backward incompatible changes? I checked their changelog and there's only one fix in that release.

@sunchao Are there any major blockers for releasing parquet 0.4? Or any features you would like to see in that version? Thanks!

Personally I think writer support is the main features for the 0.4 release. I also think we should address some of the performance issue raised recently. Do you have any timeline in mind?

One of the solutions here could be using ~X.Y.Z versions in Cargo.toml, instead of X.Y, this would give confidence that no significant changes would affect other libraries or cargo install.

Yes this can solve this issue. But IMO minor releases should guarantee backward compatibility. Otherwise it will affect lots of downstream clients.

sadikovi commented 5 years ago

I do not know, really. I just tried installing parquet 0.3 on my machine and got the above error message. I think it is because Rust 1.30 now compiles test fails and they could have been failing in parquet 0.3. Anyway, it will be resolved once we release 0.4.

I don't have any blockers in mind. I was thinking if we could release 0.4 and address performance issues in 0.5.

sunchao commented 5 years ago

Sounds good. Releasing 0.4 without the perf issue sounds fine to me as well.