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

Building for macOS Souvlaki Error #16

Closed
iggyzuk opened this issue Nov 19, 2022 · 2 comments
Closed

Building for macOS Souvlaki Error #16

iggyzuk opened this issue Nov 19, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@iggyzuk
Copy link

iggyzuk commented Nov 19, 2022

When I make a build for MacOS with cargo +nightly build --release I get the following error:

error[E0277]: `souvlaki::Error` doesn't implement `std::fmt::Display`
  --> src/systems/player.rs:26:9
   |
23 |       handle_error_option(
   |       ------------------- required by a bound introduced by this call
...
26 | /         MediaControls::new(PlatformConfig {
27 | |             dbus_name: "ytermusic",
28 | |             display_name: "YTerMusic",
29 | |             hwnd: None,
30 | |         }),
   | |__________^ `souvlaki::Error` cannot be formatted with the default formatter
   |
   = help: the trait `std::fmt::Display` is not implemented for `souvlaki::Error`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `handle_error_option`
  --> src/errors.rs:14:8
   |
8  | pub fn handle_error_option<T, E>(
   |        ------------------- required by a bound in this
...
14 |     T: std::fmt::Display,
@ccgauche ccgauche self-assigned this Nov 19, 2022
@ccgauche ccgauche added the bug Something isn't working label Nov 19, 2022
@ccgauche
Copy link
Owner

@iggyzuk From what I see you're probably on an old commit:

#[cfg(not(target_os = "windows"))]
fn get_handle(updater: &Sender<ManagerMessage>) -> Option<MediaControls> {
    handle_error_option(
        updater,
        "Can't create media controls",
        MediaControls::new(PlatformConfig {
            dbus_name: "ytermusic",
            display_name: "YTerMusic",
            hwnd: None,
        })
        .map_err(|e| format!("{:?}", e)),
    )
}

Because commit 14403b6 fixed it

@Bellavene
Copy link

Could you please tell, how to build it for macos?

cargo +nightly build --release
error: toolchain 'nightly-aarch64-apple-darwin' is not installed
cargo install nightly-aarch64-darwin
    Updating crates.io index
error: could not find `nightly-aarch64-darwin` in registry
    `crates-io` with version `*`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants