master-of-zen / Av1an

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding
GNU General Public License v3.0
1.51k stars 155 forks source link

Compilation fails #590

Open 1over137 opened 2 years ago

1over137 commented 2 years ago

System: Gentoo Kernel: 5.13.4 Rust: 1.58.1 No other cargo packages installed afaik.

$ cargo install av1an

[...]
   Compiling av1an-core v0.3.1
error[E0599]: no method named `with_key` found for enum `Result` in the current scope
  --> /home/z/.cargo/registry/src/github.com-1ecc6299db9ec823/av1an-core-0.3.1/src/progress_bar.rs:34:6
   |
34 |     .with_key("fps", |state| match state.per_sec() {
   |      ^^^^^^^^ method not found in `Result<ProgressStyle, indicatif::style::TemplateError>`

error[E0599]: no method named `with_key` found for enum `Result` in the current scope
  --> /home/z/.cargo/registry/src/github.com-1ecc6299db9ec823/av1an-core-0.3.1/src/progress_bar.rs:49:6
   |
49 |     .with_key("fps", |state| match state.per_sec() {
   |      ^^^^^^^^ method not found in `Result<ProgressStyle, indicatif::style::TemplateError>`

error[E0308]: mismatched types
  --> /home/z/.cargo/registry/src/github.com-1ecc6299db9ec823/av1an-core-0.3.1/src/progress_bar.rs:69:25
   |
69 |   pb.enable_steady_tick(100);
   |                         ^^^ expected struct `std::time::Duration`, found integer

error[E0308]: mismatched types
   --> /home/z/.cargo/registry/src/github.com-1ecc6299db9ec823/av1an-core-0.3.1/src/progress_bar.rs:158:21
    |
158 |           .with_style(ProgressStyle::default_spinner().template(if cfg!(windows) {
    |  _____________________^
159 | |           "{prefix:.dim} {msg}"
160 | |         } else {
161 | |           "  {prefix:.dim} {msg}"
162 | |         }));
    | |__________^ expected struct `ProgressStyle`, found enum `Result`
    |
    = note: expected struct `ProgressStyle`
                 found enum `Result<ProgressStyle, indicatif::style::TemplateError>`

error[E0308]: mismatched types
   --> /home/z/.cargo/registry/src/github.com-1ecc6299db9ec823/av1an-core-0.3.1/src/progress_bar.rs:169:27
    |
169 |     pb.enable_steady_tick(100);
    |                           ^^^ expected struct `std::time::Duration`, found integer

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `av1an-core` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `av1an v0.3.1`, intermediate artifacts can be found at `/tmp/cargo-install1lo0W5`

Caused by:
  build failed
redzic commented 2 years ago

This issue is fixed in the latest master (and you seem to be installing the 0.3.1 release -- which does not contain the fix). However you will need Rust 1.59 to build anything at/after commit b0bb468 since inline assembly is now required to build av1an, starting at that commit.

1over137 commented 2 years ago

So the latest release is actually broken? How did it compile on other platforms then?

redzic commented 2 years ago

It's not broken per se -- the cause of this is that cargo (by default) automatically updates every dependency to the latest API compatible version, specified by semver. One of our dependencies, indicatif, just incremented their version after we released 0.3.1 in such a way that cargo updates to it when it should not (since it has API incompatible changes), i.e. it breaks semver. This is presumably because we use a pre-release version of indicatif for some features, and the authors of indicatif did not think of that edge case -- that someone would actually be using that on crates.io and it would break their builds when publishing a semver-breaking release. The "fix" is to just force cargo to use an exact version of indicatif. Before this new release of indicatif was published on crates.io, i.e. at the time of the actual 0.3.1 release of av1an, everything was working fine (it's not actually a platform specific compilation issue).