#Tauri Mobile Dev Container
17 messages · Page 1 of 1 (latest)
@eager berry is it okay if i mention you?
I cloned your repo and just followed the instructions - container builds and works, init worked, build fails every time.
I haven't changed a single file.
here is my repo:
https://github.com/ZanzyTHEbar/DroneControl
Yea you can mention me, especially if it's an issue with one of my projects 🙂
Sorry for the late response, I've been busy
Do you see any errors? The log output can be pretty long but there should be something in there to indicate what has gone wrong
The biggest thing afaik that I believe I've just plain forgotten to document is that you need kvm installed in the host WSL installation in order for the Android emulator to work
I believe this is all you need to run in WSL to get kvm to work: sudo apt install qemu-kvm
If you after than can run kvm-ok and it says you're fine then you should be fine
Otherwise you'll have to do some googling to find the answer to how to enable nested virtualization and kvm inside WSL
That at least is my best guess as to what's wrong
my issue was actually with your example repo - it just wouldn't work. Don't recall the error atm, would have to spin up the repo again. I added the dev container to my project and it started to "work" - as in an apk was generated, but i thougt it was failing as the tauri mobile build command yarn tauri android build wasn't finishing. It would finish building and then just hang. I also ran into issues with RAM - the container was using 24GB of RAM and generated 30GB of build cache. I have a pretty decent machine, 16 cores, so i was surprised when it took so long and would freeze during build.
I did edit the .wslconfig to only use 16GB of my RAM - but that just made the performance issues worse, granted it didn't slow my machine down to a crawl anymore.
I migrated to just building on my windows machine and it works much better. No performance issues, faster build, less RAM usage, etc. I would love to use a dev container - but it just seems so resource intensive.
So far - tauri is the only framework that i can't seem to justify build containers. Unfortunately.
Unless i am missing something
If you watch any of my videos you can see the kind of performance I get, which is nearly native levels of performance, rebuilding the app after an update only takes like 2-4 seconds compared to like 15 in the windows host
So if performance is bad it should be related to the code not being in the proper location, or that your project is improperly set up. With a 300 GB build cache it looks to me like you have something like a * somewhere in your resources for example that might grow your usage immensely
So yea, watch one of my videos to see how it performs for me, if it performs worse for you then something isnt set up right and theres yet hope for your container. For me building is sometimes faster in the container thanks to e.g. using the mold linker, rather than slower
There are other issues, like the emulator performing slow if ran inside the container, and webkitgtk just in general being worse. But with adb forwarded so you run the emulator on the host the container performs stellar
Yeah, I did all of that. Definitely no wildcard imports, I don't use those - code is in the right place. I'll take your advice and watch your videos again, give it another try today.
In general though I've noticed wsl not performing well on my windows 11 machine.
If WSL itself isn't performing very well then there might be some deeper issue. Might be an idea to reinstall but zero guarantees it works, might just be the case that your hardware isn't a good match with WSL. Since the container runs with WSL as its backend then yea there's nothing the dev container can really do to fix that
Developing inside a container isn't THAT cool anyway, if you have a functioning setup on your host I'd say it's probably worth it to just keep using it, one of the bigger reasons to use a dev container is to not have to set up the environment on your host, and, well, you've already done that 😅 For desktop development I don't recommend sitting in the devcontainer anyway, webkitgtk is all kinds of annoying compared to webview2, and for android development you only get good performance if you figure out how to forward your frontend to the device properly, which I haven't had time to experiment with enough yet