rust-jack icon indicating copy to clipboard operation
rust-jack copied to clipboard

Client::new() panics when JACK is not installed

Open robbert-vdh opened this issue 3 years ago • 3 comments

I'd expect this to return an error if JACK is not available, but right now it just panics on an unwrap.

When creating a client, the library immediately calls jack_set_error_function:

https://github.com/RustAudio/rust-jack/blob/6133ac4d3654668f461a036fef8e3d9655b6c372/src/client/client_impl.rs#L49-L54

And those functions call jack_sys::library().unwrap():

https://github.com/RustAudio/rust-jack/blob/6133ac4d3654668f461a036fef8e3d9655b6c372/jack-sys/build.rs#L54

So if the library is not available or cannot be loaded, creating a client will panic instead of returning an error.

robbert-vdh avatar Jul 13 '22 15:07 robbert-vdh

This is a regression from #172, which IMO should be reverted.

Be-ing avatar Jul 13 '22 15:07 Be-ing

I think you can fix this by using version 0.9.2.

Be-ing avatar Jul 13 '22 15:07 Be-ing

I fixed this with #177.

robbert-vdh avatar Jul 13 '22 15:07 robbert-vdh