diwic / alsa-rs

Thin but safe ALSA wrappers for Rust
Apache License 2.0
139 stars 66 forks source link

Update dependencies. #60

Closed hrydgard closed 3 years ago

hrydgard commented 3 years ago

Also makes synth-example use the local alsa-rs, so you can easily test changes.

As for the error change, .description() is deprecated on Error.

diwic commented 3 years ago

@hrydgard You forgot to revert the nix dependency update (and please squash the patch when you think it's ready for merge), but that does not explain why you wanted to do it in the first place, and also I'm curious how this PR helps Embark studios in making alsa-rs more game friendly?

hrydgard commented 3 years ago

Oh I very intentionally left the nix one since it's a "major" version upgrade that won't be auto-reconciled, unlike the libc one.

Just doing some duplicate dependency cleanup. We ended up with two versions of nix in our build - which is normal, but trying to keep the number of dupes in check (we use cargo-deny to find them). Actually the other version we pull in through another dependency is 0.18 so this change won't make things strictly better until I can update those other dependencies too.

Boddlnagg commented 3 years ago

It's also a bit problematic that alsa-rs makes nix part of its public API without reexporting it (e.g. in errno). This means that downstream crates need to always use a version that is compatible with the one used by alsa-rs when they want to use these parts of the API. When multiple dependencies would do that, and they use mutually incompatible versions, that's a problem (although I haven't run into it yet).

See also https://github.com/Boddlnagg/midir/pull/66#issuecomment-670842508.

diwic commented 3 years ago

@Boddlnagg I believe this is now fixed in https://github.com/diwic/alsa-rs/commit/78787a911fdcfb8880bfef30f24e9665e7d1ef81 - can you verify?

Boddlnagg commented 3 years ago

I can't at the moment unfortunately, because I have no access to a Linux environment right now. But looking at the code, it seems correct. You can verify yourself by checking if you can in a downstream crate do something like e.errno() == Some(nix::errno::Errno::ENOSPC) without depending on nix directly.