Skip to content

Conversation

@mhsmith
Copy link

@mhsmith mhsmith commented Dec 4, 2025

Trying to reproduce the errors from pybind/pybind11#5914 and CPython, which look like this:

> Task :app:maxVersionSetup
  "Install AOSP ATD Intel x86_64 Atom System Image API 34 (revision 2)" ready.
  Installing AOSP ATD Intel x86_64 Atom System Image in /usr/local/lib/android/sdk/system-images/android-34/aosp_atd/x86_64
  "Install AOSP ATD Intel x86_64 Atom System Image API 34 (revision 2)" complete.
  "Install AOSP ATD Intel x86_64 Atom System Image API 34 (revision 2)" finished.
  Failed to create Emulator snapshot image (1/5). Error: com.android.build.gradle.internal.AvdSnapshotHandler$EmulatorSnapshotCannotCreatedException: Gradle was not able to complete device setup for: dev34_aosp_atd_x86_64_Small_Phone
  The emulator failed to open the managed device to generate the snapshot.
  This is because the emulator closed unexpectedly (exit value = 1).
  The errors recorded from emulator:
  Failed to create Emulator snapshot image (2/5). Error: com.android.build.gradle.internal.AvdSnapshotHandler$EmulatorSnapshotCannotCreatedException: Gradle was not able to complete device setup for: dev34_aosp_atd_x86_64_Small_Phone
  The emulator failed to open the managed device to generate the snapshot.
  This is because the emulator closed unexpectedly (exit value = 1).
  The errors recorded from emulator:
  Failed to create Emulator snapshot image (3/5). Error: com.android.build.gradle.internal.AvdSnapshotHandler$EmulatorSnapshotCannotCreatedException: Gradle was not able to complete device setup for: dev34_aosp_atd_x86_64_Small_Phone
  The emulator failed to open the managed device to generate the snapshot.
  This is because the emulator closed unexpectedly (exit value = 1).
  The errors recorded from emulator:
  Failed to create Emulator snapshot image (4/5). Error: com.android.build.gradle.internal.AvdSnapshotHandler$EmulatorSnapshotCannotCreatedException: Gradle was not able to complete device setup for: dev34_aosp_atd_x86_64_Small_Phone
  The emulator failed to open the managed device to generate the snapshot.
  This is because the emulator closed unexpectedly (exit value = 1).
  The errors recorded from emulator:
  Failed to create Emulator snapshot image (5/5). Error: com.android.build.gradle.internal.AvdSnapshotHandler$EmulatorSnapshotCannotCreatedException: Gradle was not able to complete device setup for: dev34_aosp_atd_x86_64_Small_Phone
  The emulator failed to open the managed device to generate the snapshot.
  This is because the emulator closed unexpectedly (exit value = 1).
  The errors recorded from emulator:
  Deleting unbootable snapshot for device: dev34_aosp_atd_x86_64_Small_Phone
  
  > Task :app:maxVersionSetup FAILED

@mhsmith
Copy link
Author

mhsmith commented Dec 4, 2025

The initial available disk space was 19 GB (GitHub only guarantees 14), and reducing it to 14 before running cibuildwheel was enough to reproduce the error.

@mhsmith
Copy link
Author

mhsmith commented Dec 4, 2025

Although not guaranteed, the runner currently comes with a second disk at /mnt with 66 GB free. We can move ~/.gradle and ~/.android there, which saves about 2.5 GB:

4097	/mnt/swapfile
1432	/mnt/python/android
1103	/mnt/python/gradle

Removing unused versions of the NDK would save about 2 GB each. According to GitHub's support policy, there will always be at least 3 NDK versions (hence 2 unused), but currently there are 4:

2103	/usr/local/lib/android/sdk/ndk/26.3.11579264
1980	/usr/local/lib/android/sdk/ndk/27.3.13750724
2209	/usr/local/lib/android/sdk/ndk/28.2.13676358
2404	/usr/local/lib/android/sdk/ndk/29.0.14206865

However, the biggest offender is the emulator image we're using, which is for some reason way bigger than all the other Android versions and variants. It shows as 8 GB on GitHub, and it's the same on my Mac:

8333    system-images/android-34/aosp_atd     <---
4255    system-images/android-34/google_apis
1697    system-images/android-35/aosp_atd
3870    system-images/android-35/google_apis

Based on that, we should switch to android-35/aosp_atd. This should also speed up the tests.

Some or all of these changes should be made in the CPython Android test script, which will be picked up by cibuildwheel after the next CPython release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant