haileys / bark

live sync audio streaming for local networks
GNU Affero General Public License v3.0
667 stars 11 forks source link

Build failure on musl due to missing libc::sched_param fields #4

Open ptrcnull opened 1 year ago

ptrcnull commented 1 year ago

on musl libc, the sched_param struct has more fields:

    pub struct sched_param {
        pub sched_priority: ::c_int,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_low_priority: ::c_int,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_repl_period: ::timespec,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_init_budget: ::timespec,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_max_repl: ::c_int,
    }

without them, compiling bark fails:

   Compiling bark v0.1.0
error[E0063]: missing fields `sched_ss_init_budget`, `sched_ss_low_priority`, `sched_ss_max_repl` and 1 other field in initializer of `sched_param`
  --> src/thread.rs:19:14
   |
19 |             &libc::sched_param {
   |              ^^^^^^^^^^^^^^^^^ missing `sched_ss_init_budget`, `sched_ss_low_priority`, `sched_ss_max_repl` and 1 other field

For more information about this error, try `rustc --explain E0063`.
error: could not compile `bark` (bin "bark") due to previous error
nekopsykose commented 11 months ago

this is not a bug in bark. it is a bug in the libc crate. musl removed these sporadic names 4 years ago https://github.com/bminor/musl/commit/827aa8fbcac89a63c6efb986871663861500cd13. the only member of sched_param is sched_priority, per standard (with reserved space left over to not break ABI).

nekopsykose commented 11 months ago

( i don't expect it to get fixed anytime soon though )