Skip to content

Use dispatch2#140

Merged
Detegr merged 1 commit intoDetegr:masterfrom
madsmtm:dispatch2
Oct 28, 2025
Merged

Use dispatch2#140
Detegr merged 1 commit intoDetegr:masterfrom
madsmtm:dispatch2

Conversation

@madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Oct 28, 2025

The dispatch crate is unmaintained, and doesn't link on tvOS, watchOS and visionOS, building for one of those platforms currently fails with:

$ cargo +nightly build -Zbuild-std --target aarch64-apple-tvos --example readme_example
...
error: linking with `cc` failed: exit status: 1
  ...
  = note: ld: library 'dispatch' not found
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile `ctrlc` (example "readme_example") due to 1 previous error

I maintain an alternative called dispatch2, which works on these platforms, and also has a safer API (you'd be able to fully avoid the unsafe here if you used a static OnceLock instead of static mut).

This is similar in spirit to my previous PR #128.

@Detegr Detegr merged commit eed9335 into Detegr:master Oct 28, 2025
16 checks passed
@Detegr
Copy link
Owner

Detegr commented Oct 28, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants