tazz4843/whisper-rs

Build failing on mac M1

koder-ua opened this issue · 1 comments

cargo run --example basic_use failing on on mac m1 (does not look like this errors is platform-dependent)


> cat .cargo/config.toml
[target.aarch64-apple-darwin]
rustflags = "-lc++ -l framework=Accelerate"


> rustup show
Default host: aarch64-apple-darwin
stable-aarch64-apple-darwin (default)
rustc 1.77.1 (7cf61ebde 2024-03-27)





> cargo run --example basic_use
   Compiling libc v0.2.153
   ....
   Compiling which v4.4.2
   Compiling whisper-rs-sys v0.8.1 (/Users/kdanylov/personal/whisper-rs/sys)
warning: whisper-rs-sys@0.8.1: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: whisper-rs-sys@0.8.1: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
   Compiling whisper-rs v0.11.0 (/Users/kdanylov/personal/whisper-rs)
warning: static `LOG_TRAMPOLINE_INSTALL` is never used
  --> src/lib.rs:16:8
   |
16 | static LOG_TRAMPOLINE_INSTALL: Once = Once::new();
   |        ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: `whisper-rs` (lib) generated 1 warning
error[E0061]: this function takes 2 arguments but 1 argument was supplied
  --> examples/basic_use.rs:43:10
   |
43 |         &whisper_rs::convert_integer_to_float_audio(&audio_data),
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------- an argument of type `&mut [f32]` is missing
   |
note: function defined here
  --> /Users/kdanylov/personal/whisper-rs/src/utilities.rs:19:8
   |
19 | pub fn convert_integer_to_float_audio(
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: provide the argument
   |
43 |         &whisper_rs::convert_integer_to_float_audio(&audio_data, /* &mut [f32] */),
   |                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
  --> examples/basic_use.rs:43:9
   |
42 |     let audio_data = whisper_rs::convert_stereo_to_mono_audio(
   |                      ---------------------------------------- arguments to this function are incorrect
43 |         &whisper_rs::convert_integer_to_float_audio(&audio_data),
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[f32]`, found `&Result<(), WhisperError>`
   |
   = note: expected reference `&[f32]`
              found reference `&Result<(), WhisperError>`
note: function defined here
  --> /Users/kdanylov/personal/whisper-rs/src/utilities.rs:54:8
   |
54 | pub fn convert_stereo_to_mono_audio(samples: &[f32]) -> Result<Vec<f32>, WhisperError> {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: `?` couldn't convert the error to `&str`
  --> examples/basic_use.rs:44:6
   |
8  |   pub fn usage() -> Result<(), &'static str> {
   |                     ------------------------ expected `&str` because of this
...
42 |       let audio_data = whisper_rs::convert_stereo_to_mono_audio(
   |  ______________________-
43 | |         &whisper_rs::convert_integer_to_float_audio(&audio_data),
44 | |     )?;
   | |     -^ the trait `From<WhisperError>` is not implemented for `&str`, which is required by `Result<(), &str>: FromResidual<Result<Infallible, WhisperError>>`
   | |_____|
   |       this can't be annotated with `?` because it has type `Result<_, WhisperError>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following other types implement trait `From<T>`:
             <String as From<char>>
             <String as From<Box<str>>>
             <String as From<Cow<'a, str>>>
             <String as From<&str>>
             <String as From<&mut str>>
             <String as From<&String>>
   = note: required for `Result<(), &str>` to implement `FromResidual<Result<Infallible, WhisperError>>`

Some errors have detailed explanations: E0061, E0277, E0308.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `whisper-rs` (example "basic_use") due to 3 previous errors

Fixed in d9e8713