katyo / oboe-rs

Rust bindings for Oboe high-performance audio IO Android library
64 stars 22 forks source link

fetch_unroll is a huge dependency for little gain #20

Closed hrydgard closed 3 years ago

hrydgard commented 3 years ago

Hi,

We use cpal for audio, which depends on this crate, oboe, for Android. We try hard to keep our dependency tree as clean as possible, at least avoiding dupes of large crates.

Unfortunately, the oboe-sys crate pulls in fetch_unroll, which in turn pulls in ureq with its massive tree of dependencies including stuff like old version of rusttls.

Making HTTP calls as part of build is dangerous and bad practice. Can we somehow get rid of this dependency?

katyo commented 3 years ago

Are you know the best alternative to ureq?

hrydgard commented 3 years ago

No, see, my point is, you should not be doing HTTP requests at all in build.rs.

Remove that and just check in whatever it is you're downloading, and you won't need ureq at all, the dependency can just be removed.

hrydgard commented 3 years ago

This will make things a little better if no other solution can be found: https://github.com/katyo/fetch_unroll/pull/1

katyo commented 3 years ago

As I see the solution for oboe crate:

  1. We add the c++ sources of oboe into package
  2. We stop using prebuilt libs by default

In a result we do not need to download anything by default.

hrydgard commented 3 years ago

I don't see anything wrong with 1, just putting the sources in the package. That's how most C++-wrapping crates do it. Also, if possible, using the cc crate instead of cmake eliminates another dependency.

katyo commented 3 years ago

Should be fixed by #21

hrydgard commented 3 years ago

Oh, awesome!