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

`cargo install cavif` fails due to inline `const` in `bitstream` crate #81

Closed lgarron closed 2 months ago

lgarron commented 2 months ago

This isn't an issue per se, since I can run the published release build. But I didn't see an issue, so I thought I'd file one.

This is on macOS Sonoma 14.5 using stable Rust 1.76.0.

> cargo install cavif
    Updating crates.io index
  Downloaded cavif v1.5.4
  Downloaded 1 crate (17.1 KB) in 0.17s
  Installing cavif v1.5.4
    Updating crates.io index
  Downloaded arg_enum_proc_macro v0.3.4
  Downloaded aligned-vec v0.5.0
  Downloaded av1-grain v0.2.3
  Downloaded new_debug_unreachable v1.0.6
  Downloaded foreign-types-shared v0.3.1
  Downloaded maybe-rayon v0.1.1
  Downloaded noop_proc_macro v0.3.0
  Downloaded loop9 v0.1.5
  Downloaded either v1.12.0
  Downloaded simd_helpers v0.1.0
  Downloaded rgb v0.8.37
  Downloaded num-integer v0.1.46
  Downloaded v_frame v0.3.8
  Downloaded thiserror v1.0.61
  Downloaded errno v0.3.9
  Downloaded thiserror-impl v1.0.61
  Downloaded imgref v1.10.1
  Downloaded cc v1.0.99
  Downloaded num-traits v0.2.19
  Downloaded lcms2-sys v4.0.5
  Downloaded load_image v3.1.4
  Downloaded num-bigint v0.4.5
  Downloaded jpeg-decoder v0.3.1
  Downloaded flate2 v1.0.30
  Downloaded rexif v0.7.3
  Downloaded profiling v1.0.15
  Downloaded rav1e v0.7.1
  Downloaded num-rational v0.4.2
  Downloaded num-iter v0.1.45
  Downloaded num-derive v0.4.2
  Downloaded num-complex v0.4.6
  Downloaded nasm-rs v0.2.5
  Downloaded miniz_oxide v0.7.3
  Downloaded lodepng v3.10.1
  Downloaded lcms2 v6.1.0
  Downloaded fallible_collections v0.4.9
  Downloaded crossbeam-utils v0.8.20
  Downloaded crc32fast v1.4.2
  Downloaded bitstream-io v2.4.0
  Downloaded anyhow v1.0.86
  Downloaded ravif v0.11.5
  Downloaded paste v1.0.15
  Downloaded built v0.7.3
  Downloaded avif-serialize v0.8.1
  Downloaded profiling-procmacros v1.0.15
  Downloaded num v0.4.3
  Downloaded foreign-types-macros v0.2.3
  Downloaded foreign-types v0.5.0
  Downloaded bytemuck v1.16.0
  Downloaded 49 crates (4.1 MB) in 0.42s (largest was `rav1e` at 1.5 MB)
   Compiling crossbeam-utils v0.8.20
   Compiling proc-macro2 v1.0.85
   Compiling unicode-ident v1.0.12
   Compiling autocfg v1.3.0
   Compiling rayon-core v1.12.1
   Compiling libc v0.2.155
   Compiling cfg-if v1.0.0
   Compiling once_cell v1.19.0
   Compiling either v1.12.0
   Compiling version_check v0.9.4
   Compiling pkg-config v0.3.30
   Compiling rustix v0.38.34
   Compiling anyhow v1.0.86
   Compiling num-traits v0.2.19
   Compiling ahash v0.8.11
   Compiling zerocopy v0.7.34
   Compiling dunce v1.0.4
   Compiling bytemuck v1.16.0
   Compiling aligned-vec v0.5.0
   Compiling minimal-lexical v0.2.1
   Compiling adler v1.0.2
   Compiling bitflags v2.5.0
   Compiling paste v1.0.15
   Compiling utf8parse v0.2.2
   Compiling arrayvec v0.7.4
   Compiling crossbeam-epoch v0.9.18
   Compiling crossbeam-deque v0.8.5
   Compiling num-integer v0.1.46
   Compiling quote v1.0.36
   Compiling jobserver v0.1.31
   Compiling syn v2.0.66
   Compiling num-bigint v0.4.5
   Compiling thiserror v1.0.61
   Compiling cc v1.0.99
   Compiling memchr v2.7.4
   Compiling built v0.7.3
   Compiling rayon v1.10.0
   Compiling errno v0.3.9
   Compiling nom v7.1.3
   Compiling num-iter v0.1.45
   Compiling hashbrown v0.13.2
   Compiling v_frame v0.3.8
   Compiling num-rational v0.4.2
   Compiling num-complex v0.4.6
   Compiling anstyle-parse v0.2.4
   Compiling lcms2-sys v4.0.5
   Compiling miniz_oxide v0.7.3
   Compiling rgb v0.8.37
   Compiling crc32fast v1.4.2
   Compiling log v0.4.21
   Compiling colorchoice v1.0.1
   Compiling foreign-types-shared v0.3.1
   Compiling anstyle v1.0.7
   Compiling anstyle-query v1.1.0
   Compiling is_terminal_polyfill v1.70.0
   Compiling imgref v1.10.1
   Compiling nasm-rs v0.2.5
   Compiling anstream v0.6.14
   Compiling flate2 v1.0.30
   Compiling num v0.4.3
   Compiling av1-grain v0.2.3
   Compiling rav1e v0.7.1
   Compiling fallible_collections v0.4.9
   Compiling terminal_size v0.3.0
   Compiling simd_helpers v0.1.0
   Compiling itertools v0.12.1
   Compiling maybe-rayon v0.1.1
   Compiling clap_lex v0.7.1
   Compiling new_debug_unreachable v1.0.6
   Compiling bitstream-io v2.4.0
   Compiling quick-error v2.0.1
