Skip to content
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

[qtbase] enable ci for android #35845

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ports/qtbase/cmake/qt_install_submodule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ if(NOT DEFINED QT6_DIRECTORY_PREFIX)
set(QT6_DIRECTORY_PREFIX "Qt6/")
endif()

if(VCPKG_TARGET_IS_ANDROID AND NOT ANDROID_SDK_ROOT)
message(FATAL_ERROR "${PORT} requires ANDROID_SDK_ROOT to be set. Consider adding it to the triplet." )
if(VCPKG_TARGET_IS_ANDROID)
if(NOT ANDROID_SDK_ROOT)
message(FATAL_ERROR "${PORT} requires ANDROID_SDK_ROOT to be set. Set ANDROID_SDK_ROOT as environment variable or in the triplet.")
elseif(NOT IS_DIRECTORY ${ANDROID_SDK_ROOT})
message(FATAL_ERROR "ANDROID_SDK_ROOT is set to `${ANDROID_SDK_ROOT}` which is not a directory.")
endif()
endif()

function(qt_download_submodule_impl)
Expand Down
5 changes: 3 additions & 2 deletions ports/qtbase/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "qtbase",
"version": "6.7.2",
"port-version": 1,
"description": "Qt Base (Core, Gui, Widgets, Network, ...)",
"homepage": "https://www.qt.io/",
"license": null,
Expand Down Expand Up @@ -62,7 +63,7 @@
"concurrent",
{
"name": "dbus",
"platform": "!(static & windows)"
"platform": "!uwp & !staticcrt & !android & !ios"
},
"default-features",
"doubleconversion",
Expand Down Expand Up @@ -193,7 +194,7 @@
},
"egl": {
"description": "EGL",
"supports": "linux",
"supports": "linux | android",
"dependencies": [
"egl"
]
Expand Down
13 changes: 13 additions & 0 deletions scripts/azure-pipelines/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# DisableDockerDetector "Used to build the container deployed to Azure Container Registry"
FROM ubuntu:focal-20240530

ADD https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip /android-sdk-11076708.zip
ADD https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb /packages-microsoft-prod.deb
ADD https://dl.google.com/android/repository/android-ndk-r26d-linux.zip /android-ndk-r26d-linux.zip

Expand Down Expand Up @@ -62,8 +63,20 @@ apt-get -y --no-install-recommends install $APT_PACKAGES
# Android NDK
unzip /android-ndk-r26d-linux.zip
rm -f android-ndk-r26d-linux.zip

# Android SDK
unzip /android-sdk-11076708.zip -d android-sdk
rm -f android-sdk-11076708.zip

shopt -s extglob
mkdir /android-sdk/cmdline-tools/latest
# https://stackoverflow.com/questions/65262340/cmdline-tools-could-not-determine-sdk-root
mv /android-sdk/cmdline-tools/!(latest) /android-sdk/cmdline-tools/latest
yes | /android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses
/android-sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "build-tools;29.0.2" "platform-tools" "tools"
END_OF_SCRIPT

ENV ANDROID_NDK_HOME /android-ndk-r26d
ENV ANDROID_SDK_ROOT /android-sdk

WORKDIR /vcpkg
22 changes: 22 additions & 0 deletions scripts/azure-pipelines/test-modified-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,28 @@ if ($IsWindows) {
rmdir empty
}

if ($IsLinux)
{
Write-Host "Downloading and setting up Java"
& "./vcpkg" x-download openjdk.tar.gz "--sha512=0bf168239a9a1738ad6368b8f931d072aeb122863ec39ea86dc0449837f06953ce18be87bab7e20fd2585299a680ea844ec419fa235da87dfdd7e37b73740a57" "--url=https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz" @cachingArgs
& tar -xvzf openjdk.tar.gz
$env:JAVA_HOME = Join-Path $Pwd "jdk-17.0.2"
Write-Host "Downloading Android SDK"
& "./vcpkg" x-download android-sdk.zip "--sha512=64b7d18ee7adeb1204eaa2978091e874dc9af9604796b64e1a185a11c15325657383fc9900e55e4590c8b8a2784b3881745d2f32daef1207e746c0ee41c2b72b" "--url=https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip"


Write-Host "Setting up SDK"
& unzip -q android-sdk.zip -d android-sdk
$env:ANDROID_SDK_ROOT = Join-Path $Pwd "android-sdk"
Move-Item -Path ./android-sdk/cmdline-tools/ -Destination ./android-sdk/tools
New-Item -Path ./android-sdk -Name cmdline-tools -ItemType directory
Move-Item -Path ./android-sdk/tools -Destination ./android-sdk/cmdline-tools
& bash -c 'yes | /android-sdk/cmdline-tools/tools/bin/sdkmanager --licenses'
& ./android-sdk/cmdline-tools/tools/bin/sdkmanager "platforms;android-33"
$NoParentHashes = $true
}


& "./vcpkg$executableExtension" x-ci-clean @commonArgs
if ($LASTEXITCODE -ne 0)
{
Expand Down
1 change: 1 addition & 0 deletions triplets/arm-neon-android.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Android)
set(VCPKG_MAKE_BUILD_TRIPLET "--host=armv7a-linux-androideabi")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=armeabi-v7a -DANDROID_ARM_NEON=ON)
set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT})
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't help with ABI hashes: The content of the triplet files remains independent of the content of ENV{ANDROID_SDK_ROOT}.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only way I know to bring this into ABI hashes is by (a) writing it into an overlay triplet, but as you mentioned, this is intrusive on user side.
Or we respect environment variables, either by inspecting them (b) in the triplet (done currently) or (c) in the android toolchain (done before) or (d) in the port and forward it to cmake configure from there.

And if I understand correctly, your preference is (d)?

1 change: 1 addition & 0 deletions triplets/arm64-android.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Android)
set(VCPKG_MAKE_BUILD_TRIPLET "--host=aarch64-linux-android")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=arm64-v8a)
set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT})
1 change: 1 addition & 0 deletions triplets/x64-android.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Android)
set(VCPKG_MAKE_BUILD_TRIPLET "--host=x86_64-linux-android")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=x86_64)
set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT})
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7410,7 +7410,7 @@
},
"qtbase": {
"baseline": "6.7.2",
"port-version": 0
"port-version": 1
},
"qtcharts": {
"baseline": "6.7.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/q-/qtbase.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4da10132b7044c6a514d84302182aebbc7faa150",
"version": "6.7.2",
"port-version": 1
},
{
"git-tree": "f8600119a4cecb137dd044bf72ab5a3c8b67ae02",
"version": "6.7.2",
Expand Down
Loading