-
-
Notifications
You must be signed in to change notification settings - Fork 43
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: Replace use of the libc
crate with the rustix
crate
#582
Conversation
libc
crate with the rustix
crate
It seems it didn't assign to you 😅 once I changed it into "Open for review". @yorickpeterse could you please help me take a look on my PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the signal()
call:
We can just use an extern "C"
block. We only need this on Unix platforms, and the SIG*
constants have the same values on the different Unix systems. This way we don't need to keep the direct dependency on libc around.
Thank for your review @yorickpeterse 😄 i will update soon |
@yorickpeterse ping you again in case you maybe missed it 😛 |
@yorickpeterse I've pushed the fix. Could you please take a look again? Hopefully my PR can gooo bruuhh |
I've pushed the fix, change the commit message following the guideline. Please help me review @yorickpeterse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made three small formatting changes (just some wrapping of comments, which rustfmt doesn't do, and some whitespace), the rest looks fine. I think clippy will have some complaints, but I'll add the necessary changes to the commit myself. Thanks! 😃
c9d4a51
to
11ea13f
Compare
In the interest of reducing 3rd-party dependencies and maintaining control over our code, I would not only like to restore our old polling code in favour of the polling crate (inko-lang#344), but also switch to using rustix. The benefit of using rustix is that at least on Linux we can avoid libc calls. While this may result in a performance improvement, it's really more about slowly reducing our dependencies on 3rd-party libraries, including libc. The API might also be a bit more pleasant to use compared to using the libc crate directly. Changelog: changed
11ea13f
to
7f03150
Compare
@thaodt Thanks for working on this! 🎉 |
This PR is served for this issue #521.
As discussed some days ago, I will leave the time functions as it is for the time being, as these can easily be ported to Inko itself using the new FFI.
Also, there's a function I can't find an alternative to in
rustix
, see the code below:inko/rt/src/runtime.rs
Lines 31 to 43 in 59578a1
Therefore, I still keep it in
libc
. If you have any ideas, please review and advise, I will update my PR.How Has This Been Tested?
Existing tests pass.
What process can a PR reviewer use to test or verify this change?
Check the new
rustix
replacements are correct.