Allow running Cargo binaries directly #77
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I strongly dislike the extra
*_android.rsexample files that we need insoftbuffer. These are required because we have to tell Cargo to generate acdylibwithcrate-type = ["cdylib"]for each example that runs on Android.Instead of that, we can pass
-Clink-arg=-shared -Clink-arg=-no-pietorustc, together with#![no_main], which tricks the linker into thinking that thebin/ executable target is actually a dynamic library.This means that all a user of
winithas to do is:Which, to be fair, is still a mouthful, but it's better, and it could be reduced with macros. Have a look at this branch for trying it out in
softbuffer.Opened as a draft to show you that it's possible. I haven't polished it yet, but I'd like to know if a hack like this is something you'd be interested in before proceeding.