error[E0658]: inline-const is experimental
   --> /Users/lgarron/.cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/bitstream-io-2.4.0/src/read.rs:615:9
    |
615 |         const {
    |         ^^^^^
    |
    = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information

error[E0658]: inline-const is experimental
   --> /Users/lgarron/.cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/bitstream-io-2.4.0/src/read.rs:700:9
    |
700 |         const {
    |         ^^^^^
    |
    = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information

error[E0658]: inline-const is experimental
   --> /Users/lgarron/.cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/bitstream-io-2.4.0/src/write.rs:698:9
    |
698 |         const {
    |         ^^^^^
    |
    = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information

error[E0658]: inline-const is experimental
   --> /Users/lgarron/.cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/bitstream-io-2.4.0/src/write.rs:775:9
    |
775 |         const {
    |         ^^^^^
    |
    = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information

error[E0658]: inline-const is experimental
   --> /Users/lgarron/.cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/bitstream-io-2.4.0/src/write.rs:921:9
    |
921 |         const {
    |         ^^^^^
    |
    = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information

error[E0658]: inline-const is experimental
   --> /Users/lgarron/.cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/bitstream-io-2.4.0/src/write.rs:956:9
    |
956 |         const {
    |         ^^^^^
    |
    = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information

   Compiling strsim v0.11.1
   Compiling noop_proc_macro v0.3.0
   Compiling lodepng v3.10.1
For more information about this error, try `rustc --explain E0658`.
error: could not compile `bitstream-io` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cavif v1.5.4`, intermediate artifacts can be found at `/tmp/cargo-installYaT8U8`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
kornelski commented 2 months ago

It looks like some dependency has very eagerly adopted Rust 1.79. So you need to update or try cargo install --locked

lgarron commented 2 months ago

It looks like some dependency has very eagerly adopted Rust 1.79. So you need to update or try cargo install --locked

That does work!

However, it prints:

warning: package `ahash v0.8.3` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked

I believe that version is unpublished due to a vuln: https://github.com/tkaitchuck/aHash/issues/163