rust-av / avp

Another Video Player
MIT License
49 stars 9 forks source link

clang version clash #7

Closed dhbradshaw closed 4 years ago

dhbradshaw commented 5 years ago

If I naively clone and then use cargo build I'm blocked by this:

package `clang-sys v0.22.0`
    ... which is depended on by `bindgen v0.37.0`
    ... which is depended on by `opus-sys v0.1.0 (https://github.com/rust-av/opus-rs#c7329ada)`
    ... which is depended on by `libopus v0.1.0 (https://github.com/rust-av/opus-rs#c7329ada)`
    ... which is depended on by `avp v0.1.0 `
links to native library `clang`

package `clang-sys v0.26.4`
    ... which is depended on by `bindgen v0.45.0`
    ... which is depended on by `vpx-sys v0.1.0 (https://github.com/rust-av/vpx-rs#7d2c86b4)`
    ... which is depended on by `libvpx v0.1.0 (https://github.com/rust-av/vpx-rs#7d2c86b4)`
    ... which is depended on by `avp v0.1.0 `
also links to native library `clang`
lu-zero commented 5 years ago

Updated now, please cargo update and confirm it is working for you :)

dhbradshaw commented 5 years ago

It worked!

Which uncovers the next bump:

error: failed to run custom build command for `opus-sys v0.1.0 (https://github.com/rust-av/opus-rs#aa96807d)`
process didn't exit successfully: `/avp/target/release/build/opus-sys-bec8a55aeea6441f/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(PkgConfig(Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"opus >= 1.1\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package opus was not found in the pkg-config search path.\nPerhaps you should add the directory containing `opus.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'opus\' found\n" } }), State { next_error: None })', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `vpx-sys v0.1.0 (https://github.com/rust-av/vpx-rs#a048d19b)`
process didn't exit successfully: `/avp/target/release/build/vpx-sys-98347ae497d11a50/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(PkgConfig(Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"vpx >= 1.5.0\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package vpx was not found in the pkg-config search path.\nPerhaps you should add the directory containing `vpx.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'vpx\' found\n" } }), State { next_error: None })', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
lu-zero commented 5 years ago

you need to make sure you have libvpx installed. It isn't finding the pkg-config file for it.

dhbradshaw commented 5 years ago

Hmm, apt thinks that I already had libvpx5 installed (ubuntu 18.04). Do I need to switch to a different version or figure out how to point it to the installation or something?

lu-zero commented 5 years ago

Check if you have installed the devel package, the pkg-config file seems missing.

dhbradshaw commented 5 years ago

Ok,

error: failed to run custom build command for `vpx-sys v0.1.0 (https://github.com/rust-av/vpx-rs#a048d19b)`
process didn't exit successfully: `avp/target/debug/build/vpx-sys-a664b29c38b73e75/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=native=/usr/lib
cargo:rustc-link-lib=vpx
cargo:rustc-link-lib=m

--- stderr
/usr/include/vpx/./vpx_integer.h:15:10: fatal error: 'stddef.h' file not found
/usr/include/vpx/./vpx_integer.h:15:10: fatal error: 'stddef.h' file not found, err: true
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
lu-zero commented 5 years ago

You are missing some fundamental libc headers apparently, try installing clang itself, I recall this somehow solved the problem to somebody with a similar distribution.

dhbradshaw commented 5 years ago

Does it matter what version? Autocomplete gives quite an array of options:

libclang1                libclang1-5.0-dbg        libclang-5.0-dev         libclang-common-6.0-dev
libclang1-3.9            libclang1-6.0            libclang-6.0-dev         libclang-common-7-dev
libclang1-3.9-dbg        libclang1-6.0-dbg        libclang-7-dev           libclang-dev
libclang1-4.0            libclang1-7              libclang-common-3.9-dev  libclang-perl
libclang1-4.0-dbg        libclang-3.9-dev         libclang-common-4.0-dev  
libclang1-5.0            libclang-4.0-dev         libclang-common-5.0-dev 

Edit: I'll look through llvm documentation and write what I find.

lu-zero commented 5 years ago

find / -name stddef.h should get you a stddef.h in a clang-related library.

dhbradshaw commented 5 years ago

taking the suggestion to install clang at face value and following the instructions for 18.04 led me to simply doing

sudo apt update
sudo apt install clang

This got me past the remaining clang errors.

Which brought me to this:

error[E0432]: unresolved import `ffi::OPUS_FRAMESIZE_80_MS`
  --> /home/doug/.cargo/git/checkouts/opus-rs-377ca7da91dbf68d/aa96807/src/encoder.rs:42:13
   |
42 |     pub use ffi::OPUS_FRAMESIZE_80_MS;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^ no `OPUS_FRAMESIZE_80_MS` in the root. Did you mean to use `OPUS_FRAMESIZE_20_MS`?

error[E0432]: unresolved import `ffi::OPUS_FRAMESIZE_100_MS`
  --> /home/doug/.cargo/git/checkouts/opus-rs-377ca7da91dbf68d/aa96807/src/encoder.rs:43:13
   |
43 |     pub use ffi::OPUS_FRAMESIZE_100_MS;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `OPUS_FRAMESIZE_100_MS` in the root. Did you mean to use `OPUS_FRAMESIZE_10_MS`?

error[E0432]: unresolved import `ffi::OPUS_FRAMESIZE_120_MS`
  --> /home/doug/.cargo/git/checkouts/opus-rs-377ca7da91dbf68d/aa96807/src/encoder.rs:44:13
   |
44 |     pub use ffi::OPUS_FRAMESIZE_120_MS;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `OPUS_FRAMESIZE_120_MS` in the root. Did you mean to use `OPUS_FRAMESIZE_20_MS`?

error[E0554]: #![feature] may not be used on the stable release channel
 --> /home/doug/.cargo/git/checkouts/vpx-rs-ab48b307657c386f/a048d19/vpx-sys/src/lib.rs:1:1
  |
1 | #![feature(untagged_unions)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `libopus`.
lu-zero commented 5 years ago

use a nightly rust

dhbradshaw commented 5 years ago

Using nightly eliminates the feature error, but still leads to import errors:

rustup override set nightly
cargo build

-->

   many successfully compiled modules, followed by
   Compiling av-data v0.1.0 (https://github.com/rust-av/rust-av#bf0b68c7)
   Compiling av-bitstream v0.1.0 (https://github.com/rust-av/rust-av#bf0b68c7)
   Compiling av-codec v0.1.0 (https://github.com/rust-av/rust-av#bf0b68c7)
   Compiling av-format v0.1.0 (https://github.com/rust-av/rust-av#bf0b68c7)
   Compiling av-vorbis v0.1.0 (https://github.com/rust-av/av-vorbis#40c913a2)
   Compiling matroska v0.1.0 (https://github.com/rust-av/matroska#47759f82)
   Compiling vpx-sys v0.1.0 (https://github.com/rust-av/vpx-rs#a048d19b)
   Compiling opus-sys v0.1.0 (https://github.com/rust-av/opus-rs#aa96807d)
   Compiling libopus v0.1.0 (https://github.com/rust-av/opus-rs#aa96807d)
error[E0432]: unresolved import `ffi::OPUS_FRAMESIZE_80_MS`
  --> /home/doug/.cargo/git/checkouts/opus-rs-377ca7da91dbf68d/aa96807/src/encoder.rs:42:13
   |
42 |     pub use ffi::OPUS_FRAMESIZE_80_MS;
   |             ^^^^^--------------------
   |             |    |
   |             |    help: a similar name exists in the module: `OPUS_FRAMESIZE_10_MS`
   |             no `OPUS_FRAMESIZE_80_MS` in the root

error[E0432]: unresolved import `ffi::OPUS_FRAMESIZE_100_MS`
  --> /home/doug/.cargo/git/checkouts/opus-rs-377ca7da91dbf68d/aa96807/src/encoder.rs:43:13
   |
43 |     pub use ffi::OPUS_FRAMESIZE_100_MS;
   |             ^^^^^---------------------
   |             |    |
   |             |    help: a similar name exists in the module: `OPUS_FRAMESIZE_10_MS`
   |             no `OPUS_FRAMESIZE_100_MS` in the root

error[E0432]: unresolved import `ffi::OPUS_FRAMESIZE_120_MS`
  --> /home/doug/.cargo/git/checkouts/opus-rs-377ca7da91dbf68d/aa96807/src/encoder.rs:44:13
   |
44 |     pub use ffi::OPUS_FRAMESIZE_120_MS;
   |             ^^^^^---------------------
   |             |    |
   |             |    help: a similar name exists in the module: `OPUS_FRAMESIZE_10_MS`
   |             no `OPUS_FRAMESIZE_120_MS` in the root

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `libopus`.
warning: build failed, waiting for other jobs to finish...
error: build failed
lu-zero commented 5 years ago

Looks like the minimal opus version is wrong.

lu-zero commented 4 years ago

It shouldn't be a problem anymore, I hope.