Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow for disabling crossbeam-channel #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raphaelcoeffic
Copy link

@raphaelcoeffic raphaelcoeffic commented Feb 15, 2024

As it turns out, tokio does not mix well with notify when crossbeam-channels are enabled (see here).

In my tests with yaque added this way to my deps, it seems to work as expected (with this PR in place):

yaque = { version = "0.6.6", default-features = false, features = ["no-crossbeam-channel"] }

Fixes #32

@tokahuke
Copy link
Owner

tokahuke commented Feb 15, 2024

I can't believe it's that simple! Do you have any resources on this funky behavior?

EDIT: Sorry! I saw the link in your comment.

@alexander-camuto
Copy link

wow

@tokahuke
Copy link
Owner

So, I will merge and create a new minor version tomorrow, when I have some time to look into this closely.

@raphaelcoeffic
Copy link
Author

So, I will merge and create a new minor version tomorrow, when I have some time to look into this closely.

Thx a lot for your time!

recovery = ["sysinfo"]
log-trace = [] # test only
log-debug = [] # test only
crossbeam-channel = ["notify/default"]
no-crossbeam-channel = ["notify/macos_kqueue"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what has made me a bit uneasy was this: every time we compile for a MacOS target we would have to use this no-crossbeam-feature? Could we use [target.'cfg(target_os = "macos")'.dependencies] instead? (I have googled and it says this is a bit broken, but at least worth a shot. Else, could we use. cfg in the code directly?)

Copy link
Author

@raphaelcoeffic raphaelcoeffic Feb 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that at first, and it did work as well, but I believe it is actually related to using the tokio runtime rather than macOS. I did not test this under Linux though to confirm if this really the case.

The reason why it is needed to require kqueue is because notify does not provide a default for macOS if you don't use the default feature.

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.

recv() stuck awaiting
3 participants