Skip to content

[libc++][Android] Update compiler and sysroot #148998

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

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

rprichard
Copy link
Contributor

The previous source of sysroots (ci.android.com), deleted its artifacts after a short period of time, and is currently out-of-date because of the aosp-main turndown.

Updating the Docker image also fixes two tests.

 * Upgrade from r536225 to r563880.

 * Upgrade from ab/12644632 to
   f8b85cc5262c6e5cbc9a92c1bab2b18b32a4c63f, the current HEAD commit of
   https://android.googlesource.com/platform/prebuilts/ndk/+/refs/heads/mirror-goog-main-ndk

The previous source of sysroots (ci.android.com), deleted its artifacts
after a short period of time, and is currently out-of-date because of
the aosp-main turndown.

Updating the Docker image also fixes two tests.
@rprichard rprichard requested a review from a team as a code owner July 16, 2025 00:36
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 16, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 16, 2025

@llvm/pr-subscribers-libcxx

Author: Ryan Prichard (rprichard)

Changes

The previous source of sysroots (ci.android.com), deleted its artifacts after a short period of time, and is currently out-of-date because of the aosp-main turndown.

Updating the Docker image also fixes two tests.


Full diff: https://github.com/llvm/llvm-project/pull/148998.diff

4 Files Affected:

  • (modified) libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/is_bounded_array.pass.cpp (-3)
  • (modified) libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.compile.pass.cpp (-3)
  • (modified) libcxx/utils/ci/Dockerfile (+10-11)
  • (modified) libcxx/utils/ci/docker-compose.yml (+3-3)
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/is_bounded_array.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/is_bounded_array.pass.cpp
index 09086a4c046d6..8e57e8913dcbe 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/is_bounded_array.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.comp/is_bounded_array.pass.cpp
@@ -7,9 +7,6 @@
 //===----------------------------------------------------------------------===//
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-// The Clang version that Android currently uses in the CI is too old.
-// XFAIL: LIBCXX-ANDROID-FIXME
-
 // type_traits
 
 // is_bounded_array<T>
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.compile.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.compile.pass.cpp
index 9aac871f2633f..bd7da40daf2bc 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.compile.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.compile.pass.cpp
@@ -8,9 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14
 
-// The Clang version that Android currently uses in the CI is too old.
-// XFAIL: LIBCXX-ANDROID-FIXME
-
 // type_traits
 
 // has_unique_object_representations
diff --git a/libcxx/utils/ci/Dockerfile b/libcxx/utils/ci/Dockerfile
index 0a1985b02807b..63ceceaa67635 100644
--- a/libcxx/utils/ci/Dockerfile
+++ b/libcxx/utils/ci/Dockerfile
@@ -184,7 +184,7 @@ FROM ubuntu:jammy AS android-builder-base
 
 ARG ANDROID_CLANG_VERSION
 ARG ANDROID_CLANG_PREBUILTS_COMMIT
-ARG ANDROID_SYSROOT_BID
+ARG ANDROID_SYSROOT_COMMIT
 
 RUN apt-get update && apt-get install -y curl bzip2 git unzip
 
@@ -217,19 +217,18 @@ RUN <<EOF
     ls /opt/android/clang/clang-current/bin/clang
 EOF
 
-# Install an Android sysroot. New AOSP sysroots are available at
-# https://ci.android.com/builds/branches/aosp-main/grid, the "ndk" target. The
-# NDK also makes its sysroot prebuilt available at
-# https://android.googlesource.com/platform/prebuilts/ndk/+/refs/heads/dev/platform/sysroot.
+# Install an Android sysroot. New Android sysroots are available at
+# https://android.googlesource.com/platform/prebuilts/ndk/+/refs/heads/mirror-goog-main-ndk/platform/sysroot.
 
-ENV ANDROID_SYSROOT_BID=$ANDROID_SYSROOT_BID
+ENV ANDROID_SYSROOT_COMMIT=$ANDROID_SYSROOT_COMMIT
 RUN <<EOF
   set -e
