image icon indicating copy to clipboard operation
image copied to clipboard

Build Failed (build command for rav1e v0.5.0 alpha)

Open johannesvollmer opened this issue 4 years ago • 5 comments

This happens when I try to run the tests via cargo test --all-features. It does not happen with all features disabled. The error message is error: failed to run custom build command for 'rav1e v0.5.0-alpha', the cause being This version of NASM is too old. I'm running a Windows 10 system and previous version of the image crate compiled without problems.

Here is the full error log:

   Compiling flume v0.10.7
error: failed to run custom build command for `rav1e v0.5.0-alpha`
Caused by:
  process didn't exit successfully: `[...]\image\target\debug\build\rav1e-03805f2a36c4809b\build-script-build` (exit code: 101)
  --- stdout
  cargo:rustc-cfg=nasm_x86_64
  --- stderr
  thread 'main' panicked at 'This version of NASM is too old: The system cannot find the file specified. (os error 2)', [...]\.cargo\registry\src\github.com-1ecc6299db9ec823\rav1e-0.5.0-alpha\build.rs:255:7
  stack backtrace:
     0: std::panicking::begin_panic_handler
               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b\/library\std\src\panicking.rs:493
     1: std::panicking::begin_panic_fmt
               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b\/library\std\src\panicking.rs:435
     2: build_script_build::nasm_version_check
               at .\build.rs:255
     3: build_script_build::main
               at .\build.rs:282
     4: core::ops::function::FnOnce::call_once<fn(),tuple<>>
               at C:\Users\Johannes\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
Process finished with exit code 101

johannesvollmer avatar Jul 26 '21 11:07 johannesvollmer

This is due to the new feature for AV1 support, which requires nasm to be installed and be recent, specifically 2.14 I think. The specific features that require it are: avif and avif-encoder. I'm not sure about whether avif-decoder is affected.

197g avatar Jul 31 '21 13:07 197g

Interesting. Will it be possible to automatically install that version, maybe with a build script? As a windows user I'm not sure how to install that

johannesvollmer avatar Jul 31 '21 21:07 johannesvollmer

Will it be possible to automatically install that version, maybe with a build script?

No, that's very definitely something that does not belong in a build script let alone image's. Maybe rav1e can refer more clearly to their epxlanation of the process which they write up here: https://github.com/xiph/rav1e/#dependency-nasm.

197g avatar Aug 01 '21 00:08 197g

I see. To be honest, I hoped that this would not be the kind of problems I have to deal with when using Rust.

The rav docs say that the dependency is only required for a few optimizations. Do you think it would be possible to have a feature flag to avoid having to install this dependency, even if I want to run the avif tests? Looks like rav itself supports this: https://github.com/xiph/rav1e/blob/f6c841fe9234e9e08a801e884bec1d91a3c6f9f4/Cargo.toml#L38

johannesvollmer avatar Aug 01 '21 09:08 johannesvollmer

Also, I would expect the Readme to mention all dependencies that need to be installed manually

johannesvollmer avatar Aug 01 '21 09:08 johannesvollmer