sonyxperiadev/bug_tracker

[SEINE] Build for Android 13 not working

Closed this issue · 14 comments

Platform: Seine
Device: XQ-AU52
Kernel version:
Android version: 13
Software binaries version:

Previously working on
Has not worked before

Description
I'm trying to build Android 13 according to the instructions on: https://developer.sony.com/open-source/aosp-on-xperia-open-devices/guides/aosp-build-instructions/build-aosp-android-13/

Symptoms
At the make step I get the following error:

 make -j4
12:25:52 ************************************************************
12:25:52 You are building on a machine with 15.5GB of RAM
12:25:52 
12:25:52 The minimum required amount of free memory is around 16GB,
12:25:52 and even with that, some configurations may not work.
12:25:52 
12:25:52 If you run into segfaults or other errors, try reducing your
12:25:52 -j value.
12:25:52 ************************************************************
12:25:53 Build sandboxing disabled due to nsjail error.
build/make/core/soong_config.mk:209: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:210: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=13
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.1.0-17-amd64-x86_64-Ubuntu-20.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=TQ3A.230901.001
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl hardware/google/camera hardware/google/camera/devices/EmulatedCamera device/generic/goldfish device/generic/goldfish-opengl
============================================
[100% 494/494] analyzing Android.bp files and generating ninja file at out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out "out"     -o out/soong/build.ninja --globListDir build --globFile out/soong/globs-build.ninja -t -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.build Android.bp
error: vendor/qcom/opensource/display/sm8450/composer/Android.bp:3:1: "vendor.qti.hardware.display.composer-service" depends on undefined module "android.hardware.common-V2-ndk_platform"
error: vendor/qcom/opensource/display/sm8450/composer/Android.bp:3:1: "vendor.qti.hardware.display.composer-service" depends on undefined module "vendor.qti.hardware.display.config-V5-ndk_platform"
12:27:21 soong bootstrap failed with: exit status 1

#### failed to build some targets (06:23 (mm:ss)) ####

(Ignore the warning about RAM, I have enough Swap so that shouldn't be an issue)

How to reproduce
Follow the instructions from the Sony website.

Additional context
I'm running this from within a Docker container running Ubuntu 20.04, so it should be a clean build environment.

Additional questions

Since the Sony Xperia 10 II is listed under "Maintained Devices" I would expect the build for Android 13 works. What is the latest Android branch this was tested with?

Does "Maintained Device" also mean that building Android 14 is supported? Ideally I'd like to build the newest Android version, so if Android 14 works that would be fine for me too.

"12:25:52 You are building on a machine with 15.5GB of RAM
12:25:52
12:25:52 The minimum required amount of free memory is around 16GB,
12:25:52 and even with that, some configurations may not work."

Thank you for the quick reply:

The message is wrong, I have 16GB of RAM + 4GB of Swap (which the Android build system ignores) so this should work. I also checked for any OOM kills, there are none.

I managed to fix this error by following: https://www.reddit.com/r/LineageOS/comments/ujusqu/build_issue/

See the diff:

android/vendor/qcom/opensource/display/sm8450# git diff
diff --git a/composer/Android.bp b/composer/Android.bp
index 24e5fc39..76d63e97 100644
--- a/composer/Android.bp
+++ b/composer/Android.bp
@@ -63,8 +63,8 @@ cc_binary {
         "libdisplayconfig.qti",
         "libdrm",
         "libbinder_ndk",
-        "android.hardware.common-V2-ndk_platform",
-        "vendor.qti.hardware.display.config-V5-ndk_platform",
+        "android.hardware.common-V2-ndk",
+        "vendor.qti.hardware.display.config-V5-ndk",
         "vendor.qti.hardware.display.demura@2.0",
     ],

So it seems to me there's inconsistentcy in the build tree. I'm letting the build run now and see how far it gets.

Your build won't get very far though, you're building for the goldfish emulator (default target), not for pdx201 (Seine).

The reason we don't need sonyxperiadev/vendor-qcom-opensource-display@79484ce yet is because we bailed out of the ndk_platorm removal via sonyxperiadev/device-sony-common@b9e660d.

Maybe we don't need to use the duplicate/compat/legacy *-ndk-platform.so libs on Android 14 anymore though, but it depends on how far our vendor repos have migrated (and if they're compiled for multiple Android targets).

Your build won't get very far though, you're building for the goldfish emulator (default target), not for pdx201 (Seine).

Thank you very much! I must have done something wrong with the lunch command.

I have reverted the change I mentioned previously and am now building with:

 make -j4
13:28:27 ************************************************************
13:28:27 You are building on a machine with 15.5GB of RAM
13:28:27 
13:28:27 The minimum required amount of free memory is around 16GB,
13:28:27 and even with that, some configurations may not work.
13:28:27 
13:28:27 If you run into segfaults or other errors, try reducing your
13:28:27 -j value.
13:28:27 ************************************************************
13:28:27 Build sandboxing disabled due to nsjail error.
build/make/core/soong_config.mk:209: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:210: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=13
TARGET_PRODUCT=aosp_xqau52
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.1.0-17-amd64-x86_64-Ubuntu-20.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=TQ3A.230901.001
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/sony/common device/sony/seine vendor/qcom/opensource/core-utils vendor/qcom/opensource/display/sm8250 vendor/qcom/opensource/display-commonsys-intf/sm8250
============================================

Lets see if that succeeds.

Btw, is Android 14 supported for the pdx201 device? Or is that not tested?

Btw, is Android 14 supported for the pdx201 device? Or is that not tested?

I don't dare to say. The folks working with this device (e.g. me, sometimes) are only developing with it on a mainline Linux kernel and free/open userspace.

@MarijnS95 which open userspace are you talking about? I'd be interested in playing with things other than Android.

I managed to compile successfully thanks to your help, but when trying to flash the system partition I get the following error:

 fastboot flash system system.img 
Sending sparse 'system' 1/2 (720896 KB)            OKAY [ 22.542s]
Writing 'system'                                   FAILED (remote: 'No such partition.')
fastboot: error: Command failed

Same happens for vendor and product. What am I doing wrong here?

@sudden6 the linked documentation in your main post should be suggesting to boot to fastboot(d) before flashing these partitions?

@MarijnS95 Thank you, I overlooked that step facepalm

AOSP 13 is now booting, but I don't have WiFi or any form of cellular connection :(

I'll close this for now and will open a separate issue for wifi and modem if it becomes relevant.

I don't have WiFi

I will backport a fix

I PRed required fixes for wifi and modem