Downloading the android artifacts separately is really a peculiarity of
cuttlefish jobs, where we need mesa artifacts for both the host and the
guest.
So move the separate download of android artifacts to
cuttlefish-runner.sh
This aligns with the .test-android definition being cuttlefish specific,
and it also matches the original comment in that definition regarding
S3_ANDROID_ARTIFACT_NAME.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35380>
In commit c99c67c490 (ci/android: Only replace ANGLE if needed,
2025-06-05) ANGLE is replaced in the Android device only when ANGLE_TAG
is specified.
However it can still happen that the device was using ANGLE all along,
and not replacing it means that the original version would not match the
one built by mesa-ci, making the GLES version check fail unnecessarily.
In case ANGLE_TAG is not specified the GLES version check can be skipped
altogether, the rationale for this approach is that ANGLE can be
considered the default GLES implementation for Android going forward,
so if android-runner.sh has not replaced it we can just trust that the
original one is in place.
There might still be some fancy setups in the wild where the GLES
implementation is mesa and not ANGLE, but we are not testing those in
mesa-ci for now, so skipping the test for non-ANGLE GLES too is
acceptable.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35380>
Structured tagging ensures that we are building and testing the current
component version specified in the commit by matching the checksum of
the related build script file.
In this case, it is worthy to isolate the Android CTS version part,
because we don't need to rebuild the entire test-android container when
we change the CTS version or the CTS modules filtering.
PS: actually the new file `build-android-cts.sh` is not building
anything, it is just downloads, filters, compress and reupload the
stripped version to S3. The `build-` prefix is to make it work
transparently with `bin/ci/update_tag.py` script.
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35596>
Pass XDG_CACHE_HOME=/data/local/tmp to binaries that load mesa
libraries to avoid the following message on the stderr:
Failed to create //.cache for shader cache (Read-only file system)---disabling.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35335>
It is possible that `eglinfo` and `vulkaninfo` provide info on multiple
devices.
Consider only the first device, which is going to be the default one
used by other components, when checking the versions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35335>
New mechanisms to retrieve the GLES and Vulkan driver versions have been
introduced in
- 3029fdde65 (ci/android: Switch to using eglinfo to check GLES implementation, 2025-05-28)
- 3ba9038648 (ci/android: Check Vulkan driver using vulkaninfo, 2025-05-28)
These mechanisms are more robust than the previous one but they do
change the behavior in that the version is not retrieved by an already
running process (e.g. SurfaceFlinger), but by creating new processes
that load the libraries available on the filesystem.
Because of this change of behavior the original version should be
printed **before** pushing the new libraries to the Android guest, so
that developers are able to compare the old and new versions in the logs.
Moreover, the runtime checks do not answer the original question anymore:
"what GLES/VK libraries is surfaceflinger currently using?"
but rather new question:
"what GLES/VK libraries are services going to use when they load?"
So the shell start/stop can very well performed after the version check,
accompanied by a new check on the PID of SurfaceFlinger to be sure that
it has reloaded consequently picking up the new libraries.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35335>
Different versions of Android might have different ways of getting the
GLES runtime version, so factor this out to a function, so that the
mechanism can be changed in a centralized way.
Also rename MESA_RUNTIME_VERSION to GLES_RUNTIME_VERSION because this is
really what is being retrieved, in the future we might have a similar
check for the vulkan Mesa driver.
While at it remove mentions of SurfaceFlinger in some comments since the
mechanism to retrieve the versions is irrelevant for the purposes of the
checks.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34111>
The intel vulkan driver is always built by the `debian-android` job,
since it may be needed for some future job, push it unconditionally, it
does not hurt to have it in the Android system.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34111>
Since ANGLE is always built for Android, always push it even if it is
not going to be tested directly.
Besides simplifying the script, this is also because ANGLE is going to
be mandatory anyway starting from Android 15+ and not having it in the
Android system might cause unexpected failures.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34111>
Remove old mesa and ANGLE libraries before pushing new ones, and do this
using a trailing wildcard, because some versions of Android might have
versioned libraries like /vendor/lib64/egl/libEGL_mesa.so.1 which should
also be removed to avoid any confusion when loading the freshly pushed
ones.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34111>
Some of the commands in cuttlefish-runner.sh, like updating mesa and
ANGLE, are not specific to cuttlefish, in general they can be executed
on any Android device under test.
So split those commands out of cuttlefish-runner.sh and put them into an
android-runner.sh script.
For example, when testing a physical Android device instead of a virtual
device, a mesa-ci job will call android-runner.sh directly instead of
cuttlefish-runner.sh
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34111>