-
Notifications
You must be signed in to change notification settings - Fork 251
Use objc2-core-foundation and objc2-core-services
#726
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
base: main
Are you sure you want to change the base?
Conversation
|
I'm not a member, but I noticed your suggestion to replace servo core foundation with these crates (the team has accepted the changes, but they haven't been merged yet), and also the wgpu team did the same. I think it’s worth mentioning, since they have a much larger and more active community, and they might have already investigated these crates. IMO, it’s a good idea, but personally I’d prefer us to have more tests — especially for corner cases — before applying the update. |
Fair enough, how do you propose we test things like this though? It's kinda hard, since most of it touches the file system and involves multiple processes to test their interaction. |
|
I like it. But I don't have a mac to test it. |
OK, I'm going to add tests from the old PR and others, if something else comes to my mind |
|
@riberk You are very welcome to do so. But be careful, these tests used to be extremely flaky. That's why we removed them at some point. In order to be useful we need automatic retries. |
Yeah, I got it. I think I’ll be able to adapt them so they won’t be flaky — I’ll use channels instead of timeouts, ignore the order of events, and so on. |
|
The tests added in main now, could you rebase and ensure if something isn't broken? @madsmtm |
This is an alternative to updating to fsevent-sys v5.1.
|
I did also try out the examples, they seemed to act the same before and after. |
|
Yeah, thank you! Basically I'd like to accept this replacement, given the community leans to accept transitions and the benefits from it. |
objc2-core-foundationprovides safer and auto-generated wrappers around CoreFoundation than the ones provided byfsevent-sys. In particular, you no longer have to worry about when to callCFRelease,objc2-core-foundationwill mostly take care of that for you.objc2-core-servicesdoes the same, but for CoreServices, in particular the FSEvents API thatnotifyuses.I maintain both crates as part of the
objc2project.I have tried to keep the functionality as close to the existing as possible, to make this PR easier to review and bisect, though I suspect the code in
append_pathandremove_pathcould be simplified.This is an alternative to updating to
fsevent-sys v5.1.0. I have filed a similar PR tofseventin octplane/fsevent-rust#48.