-
Notifications
You must be signed in to change notification settings - Fork 28
default cross-platform runtime #72
Comments
@tamird hey, thanks for opening this issue! We'd love to have a working Fuschia target available by default in Runtime! But like you're saying, that doesn't quite seem possible right now. So what seems to be the clearest path forward would be if to create a new Runtime built specifically for Fuschia out of the Runtime tree. The way to do that is to implement the traits in #[runtime(runtime_fuschia::Fuschia)]
fn main () {
// code will work as expected here
} The biggest gotcha of the Hopefully this was helpful; good luck! |
Thanks for the reply, @yoshuawuyts! Implementing a fuchsia runtime does seem reasonably straightforward. The bigger concern that prompted me to open this issue is the desire to have a way to write user code (i.e. Trust-DNS) which doesn't have to directly specify which runtime it uses, so that e.g. its tests can be platform-agnostic. Is that something to which any thought has been given? |
Ah sorry, it seems like I misunderstood what you meant! The overarching answer here is to do what Rust's stdlib does, and create components that work on all platforms. But you're right that we probably shouldn't build in Fuschia support to Runtime's default runtime quiet yet. What I'd suggest doing instead is still build out Does this better answer your question? |
Sort of. That approach implies a dependency edge from trustdns to |
@tamird ah yes, you understood me correctly. That's.. unfortunate though. It almost sounds like we should have some sort of LD_PRELOAD method of loading dependencies, but that's quite a while out (almost seems related to std aware cargo, but like for external crates). If there's a constraint on not being able to publish the Fuschia runtime as any code then the only other alternative I see is pulling I'm sorry, I'm not sure what the best approach here would be. |
This is a neat project! Over in Fuchsia we'd like to use this to abstract over unix/fuchsia async primitives. In particular, we would like to be able to run third party tests on fuchsia to validate that things work as expected in the presence of the (substantially) different underlying system.
As a motivating example, consider Trust-DNS, which has tests which need an executor because they deal in futures. In order for that code to compile on fuchsia, we need some executor implementation that is cross-platform.
Has any thought been given to how such a thing would be provided? Fuchsia is still substantially unstable, so adding a dependency from
runtime
to some Fuchsia crate wouldn't work (since we're not yet publishing our crates to avoid stability guarantees).Thanks!
The text was updated successfully, but these errors were encountered: