memorysafety/rav1d

rav1d fails to build on riscv64

Closed this issue · 3 comments

I tried to build rav1d on riscv64 and get the following error:

$ RUST_BACKTRACE=1 cargo build --release
   Compiling rav1d v0.2.0 (/home/negge/git/rav1d)
error: failed to run custom build command for `rav1d v0.2.0 (/home/negge/git/rav1d)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/home/negge/git/rav1d/target/release/build/rav1d-4ee5d6604c8bf2f3/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at build.rs:69:61:
  called `Result::unwrap()` on an `Err` value: NotPresent
  stack backtrace:
     0: rust_begin_unwind
     1: core::panicking::panic_fmt
     2: core::result::unwrap_failed
     3: core::result::Result<T,E>::unwrap
     4: build_script_build::asm::main
     5: build_script_build::main
     6: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This is using the rust on Gentoo rustc 1.73.0 (cc66ad468 2023-10-03) (gentoo)

Hi, we're still focusing on making rav1d safer and have been focusing on x86 and arm on Linux and macOS. Those are also the only architectures we transpiled for initially and that have significant asm support. That said, other architectures should probably work with the Rust fallbacks for asm. The way the features are set up currently, though, makes this not the default. The default features are asm, bitdepth_8, and bitdepth_16. Asm as a default makes sense where it's supported, but I didn't want to not have an asm fallback when the asm feature is enabled. Thus, on other architectures, compiling with --no-default-features --features bitdepth_8,bitdepth_16 should work hopefully. Let me know if that works. Once we get closer to finishing things, we'll make sure the features are set up better.

Thanks @kkysen, that did get me farther in the build process. If this is required on other architectures than the ones you listed, shouldn't that be the default when building? I'm not sure why this issue was closed if there is still work needed to get compiling on riscv64.

As I said,

Once we get closer to finishing things, we'll make sure the features are set up better.

It's not a priority at the moment, though. We're focused on making rav1d as safe as possible. I can open an issue for fixing the default features so default builds always work, but I closed this one since I assumed it would build correctly with the right features. If it still doesn't, I can reopen it. But I want to separate fixing the features into another issue.