-
Notifications
You must be signed in to change notification settings - Fork 508
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
RFC: add feature "abi_stable" and make types abi stable #1446
Comments
I don't understand this request and its consequences well enough.
Could you point to your branch (may be unpolished)? |
Another question. How is the safety story for |
This comment makes me uneasy:
It shows there is nontrivial unsafety, in a way that may not agree with the opinions of the rust language/compiler. |
|
This is the proposed commit: 81f0c1a |
I agree that my use case may not be that common (putting a lot of computation and business code in dynamic library to keep the core code clean, and passing structs through ffi boundards). And I can totally understand that for that, introducing such a lesser-used crate into chrono may not be accepted. But for those do have this use case, since Rust does not provide a stable ffi, abi_stable is by far the best solution. And it is exactly the fact that it is lesser-used, unlike serde which most of crates provide features, not many, actually very few crates provides this feature. And due to the orphan rule, I can only fork and modify structs passing through ffi boundary. |
Given the lack of popularity of the abi_stable crate, I don't think we should do this. Note also that if we commit to abi_stable 0.11.x in chrono 0.4.x we can't bump abi_stable to 0.12.x or later on chrono 0.4.x because this dependency will become part of our public API. I think your best bet would be either on using some kind of fast serialization (like postcard or rkyv) or (longer term) on the efforts to provide Rust with a more stable ABI. |
Hello. In my project, I'm using Rust to load a dynamic library from an executable, and I'm utilizing certain chrono types across the ABI (Application Binary Interface) boundary. To ensure that the program does not crash, I'm employing the crate abi_stable to guarantee that the layouts of types passing through the ABI boundary are consistent.
At present, I have created my own fork of chrono and added an "abi_stable" feature to it. This modification ensures that types such as DateTime maintain ABI stability and can be safely passed through ABI boundaries. I am interested in contributing this modification to the upstream repository. What are your thoughts on this idea?
The text was updated successfully, but these errors were encountered: