BlackMIDIDevs / wasabi

The fastest and most memory efficient Black MIDI player. Can play virtually any Black MIDI you have in realtime.
GNU General Public License v3.0
27 stars 7 forks source link

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks #60

Closed yurivict closed 6 months ago

yurivict commented 6 months ago

Build fails on FreeBSD 15-CURRENT:

run with -Z macro-backtrace for more info)
help: use `#[coroutine]` to make this closure a coroutine
  --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/cancel_tempo_events.rs:18:13
   |
18 |     GenIter(#[coroutine] move || {
   |             ++++++++++++

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
  --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/lib.rs:61:9
   |
61 |         yield $err;
   |         ^^^^^^^^^^
   |
  ::: /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/filter_events.rs:22:25
   |
22 |             let mut e = unwrap!(e);
   |                         ---------- in this macro invocation
   |
   = note: this error originates in the macro `yield_error` which comes from the expansion of the macro `unwrap` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `#[coroutine]` to make this closure a coroutine
  --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/filter_events.rs:20:13
   |
20 |     GenIter(#[coroutine] move || {
   |             ++++++++++++

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
   --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/lib.rs:61:9
    |
61  |         yield $err;
    |         ^^^^^^^^^^
    |
   ::: /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/batched.rs:115:21
    |
115 |             let e = unwrap!(e);
    |                     ---------- in this macro invocation
    |
    = note: this error originates in the macro `yield_error` which comes from the expansion of the macro `unwrap` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `#[coroutine]` to make this closure a coroutine
   --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/batched.rs:112:13
    |
112 |     GenIter(#[coroutine] move || {
    |             ++++++++++++

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
   --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/lib.rs:61:9
    |
61  |         yield $err;
    |         ^^^^^^^^^^
    |
   ::: /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/batched.rs:135:25
    |
135 |             let batch = unwrap!(batch);
    |                         -------------- in this macro invocation
    |
    = note: this error originates in the macro `yield_error` which comes from the expansion of the macro `unwrap` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `#[coroutine]` to make this closure a coroutine
   --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/batched.rs:133:13
    |
133 |     GenIter(#[coroutine] move || {
    |             ++++++++++++

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
   --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/lib.rs:61:9
    |
61  |         yield $err;
    |         ^^^^^^^^^^
    |
   ::: /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/batched.rs:150:25
    |
150 |             let batch = unwrap!(batch);
    |                         -------------- in this macro invocation
    |
    = note: this error originates in the macro `yield_error` which comes from the expansion of the macro `unwrap` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `#[coroutine]` to make this closure a coroutine
   --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/event/batched.rs:148:13
    |
148 |     GenIter(#[coroutine] move || {
    |             ++++++++++++

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
  --> /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/lib.rs:61:9
   |
61 |         yield $err;
   |         ^^^^^^^^^^
   |
  ::: /wrkdirs/usr/ports/audio/wasabi/work/midi-toolkit-rs-a54f19890e47c90a246001b9f8b2519f3604eb58/midi-toolkit/src/sequence/note/merge_notes.rs:32:31
   |
32 |                     Err(e) => yield_error!(Err(e)),
   |                               -------------------- in this macro invocation
   |
   = note: this error originates in the macro `yield_error` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `#[coroutine]` to make this closure a coroutine

Version: wasabi-0.1.4-3-g6384482

arduano commented 6 months ago

I believe I pinned the rust version in latest master, could you check that? Otherwise MBMS has helped patch the issues in midi-toolkit-rs, I'll get around to merging them in eventually. This is just rust nightly breaking changes

yurivict commented 6 months ago

We use pre-built rust-nightly package, and can't use pinned rust-nightly because these nightlies are already available (or never been available) as packages.

arduano commented 6 months ago

I'm not sure what you're talking about, are you using rustup?

yurivict commented 6 months ago

The failure is in the FreeBSD port audio/wasabi which uses the rust-nightly package.

arduano commented 6 months ago

oh, so the build system doesn't allow switching toolchains to the one wasabi is pinned to? that's kinda annoying and sounds like a build system issue not a wasabi issue. Generally you're supposed to use rustup which automatically manages toolchains for you.

I'll update the toolchain to the latest sometime, just busy rn (PRs welcome btw)