dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

Consider Android development Codespace #77851

Closed vcsjones closed 10 months ago

vcsjones commented 2 years ago

I've found myself occasionally wishing for a Codespace that was ready-to-go for Android development.

Is there an appetite for an Android Codespace? Ideally the Codespace would

  1. Get the NDK/SDK set up
  2. Get an emulator image
  3. Do a build of -rc release -s mono+libs
  4. Start an emulator with postStartCommand so the emulator is running when the Codespace starts.

If anyone else thinks this is a good idea, I'm happy to work on a devcontainer.json+Dockerfile for this, but would probably need someone with Administrative permissions to set up prebuilds, assuming we even want a prebuild of this.

/cc @eerhardt

ghost commented 2 years ago

Tagging subscribers to this area: @dotnet/area-meta See info in area-owners.md if you want to be subscribed.

Issue Details
I've found myself occasionally wishing for a Codespace that was ready-to-go for Android development. Is there an appetite for an Android Codespace? Ideally the Codespace would 1. Get the NDK/SDK set up 2. Get an emulator image 3. Do a build of `-rc release -s mono+libs` 4. Start an emulator with `postStartCommand` so the emulator is running when the Codespace starts. If anyone else thinks this is a good idea, I'm happy to work on a devcontainer.json+Dockerfile for this, but would probably need someone with Administrative permissions to set up prebuilds, assuming we even want a prebuild of this. /cc @eerhardt
Author: vcsjones
Assignees: -
Labels: `area-Meta`
Milestone: -
marek-safar commented 2 years ago

/cc @steveisok

steveisok commented 2 years ago

Not a bad idea. We'll look into it.

eerhardt commented 2 years ago

Note that with https://github.com/dotnet/runtime/pull/74683 we now have separate Codespace configurations for different development environments. So adding more configurations should be easy, albeit there may be duplication because you can't share/refactor devcontainer.json files.

ghost commented 1 year ago

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.

Issue Details
I've found myself occasionally wishing for a Codespace that was ready-to-go for Android development. Is there an appetite for an Android Codespace? Ideally the Codespace would 1. Get the NDK/SDK set up 2. Get an emulator image 3. Do a build of `-rc release -s mono+libs` 4. Start an emulator with `postStartCommand` so the emulator is running when the Codespace starts. If anyone else thinks this is a good idea, I'm happy to work on a devcontainer.json+Dockerfile for this, but would probably need someone with Administrative permissions to set up prebuilds, assuming we even want a prebuild of this. /cc @eerhardt
Author: vcsjones
Assignees: steveisok
Labels: `area-Meta`, `os-android`
Milestone: 8.0.0
vcsjones commented 11 months ago

I spent a little bit of time this afternoon trying to get this working and I got very far... then hit a blocker at the last step.

/dev/kvm does not get mapped inside the docker container for Codespaces, so KVM is not available, and neither is nested virtualization.

We can disable hardware acceleration with -no-accel but that comes with a few problems.

  1. Boot time is bad. The emulator takes 10 minutes to boot - and that's after I slimmed it down as much as I could by disabling bluetooth, display output, etc.
  2. Test time is bad. Some things are "okay" like System.IO.Hashing, but System.Security.Cryptography is... indeterminable. I stopped waiting after 45 minutes.
  3. Emulation is emulation and its bound to subtle bugs.

A smaller but not-so-bad issue is that the emulators require a lot of disk space - at least 64 GB. So the minimum Codespace spec is 8 core / 64 GB of storage.

At this point the only thing the Codespace is good for is building the code - but not running it, which I think largely defeats the point of why I wanted the Codespace.

I don't think a Codespace is suitable for Android development right now. I think we should close this, but I'll leave it open in case someone has ideas on making this suitable.

vcsjones commented 10 months ago

Okay - I actually have a way forward with this thanks to some inside help at GitHub.