kornelski / cavif-rs

AVIF image creator in pure Rust
https://lib.rs/cavif
BSD 3-Clause "New" or "Revised" License
570 stars 27 forks source link

Error installing v1.3.1 #47

Closed unindented closed 2 years ago

unindented commented 2 years ago

I'm getting this error when running cargo install cavif:

   Compiling ravif v0.8.6
error[E0308]: mismatched types
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/ravif-0.8.6/src/av1encoder.rs:278:47
    |
278 |         speed_settings.fast_scene_detection = true;
    |                                               ^^^^ expected enum `SceneDetectionSpeed`, found `bool`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `ravif` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cavif v1.3.1`, intermediate artifacts can be found at `/tmp/cargo-installt89gNt`
kornelski commented 2 years ago

Try running cargo update? The latest version of ravif is 0.8.7.

unindented commented 2 years ago

Oops that was it. Sorry!

AndrewKvalheim commented 2 years ago

The incompatible version is still specified in the published lock file:

$ curl -s 'https://static.crates.io/crates/cavif/cavif-1.3.1.crate' | tar -xzO 'cavif-1.3.1/Cargo.lock' | grep -A1 'name = "ravif"'
name = "ravif"
version = "0.8.6"

Have you considered adding a lock file under version control? It should help with issues like #25, #45, #46, etc. and is generally recommended:

If you’re building an [...] command-line tool or an application [...], check Cargo.lock into git.

kornelski commented 2 years ago

Lock file under version control would not help. It could only make it worse by preventing upgrades. The default cargo behavior is to pick the latest version. so lock files only stop things from being upgraded.

The problematic lock file is in the published crate, so even upgraded lock file in source control would not help. Either way it needs a new release.