Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile with Debian buster #2482

Closed
adityapatadia opened this issue Aug 6, 2020 · 16 comments · Fixed by medek/nasm-rs#34
Closed

Can't compile with Debian buster #2482

adityapatadia opened this issue Aug 6, 2020 · 16 comments · Fixed by medek/nasm-rs#34
Assignees
Labels

Comments

@adityapatadia
Copy link

When compiling with Debain buster, following compilation error comes:

Compiling rav1e v0.3.1 (/build/libheif-c159795676b3123d80ee8ba30bb8cf29b739cf48/rav1e)
error: failed to run custom build command for `rav1e v0.3.1 (/build/libheif-c159795676b3123d80ee8ba30bb8cf29b739cf48/rav1e)`
Caused by:
  process didn't exit successfully: `/build/libheif-c159795676b3123d80ee8ba30bb8cf29b739cf48/rav1e/target/release/build/rav1e-725c860099e73392/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-cfg=nasm_x86_64
--- stderr
thread 'main' panicked at 'Invalid version component: ParseIntError { kind: InvalidDigit }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/nasm-rs-0.1.8/src/lib.rs:325:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It seems there is some issue with NASM. Buster comes with 2.14 version.

@barrbrain
Copy link
Collaborator

What is the precise output of nasm -v for this binary? This may help analysing the issue. Also, try running with the RUST_BACKTRACE=1 environment variable to display a backtrace, as the error appears to be raised in the nasm-rs crate.

@adityapatadia
Copy link
Author

What is the precise output of nasm -v for this binary?

NASM version 2.14

@shssoichiro
Copy link
Collaborator

It looks like when this patch was ported from rav1e's fork of nasm-rs to the upstream nasm-rs, the code to handle two-part version strings was not copied.

Working: https://github.com/xiph/rav1e/pull/2223/files#diff-a7b0a2dee0126cddf994326e705a91eaR152
Not working: https://github.com/medek/nasm-rs/pull/28/files#diff-b4aea3e418ccdb71239b96952d9cddb6R316

@shssoichiro shssoichiro added the bug label Aug 6, 2020
@shssoichiro shssoichiro self-assigned this Aug 6, 2020
@barrbrain
Copy link
Collaborator

The error is raised at nasm-rs-0.1.8/src/lib.rs:325:30. I managed to reproduce the error with that snippet and the input I expect it is receiving: Rust Playground example. It appears the issue is that the code is splitting on spaces but there is a trailing newline that ends up included in the numeric parsing. Once this is resolved, we will trip the if ver.len() < 3 { panic!("Not enough version components"); } error.

shssoichiro added a commit to shssoichiro/nasm-rs that referenced this issue Aug 6, 2020
nasm version parsing was failing on version strings
with only 2 parts, which is common for nasm releases.

Fixes xiph/rav1e#2482

Also avoids panics/unwraps/expects where reasonable
in favor of bubbling them up as `Err`s.
Libraries should avoid panicking when possible,
and allow the caller to handle the errors.
This requires a breaking change in function signatures
to return `Result`s.
@lu-zero
Copy link
Collaborator

lu-zero commented Aug 6, 2020

I opened medek/nasm-rs#31, another solution got opened in medek/nasm-rs#33

@adityapatadia
Copy link
Author

Anyone from nasm-rs looking into this? This is a blocker for using rav1e.

@lu-zero
Copy link
Collaborator

lu-zero commented Aug 15, 2020

You may also open an issue on Debian since they are the one customizing the version string apparently.

@adityapatadia
Copy link
Author

adityapatadia commented Aug 15, 2020 via email

@lu-zero
Copy link
Collaborator

lu-zero commented Aug 15, 2020

For the same reason, the recipe is the same. Build your own and it will work.

@adityapatadia
Copy link
Author

You mean build my own NASM?

@lu-zero
Copy link
Collaborator

lu-zero commented Aug 15, 2020

Yes.

@adityapatadia
Copy link
Author

Okay, trying right away...

@adityapatadia
Copy link
Author

Building NASM from source fixed it. Btw, new version of nasm-rs is released which can fix the issue.

@adityapatadia
Copy link
Author

This is fixed in 0.3.4.

@fti-ravhad
Copy link

fti-ravhad commented Mar 6, 2024

I am getting the same error @adityapatadia
what be the solution for this?
warning: rav1e@0.6.6: nonzero exit status: signal: 11 (SIGSEGV) (core dumped)

error: failed to run custom build command for rav1e v0.6.6

Caused by:
process didn't exit successfully: /mnt/gstreamer.build/subprojects/gst-plugins-rs/target/release/build/rav1e-e374b1ec24e18d62/build-script-build (exit status: 101)
--- stdout
cargo:rustc-cfg=nasm_x86_64
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/cdef16_sse.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/cdef16_sse.o"
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/cdef_avx2.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/cdef_avx2.o"
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/cdef_avx512.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/cdef_avx512.o"
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/looprestoration_avx2.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/looprestoration_avx2.o"
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/cdef16_avx2.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/cdef16_avx2.o"
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/cdef_dist.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/cdef_dist.o"
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/ipred_sse.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/ipred_sse.o"
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/cdef_rav1e.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/cdef_rav1e.o"
running: "nasm" "-felf64" "-gdwarf" "-I/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64-unknown-linux-gnu/release/build/rav1e-36cdadcd2ae46afb/out/" "-Isrc/" "/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.6.6/src/x86/cdef_sse.asm" "-o" "/mnt/gstreamer.build/subprojects/gst-plugins-rs/target/x86_64

@lu-zero
Copy link
Collaborator

lu-zero commented Mar 6, 2024

your nasm seems broken. try updating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants