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

blissify-rs no longer builds on macOS #51

Closed
michael-ball opened this issue Feb 8, 2024 · 7 comments · Fixed by #52
Closed

blissify-rs no longer builds on macOS #51

michael-ball opened this issue Feb 8, 2024 · 7 comments · Fixed by #52

Comments

@michael-ball
Copy link

michael-ball commented Feb 8, 2024

As of commit 2717d0d, blissify-rs will no longer build on macOS (and I'm guessing other systems where std::os::linux::net::SocketAddrExt is not available).

@Polochon-street
Copy link
Owner

hi, thanks a lot for reporting - we wouldn't have caught it otherwise. Could you try to checkout this branch #52 and tell me if it works? If it does, I'll merge and publish a new version of the crate :)

@michael-ball
Copy link
Author

Unfortunately not: when I try to build from that branch I get the following error:

error[E0599]: no function or associated item named `from_abstract_name` found for struct `std::os::unix::net::SocketAddr` in the current scope
   --> src/main.rs:167:40
    |
167 |                 let addr = SocketAddr::from_abstract_name(mpd_host.split_once('@').unwrap().1)?;
    |                                        ^^^^^^^^^^^^^^^^^^
    |                                        |
    |                                        function or associated item not found in `SocketAddr`
    |                                        help: there is an associated function with a similar name: `from_pathname`
    |
note: if you're trying to build a new `std::os::unix::net::SocketAddr` consider using one of the following associated functions:
      std::os::unix::net::SocketAddr::new
      std::os::unix::net::SocketAddr::from_parts
      std::os::unix::net::SocketAddr::from_pathname
   --> /Users/michael/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/os/unix/net/addr.rs:94:5
    |
94  | /     pub(super) fn new<F>(f: F) -> io::Result<SocketAddr>
95  | |     where
96  | |         F: FnOnce(*mut libc::sockaddr, *mut libc::socklen_t) -> libc::c_int,
    | |____________________________________________________________________________^
...
106 | /     pub(super) fn from_parts(
107 | |         addr: libc::sockaddr_un,
108 | |         mut len: libc::socklen_t,
109 | |     ) -> io::Result<SocketAddr> {
    | |_______________________________^
...
152 | /     pub fn from_pathname<P>(path: P) -> io::Result<SocketAddr>
153 | |     where
154 | |         P: AsRef<Path>,
    | |_______________________^

For more information about this error, try `rustc --explain E0599`.
error: could not compile `blissify` (bin "blissify") due to previous error

@Polochon-street
Copy link
Owner

I just pushed something that should hopefully fix it :) could you try again?

@michael-ball
Copy link
Author

Unfortunately there's still an error:

warning: unused import: `std::os::unix::net::SocketAddr`
   --> src/main.rs:136:13
    |
136 |         use std::os::unix::net::SocketAddr;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

error[E0308]: `if` and `else` have incompatible types
   --> src/main.rs:175:17
    |
166 |               } else if cfg!(target_os = "linux") && mpd_host.starts_with('@') {
    |  ______________________________________________________________________________-
167 | |                 #[cfg(target_os = "linux")]
168 | |                 {
169 | |                     let addr = SocketAddr::from_abstract_name(mpd_host.split_once('@').unwrap().1)?;
170 | |                     Client::new(MPDStream::Unix(UnixStream::connect_addr(&addr)?))?
171 | |                 }
172 | |             }
    | |_____________- expected because of this
...
175 | /                 Client::new(MPDStream::Tcp(TcpStream::connect(format!(
176 | |                     "{}:{}",
177 | |                     mpd_host, mpd_port
178 | |                 ))?))?
    | |______________________^ expected `()`, found `Client<MPDStream>`
    |
    = note: expected unit type `()`
                  found struct `Client<MPDStream>`

For more information about this error, try `rustc --explain E0308`.
warning: `blissify` (bin "blissify") generated 1 warning
error: could not compile `blissify` (bin "blissify") due to previous error; 1 warning emitted

@Polochon-street
Copy link
Owner

ah, damn, yes, but we're getting there! Just pushed something again, how about now?

@michael-ball
Copy link
Author

Yep that builds and runs successfully now.

@Polochon-street
Copy link
Owner

awesome! I published a new version of the crate, so everything should be fixed now. Closing.

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

Successfully merging a pull request may close this issue.

2 participants