-  cd /opt/android
-  curl -L -o ndk_platform.tar.bz2 \
-      https://androidbuildinternal.googleapis.com/android/internal/build/v3/builds/${ANDROID_SYSROOT_BID}/ndk/attempts/latest/artifacts/ndk_platform.tar.bz2/url
-  tar xf ndk_platform.tar.bz2
-  rm ndk_platform.tar.bz2
+  mkdir -p /opt/android/ndk
+  cd /opt/android/ndk
+  git clone --filter=blob:none https://android.googlesource.com/platform/prebuilts/ndk tmp
+  git -C tmp checkout ${ANDROID_SYSROOT_COMMIT}
+  mv tmp/platform/sysroot .
+  rm -rf tmp
 EOF
 
 # ===----------------------------------------------------------------------===##
diff --git a/libcxx/utils/ci/docker-compose.yml b/libcxx/utils/ci/docker-compose.yml
index 2189a41555c2f..4efc6d2a570e3 100644
--- a/libcxx/utils/ci/docker-compose.yml
+++ b/libcxx/utils/ci/docker-compose.yml
@@ -21,7 +21,7 @@ services:
       target: android-buildkite-builder
       args:
         BASE_IMAGE: ubuntu:noble
-        ANDROID_CLANG_VERSION: r536225
-        ANDROID_CLANG_PREBUILTS_COMMIT: 3f67b93ee7a50ae2a3cb34cc32d0589415cc0a9c
-        ANDROID_SYSROOT_BID: 12644632
+        ANDROID_CLANG_VERSION: r563880
+        ANDROID_CLANG_PREBUILTS_COMMIT: 6ae4184bb8706f9731569b9a0a82be3fcdcb951c
+        ANDROID_SYSROOT_COMMIT: f8b85cc5262c6e5cbc9a92c1bab2b18b32a4c63f
         <<: *compiler_versions

@rprichard
Copy link
Contributor Author

I could also leave the XFAIL cleanup out of this commit.

Either way: merging this PR is independent of the actual CI Docker update, which happens when I run a command on my workstation that pushes a locally-built Docker image to us-central1-docker.pkg.dev/libcxx-buildbots/docker-images/libcxx-builder-android.

Unless we want an intermediate step where the tests are UNSUPPORTED, there will be brief window where the two tests are failing again in CI.

@rprichard rprichard requested a review from philnik777 July 16, 2025 00:43
@rprichard
Copy link
Contributor Author

I used ANDROID_SYSROOT_COMMIT: f8b85cc5262c6e5cbc9a92c1bab2b18b32a4c63f to be consistent with the Clang version, which is also uses a reproducible version number.

I could also use ANDROID_SYSROOT_COMMIT: mirror-goog-main-ndk, which would always use the latest sysroot when building the Docker image.

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I would suggest making the two tests UNSUPPORTED instead of XFAIL in this patch just to avoid the CI being red.

I assume you tested using this image and made sure that it worked (modulo these two tests)?

@rprichard
Copy link
Contributor Author

LGTM. I would suggest making the two tests UNSUPPORTED instead of XFAIL in this patch just to avoid the CI being red.

I assume you tested using this image and made sure that it worked (modulo these two tests)?

Yes, I verified using run-buildbot android-ndk-... for the two NDK configurations.

I'll change it to UNSUPPORTED.

@rprichard rprichard merged commit 038e80c into llvm:main Jul 16, 2025
74 of 77 checks passed
@rprichard rprichard deleted the android-clang-r563880 branch July 16, 2025 22:57
H-G-Hristov added a commit to H-G-Hristov/llvm-project that referenced this pull request Jul 21, 2025
Android compiler was update to r563880:
llvm#148998
Zingam pushed a commit that referenced this pull request Jul 22, 2025
Android compiler was updated to r563880:
#148998
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 22, 2025
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
Android compiler was updated to r563880:
llvm#148998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants