[GH-ISSUE #478] build failing on FreeBSD due to 'hostname' #301

Closed
opened 2026-02-27 19:29:54 +03:00 by kerem · 5 comments
Owner

Originally created by @LeoSum8 on GitHub (May 13, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/478

Hi all,
I am trying to build librespot on FreeBSD 11.3.

So far I could successfully build the v1.1.0 tag with cargo build --no-default-features.

However when I try to build the latest state of dev or master I get the following error:

root@build-system:/mnt/build_system/librespot # cargo build --no-default-features
   Compiling hostname v0.2.0
   Compiling librespot-protocol v0.1.1 (/mnt/build_system/librespot/protocol)
   Compiling librespot-core v0.1.1 (/mnt/build_system/librespot/core)
error[E0308]: mismatched types
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hostname-0.2.0/src/nix.rs:51:13
   |
51 |             size,
   |             ^^^^ expected `i32`, found `usize`
   |
help: you can convert an `usize` to `i32` and panic if the converted value wouldn't fit
   |
51 |             size.try_into().unwrap(),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `hostname`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
Originally created by @LeoSum8 on GitHub (May 13, 2020). Original GitHub issue: https://github.com/librespot-org/librespot/issues/478 Hi all, I am trying to build librespot on FreeBSD 11.3. So far I could successfully build the `v1.1.0` tag with `cargo build --no-default-features`. However when I try to build the latest state of `dev` or `master` I get the following error: ```` root@build-system:/mnt/build_system/librespot # cargo build --no-default-features Compiling hostname v0.2.0 Compiling librespot-protocol v0.1.1 (/mnt/build_system/librespot/protocol) Compiling librespot-core v0.1.1 (/mnt/build_system/librespot/core) error[E0308]: mismatched types --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hostname-0.2.0/src/nix.rs:51:13 | 51 | size, | ^^^^ expected `i32`, found `usize` | help: you can convert an `usize` to `i32` and panic if the converted value wouldn't fit | 51 | size.try_into().unwrap(), | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. error: could not compile `hostname`. To learn more, run the command again with --verbose. warning: build failed, waiting for other jobs to finish... error: build failed ````
kerem 2026-02-27 19:29:54 +03:00
Author
Owner

@ashthespy commented on GitHub (May 13, 2020):

Looks like something is up with libmdns. Are you able to build that crate alone?

cc @willstott101

<!-- gh-comment-id:627909913 --> @ashthespy commented on GitHub (May 13, 2020): Looks like something is up with [`libmdns`](https://github.com/librespot-org/libmdns/). Are you able to build that crate alone? cc @willstott101
Author
Owner

@willstott101 commented on GitHub (May 13, 2020):

Hm libmdns 0.4+ uses hostname 0.3. Perhaps I should try bumping hostname in the libmdns 0.2 too.

aha... in-fact github.com/svartalf/hostname@63209523b3

<!-- gh-comment-id:628086905 --> @willstott101 commented on GitHub (May 13, 2020): Hm `libmdns 0.4+` uses `hostname 0.3`. Perhaps I should try bumping hostname in the `libmdns 0.2` too. aha... in-fact https://github.com/svartalf/hostname/commit/63209523b3c3d1973d1683b37b3c4e1db6565af9
Author
Owner

@willstott101 commented on GitHub (May 13, 2020):

So that is almost definitely the problem, I'll release new versions for libmdns 0.2 and 0.3 shortly. Then we can bump in librespot.

<!-- gh-comment-id:628087369 --> @willstott101 commented on GitHub (May 13, 2020): So that is almost definitely the problem, I'll release new versions for libmdns 0.2 and 0.3 shortly. Then we can bump in librespot.
Author
Owner

@willstott101 commented on GitHub (May 13, 2020):

PR here: https://github.com/librespot-org/librespot/pull/479

<!-- gh-comment-id:628135353 --> @willstott101 commented on GitHub (May 13, 2020): PR here: https://github.com/librespot-org/librespot/pull/479
Author
Owner

@LeoSum8 commented on GitHub (May 14, 2020):

Yup, I can confirm that you fixed it! Thank you!

<!-- gh-comment-id:628674134 --> @LeoSum8 commented on GitHub (May 14, 2020): Yup, I can confirm that you fixed it! Thank you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#301
No description provided.