-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
[Feature] Hot code reloading #184
Comments
This sounds brilliant, @jmgao! Do you've any thoughts on implementation for this? A viable idea might be to have something like |
I did some cursory investigation, and the way Android loads the NativeActivity makes things a bit annoying to do with ndk-glue as is, because we're loading the entire library before we have a chance to load the library from another location. I think the easiest solution is to do the following:
Now that I type this, I vaguely remember Android gaining an selinux restriction that prohibits loading libraries from application data directories if you have a sufficiently new target SDK version, but I don't remember if that happened before or after the version that the quest is on, but there are hacks around that... |
I remembered right, but it lasted for 9 days in the tree before it was reverted. |
Oooh, that does sound like an interesting implementation. My gut reaction is this feels like overkill and a potential source of tricky bugs. That said, if it'll give us a better developer experience, it may be worth it! What would the indirection of adding a |
You can't replace the library without rebuilding the APK and installing it: the application manifest says to load libcrab_saber.so, and Android will load that either from the read-only lib directory, or directly from the APK. Rebuilding the APK takes 14 seconds for me (?!?!?! why is it taking so long??) and installing takes ~4 seconds. Just pushing the libraries should be pretty much instantaneous ( We need a layer of indirection because we don't want to actually load the application library until we know which one to load, because there might be static initializers that don't expect to run twice in the same process, symbol collision if NativeActivity loads with RTLD_GLOBAL, and probably other horrible undebuggable landmines. |
Original comment from @jmgao
|
Background
Iteration time is everything. It would be really, really cool to be able to update code and have it reload in real-time
Options
TODO
The text was updated successfully, but these errors were encountered: