sonyxperiadev / bug_tracker

Empty repository that is used as a bugtracker for Open Devices project
52 stars 13 forks source link

Fail to sync sourcetree to android-10.0.0_r1 #456

Closed stefanhh0 closed 5 years ago

stefanhh0 commented 5 years ago

Android version: android-10.0.0_r1

Description When trying to switch to android-10.0.0_r1

I had to remove following lines from: .repo/local_manifests/untracked.xml

<remove-project name="device/generic/mips" />
<remove-project name="device/generic/mips64" />
<remove-project name="device/generic/mini-emulator-mips" />
<remove-project name="device/generic/mini-emulator-mips64" />
<remove-project name="device/google/accessory/arduino" />
<remove-project name="device/google/accessory/demokit" />
<remove-project name="platform/hardware/intel/audio_media" />
<remove-project name="platform/hardware/intel/bootstub" />
<remove-project name="platform/hardware/intel/common/bd_prov" />
<remove-project name="platform/hardware/intel/common/libmix" />
<remove-project name="platform/hardware/intel/common/libstagefrighthw" />
<remove-project name="platform/hardware/intel/common/libva" />
<remove-project name="platform/hardware/intel/common/libwsbm" />
<remove-project name="platform/hardware/intel/common/omx-components" />
<remove-project name="platform/hardware/intel/common/utils" />
<remove-project name="platform/hardware/intel/common/wrs_omxil_core" />
<remove-project name="platform/hardware/intel/img/hwcomposer" />
<remove-project name="platform/hardware/intel/img/psb_headers" />
<remove-project name="platform/hardware/intel/img/psb_video" />
<remove-project name="platform/hardware/intel/sensors" />
<remove-project name="platform/hardware/marvell/bt" />

repo sync --force-sync -j8 repo init -b android-10.0.0_r1

Worked after removing the no longer available repos from untracked.xml. However when trying to run repo_update.sh I got some additional problems:

From https://android.googlesource.com/platform/art
 * branch                  refs/changes/97/1112097/2 -> FETCH_HEAD
error: could not apply 7de7c4cd0c... ART: Add support for ARMv8.x features for ARM64.
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Recorded preimage for 'runtime/arch/arm64/instruction_set_features_arm64.cc'
Recorded preimage for 'runtime/arch/arm64/instruction_set_features_arm64.h'
Recorded preimage for 'runtime/arch/arm64/instruction_set_features_arm64_test.cc'
MartinX3 commented 5 years ago

https://github.com/omnirom/android/commit/035aff02218cffa98acb8f59ca7afcc25543f584 Here is what OmniROM did change to make their stuff AOSP 10 compatible.

And LineageOS 17 (but it looks not tidy) https://github.com/LineageOS/android/compare/lineage-17.0

MarijnS95 commented 5 years ago

@stefanhh0 Please be a little patient. The SODP contributors are hard at work supporting android 10, but as long as it doesn't show up on the build-guide page we're not there yet. I don't think the "bug" label is in place here. (Though I should be clear: all the devices I have running here right now are pretty happy on 10 while we're ironing out the last kinks)

If however you want to help out and (compile-)test + contribute, you are completely welcome! We're currently sorting through commits before submitting PRs (and making sure Pie is not destroyed in the process), which you can find mostly on my forks: https://github.com/MarijnS95?tab=repositories If you take the master or android-q on there everything should "just work". I'll go over my repos in the next hour-or-so and check whether anything else needs pushing (for example, I forgot one of the cherry-picks @ix5 made to "support" non-system-as-root devices, Google has pretty much dropped support).

stefanhh0 commented 5 years ago

Understand, I just gave it a try since the branch android-10.0.0_r1 already showed up in the local_manifests. Thanks for your prompt feedback and yes I guess this can be closed then...

Sorry for being a little impatient. Thanks for working on it! I may give it a try with the master/android-q from your forks.

Thanks a lot & Cheers Stefan

MarijnS95 commented 5 years ago

Ah that's true, Alin already created a manifest branch for us but so far it still points to android 9.

I just pushed some more stuff to the branches. The Q branch on my device-sony-common fork is a little messy as it has all of my feature-PRs merged in, but some commits (usually labeled Q) are necessary to build. The others repositories should be relatively straightforward though, and you'll have to convert vendorsetup.sh for your device of choice. Feel free to report back on anything you come across, I will most definitely forget to push at least one repository :sweat_smile:

I'm hoping to get things merged over the coming week, but we have to go through outstanding Pie PRs first.

MarijnS95 commented 5 years ago

@stefanhh0 Most of the PRs have been submitted and merged :grin: If you encounter any errors, it's likely one of the hardware repos that have an outstanding PR. See mine here.

Since we are in the middle of a conversion to 4.14, you'll likely want to build 4.9 for the time being. I'll put up a local_manifest branch with the right repos reverted. You should manually revert the mediahal switch to sm8150 if building for sdm845 (not Lilac, which you build for iirc).

stefanhh0 commented 5 years ago

Cool, tried today syncing works just fine now.

I did following and one of the make file causes an error for both when trying to build msm-4-9 and msm-4.14. Here the output for msm-4.9:

stefan@mars:~/android/source$ . build/envsetup.sh && lunch

You're building on Linux

Lunch menu... pick a combo:
02:54:08 Build sandboxing disabled due to nsjail error. This may become fatal in the future.
02:54:08 Please let us know why nsjail doesn't work in your environment at:
02:54:08   https://groups.google.com/forum/#!forum/android-building
02:54:08   https://issuetracker.google.com/issues/new?component=381517
[...]
Which would you like? [aosp_arm-eng] aosp_g8441-userdebug
02:54:24 Build sandboxing disabled due to nsjail error. This may become fatal in the future.
02:54:24 Please let us know why nsjail doesn't work in your environment at:
02:54:24   https://groups.google.com/forum/#!forum/android-building
02:54:24   https://issuetracker.google.com/issues/new?component=381517
[...]
stefan@mars:~/android/source$ rm -r kernel/sony/msm-4.14/
stefan@mars:~/android/source$ rm -r kernel/sony/msm-4.9/common-kernel
stefan@mars:~/android/source$ make clean && make -j4

02:58:02 Entire build directory removed.

#### build completed successfully (2 seconds) ####

02:58:06 Build sandboxing disabled due to nsjail error. This may become fatal in the future.
02:58:06 Please let us know why nsjail doesn't work in your environment at:
02:58:06   https://groups.google.com/forum/#!forum/android-building
02:58:06   https://issuetracker.google.com/issues/new?component=381517
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
TARGET_PRODUCT=aosp_g8441
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a73
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=cortex-a73
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.2.0-2-amd64-x86_64-Debian-GNU/Linux-bullseye/sid
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QP1A.190711.019
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/sony/yoshino
============================================
[ 41% 237/566] including device/sony/common/Android.mk ...
IDisplayConfig version: DISPLAY_CONFIG_1_8
hardware/qcom/media/msm8998/mm-video-v4l2/vidc/venc/Android.mk:64: warning: "venc: PQ compiled out"
[ 99% 565/566] finishing build rules ...
platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module 'NexusLauncherOutOfProcTests' 
platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module 'NexusLauncherDebug' 
platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module 'NexusLauncherTests' 
platform_testing/build/tasks/tests/platform_test_list.mk: warning: platform_tests: Unknown installed file for module 'LauncherRotationStressTest' 
platform_testing/build/tasks/tests/platform_test_list.mk: warning: platform_tests: Unknown installed file for module 'PlatformScenarioTests' 
[100% 566/566] writing build rules ...
FAILED: 
kernel/sony/msm-4.9/kernel/Android.mk:267: error: PHONY target "out/target/product/lilac/kernel" looks like a real file (contains a "/")
03:00:00 ckati failed with: exit status 1

#### failed to build some targets (01:58 (mm:ss)) ####
stefan@mars:~$ make --version
GNU Make 4.2.1
MarijnS95 commented 5 years ago

Inline kernel building doesn't really work anymore because google is blocking external tools to "make builds more reliable" and/or incremental.

You should instead use a prebuilt kernel (which you can of course build yourself with the provided scripts, check my forks for path fixes). I do plan on adding scripts to build the kernel and create a bootable image for these cases. Usually those working on the kernel will want to build and flash this as fast as possible without the heavy aosp build framework.

stefanhh0 commented 5 years ago

Okay thanks a lot for the hint :-) Just included your fork of kernel-sony-msm-4.9-common in my source tree and changed the build-kernels-clang.sh to only build lilac since i don't need the others. Giving it a try that way now.

stefanhh0 commented 5 years ago

Building the kernel worked just fine now. Reverted the sm8150 to sdm845 as you have written in the previous comment. I guess I am now missing some other not yet merged back PRs or msm-4.9 currently is just not working in general with Q. The build now returns following build error after a while:

[ 11% 12305/109461] target  C++: libsdmcore <= hardware/qcom/display/sde/sdm/libs/core/hw_interface.cpp
FAILED: out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/hw_interface.o
/bin/bash -c "PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-r353983c/bin/clang++     -I system/core/base/include -I hardware/qcom/display/sde/sdm/libs/core -I out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates -I out/target/product/lilac/gen/SHARED_LIBRARIES/libsdmcore_intermediates \$(cat out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/import_includes)   -isystem out/target/product/lilac/obj/include -isystem kernel/sony/msm-4.9/common-headers/kernel-headers -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -Wimplicit-fallthrough -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-zero-as-null-pointer-constant -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -fno-operator-names -Wno-unused-parameter -DLOG_TAG=\\\"SDM\\\" -Wno-missing-field-initializers -Wconversion -Wall -Werror -std=c++14 -DUSE_GRALLOC1 -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8 -DUSE_COLOR_METADATA -D__ARM_HAVE_NEON -DMASTER_SIDE_CP -DVIDEO_MODE_DEFER_RETIRE_FENCE -DUSER_DEBUG -isystem external/libdrm -DPP_DRM_ENABLE -D__ANDROID_API__=29 -D__ANDROID_VNDK__ -fPIC -D_USING_LIBCXX -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare -Wno-tautological-unsigned-zero-compare -Wno-c++98-compat-extra-semi -Wno-return-std-move-in-c++11  -MD -MF out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/hw_interface.d -o out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/hw_interface.o hardware/qcom/display/sde/sdm/libs/core/hw_interface.cpp"
In file included from hardware/qcom/display/sde/sdm/libs/core/hw_interface.cpp:38:
hardware/qcom/display/sde/sdm/libs/core/drm/hw_peripheral_drm.h:87:3: error: unknown type name 'drm_msm_ad4_roi_cfg'; did you mean 'drm_msm_ad4_cfg'?
  drm_msm_ad4_roi_cfg ad4_roi_cfg_ = {};
  ^~~~~~~~~~~~~~~~~~~
  drm_msm_ad4_cfg
kernel/sony/msm-4.9/common-headers/kernel-headers/drm/msm_drm_pp.h:224:8: note: 'drm_msm_ad4_cfg' declared here
struct drm_msm_ad4_cfg {
       ^
1 error generated.
04:47:27 ninja failed with: exit status 1

#### failed to build some targets (14:32 (mm:ss)) ####

Well if you have another hint that would be nice, however I can also just wait until you have finished the transitioning to Q.

MarijnS95 commented 5 years ago

@stefanhh0 Looks like you're almost there. You need to check out the display HAL and interfaces back on 7.3, essentially reverting https://github.com/sonyxperiadev/local_manifests/commit/91c8fe586475535c5d64acd35bde8e92468b9dc8, and remove the separate display interface repository https://github.com/sonyxperiadev/local_manifests/commit/52af0a25c9d863179068d912ff1e231639f8de43.

You can do this by hand or by reverting those commits and resync.

Then you need to locally fetch+merge the PR to display and location: https://github.com/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+author%3AMarijnS95+archived%3Afalse+sort%3Aupdated-desc+org%3Asonyxperiadev

stefanhh0 commented 5 years ago

@MarijnS95 thanks a lot for your help!

Build went through now and all img's have been written accordingly. I will flash them later. I have seen that there is an additional boot-debug.img I guess that one should be preferred over boot,img to have more meaningful error reports, correct?

I've applied the changes of your 2 PRs manually since I couldn't figure out the correct git fetch command yesterday. However now I managed it with reading more carefully https://help.github.com/en/articles/checking-out-pull-requests-locally :-) stefan@mars:~/android/source/hardware/qcom/display/sde$ git fetch https://github.com/sonyxperiadev/hardware-qcom-display pull/24/head:PR24 made it...

Cheers, Stefan

stefanhh0 commented 5 years ago

Just another question, a little OT though. Open gapps for android 10 is not yet available (download is still greyed out), have you any experience whether or not open gapps 9 will work together with android 10?

MarijnS95 commented 5 years ago

@stefanhh0 I haven't noticed boot-debug.img, and not missed anything. Probably safe to stick to boot.img, or check the AOSP documentation what this image does.

Opengapps requires a few modifications. I built it in the tree (see their aosp_build project) to have system.img with the base (pico package) preinstalled. It needs a bunch of "core" apks on API 29, extra permissions, and an extra package+Android.mk for the new permissionmanager (though the AOSP one seems to work just fine as well). I'll see about pushing + PRing this later, maybe. Or we wait for the opengapps team to fix it.

stefanhh0 commented 5 years ago

boot-debug.img is required for user builds only for being able to use root user (adb root) see as well: https://source.android.com/compatibility/vts/vts-on-gsi

Since I am always building userdebug and not user it is not relevant.

Regarding opengapps I will just wait until it is available. Tried it with including pico in the source tree as explained in https://github.com/opengapps/aosp_build a few days ago but it was failing probably due to the missing changes you have mentioned.

MarijnS95 commented 5 years ago

Ah, that's good to know if we ever do user builds somewhere.

https://github.com/MarijnS95/opengapps_aosp_build is what you can use to build it. Furthermore you need to add packageinstaller and setupwizard from a Q device (Pixel). Be sure to also add permissionscontroller or remove the dependency from opengapps-packages.mk (revert my last commit in aosp_build).

GitHub doesn't allow copy-pasting, so here are the permission diffs you can apply to `sources/all` ```diff diff --git a/etc/permissions/privapp-permissions-google.xml b/etc/permissions/privapp-permissions-google.xml index 0b46f07..2d2e5cd 100644 --- a/etc/permissions/privapp-permissions-google.xml +++ b/etc/permissions/privapp-permissions-google.xml @@ -81,12 +81,14 @@ It allows additional grants on top of privapp-permissions-platform.xml + - - + + + @@ -297,6 +299,7 @@ It allows additional grants on top of privapp-permissions-platform.xml + @@ -305,7 +308,7 @@ It allows additional grants on top of privapp-permissions-platform.xml - + @@ -331,12 +334,16 @@ It allows additional grants on top of privapp-permissions-platform.xml + + + + @@ -437,14 +444,25 @@ It allows additional grants on top of privapp-permissions-platform.xml + + + + + + + + + + + - + - - + + @@ -488,11 +506,12 @@ It allows additional grants on top of privapp-permissions-platform.xml - + + @@ -576,10 +595,14 @@ It allows additional grants on top of privapp-permissions-platform.xml + + + + ```
stefanhh0 commented 5 years ago

I've switched to use your opengapps_aosp_build repo instead and applied the patch.

Regarding the packages I've defined following in device/sony/lilac/device.mk:

GAPPS_VARIANT := pico

GAPPS_PRODUCT_PACKAGES += \
    GooglePackageInstaller \
    GooglePermissionController \
    SetupWizard

Downloaded following apks:

And created some folders and copied the apks to those folders:

$ cp com.google.android.packageinstaller_10-5489447-28_minAPIQ\(nodpi\)_apkmirror.com.apk vendor/opengapps/sources/all/priv-app/com.google.android.packageinstaller/29/nodpi/29.apk
$ cp com.google.android.pixel.setupwizard_10-28_minAPIQ\(nodpi\)_apkmirror.com.apk vendor/opengapps/sources/all/priv-app/com.google.android.setupwizard/29/nodpi/29.apk
$ cp com.google.android.permissioncontroller_29_system_image-200000000_minAPI28\(nodpi\)_apkmirror.com.apk vendor/opengapps/sources/arm64/app/com.google.android.permissioncontroller/28/nodpi/28.apk

I am not so sure if that is all correct therefore I am posting it, at least aosp 10 with opengapps included is currently building and had no error yet :-)

jerpelea commented 5 years ago

we do not support or provide opengapps

MarijnS95 commented 5 years ago

@stefanhh0 You can put the configuration in device/sony/customization/customization.mk to have it across all devices.

As for the APKs; I have taken them directly from a GSI for pixel. Back when I checked all those "hosts" still had apks for SDK version Q (the preview) instead of 29. You can check this with aapt dump badging.

Other than that you copied permissioncontroller to a folder/file named 28, and there being a 28_minAPK in the source file names.

stefanhh0 commented 5 years ago

@jerpelea sorry for being off-topic here with the opengapps. I guess re-opening the issue was not intended, right? I am closing it again.

@MarijnS95 thanks for the hints, moved the config to the customization make file. Regarding the APKs, I've downloaded the sargo image: 10.0.0 (QP1A.190711.020, Sep 2019) from: https://developers.google.com/android/images mounted the images in /mnt and found all three APKs:

/mnt/system/system/priv-app/GooglePackageInstaller/GooglePackageInstaller.apk
/mnt/system/system/priv-app/GooglePermissionControllerPrebuilt
/mnt/product/priv-app/PixelSetupWizard/PixelSetupWizard.apk

I found as well a /mnt/product/overlay/GooglePermissionControllerOverlay.apk, but I guess that is just a special customization that I don't need, correct?

Verified with the aapt command that they all show sdkVersion:'29'.

So now I am nearly ready to go. However I've seen that yoshino was switched to 4.14 kernel a few hours ago and a new oem.img is required in case I want to flash. Do you already know when that will be released? Looking forward to it!

Kind regards, Stefan

MarijnS95 commented 5 years ago

@stefanhh0 I've taken them from a crosshatch image, but sargo should be okay/equivalent. I can't remember PixelSetupWizard, I used SetupWizardPrebuilt which should also be in the image.

As for the kernel, manually switch it back to 4.9 for now. I've been doing the Q transition (not entirely on my own, thank Felix for a lot of continued research and commits during the preview stages) simultaneously to Alin and the rest doing 4.14, and due to time constraints we basically had to merge the two together without creating Android-10 4.9 compatibility branches (even though reverting a few things and putting that on a separate branch won't be too much work...). We will see when the new oem image drops, but I doubt it will be immediately stable and complete seeing how much work goes into supporting 18 devices across 7 different platforms. If you want to use your Lilac as DD, stick with 4.9 for now. If there's anything, you can always ask me; I'll be building 4.9 on Android 10 for a DD as long as necessary.

stefanhh0 commented 5 years ago

Okay, switching to the SetupWizardPrebuilt.apk then, it is as well in the sargo image... Good to know with the kernel I'll stick then to 4.9 for the time being.

stefanhh0 commented 5 years ago

When calling ./repo_sync I've observed two warnings:

[detached HEAD ddbc17b] Restore pn547 support
 Author: Humberto Borba <humberos@omnirom.org>
 Date: Sat Sep 1 21:24:56 2018 -0300
 7 files changed, 133 insertions(+), 80 deletions(-)
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 5475 and retry the command.
[detached HEAD f8c0134c2ce] fwb: Add check for odm version
 Author: Christian Oder <myself5@carbonrom.org>
 Date: Thu Aug 9 14:27:35 2018 +0200
 1 file changed, 10 insertions(+)
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 5475 and retry the command.
jerpelea commented 5 years ago

the first release is an alpha release and it is intended to be used to fix kernel bugs since many features are buggy or not implemented

MarijnS95 commented 5 years ago

@stefanhh0 Pretty sure that the second warning belongs to the followup fwb commit. It's nothing fatal, just that there have been too many file changes inbetween the cherry-picked commit and your HEAD, making git unable to combine a remove+add into a rename if the contents are equal for a certain percentage. Doesn't matter, since there are no changes to moved files.

stefanhh0 commented 5 years ago

Wyzco pointed out that there is a SW_binaries_for_Xperia_Android_10.0.7.1_r1_v1a_yoshino.img so I have build yesterday the android-10 as is, which worked fine and flashed it, unfortunately the phone was stuck on the white sony logo when I tried to boot into it, so I couldn't get any logs from that build (tried to boot several times). I am aware that this is all at a very early experimental state ;-)

Since I had an android-10 build from 19th with 4.9 kernel, flashed that one as well today alongside with the SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_yoshino.img. It booted a little better and I had some logcat output with different errors. Haven't saved it because I thought okay, go on try a new build.

So I tried to build android-10 with current sources but it failed here:

[ 13% 14715/109599] target  C++: libsdmcore <= hardware/qcom/display/sde/sdm/libs/core/drm/hw_scale_drm.cpp
FAILED: out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/drm/hw_scale_drm.o
/bin/bash -c "PWD=/proc/self/cwd /usr/bin/ccache prebuilts/clang/host/linux-x86/clang-r353983c/bin/clang++      -I system/core/base/include -I hardware/qcom/display/sde/sdm/libs/core -I out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates -I out/target/product/lilac/gen/SHARED_LIBRARIES/libsdmcore_intermediates \$(cat out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/import_includes)   -isystem out/target/product/lilac/obj/include -isystem kernel/sony/msm-4.9/common-headers/kernel-headers -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -Wimplicit-fallthrough -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-zero-as-null-pointer-constant -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -fno-operator-names -Wno-unused-parameter -DLOG_TAG=\\\"SDM\\\" -Wno-missing-field-initializers -Wconversion -Wall -Werror -std=c++14 -DUSE_GRALLOC1 -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8 -DUSE_COLOR_METADATA -D__ARM_HAVE_NEON -DMASTER_SIDE_CP -DVIDEO_MODE_DEFER_RETIRE_FENCE -DUSER_DEBUG -isystem external/libdrm -DPP_DRM_ENABLE -D__ANDROID_API__=29 -D__ANDROID_VNDK__ -fPIC -D_USING_LIBCXX -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare -Wno-tautological-unsigned-zero-compare -Wno-c++98-compat-extra-semi -Wno-return-std-move-in-c++11  -MD -MF out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/drm/hw_scale_drm.d -o out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/drm/hw_scale_drm.o hardware/qcom/display/sde/sdm/libs/core/drm/hw_scale_drm.cpp"
hardware/qcom/display/sde/sdm/libs/core/drm/hw_scale_drm.cpp:126:11: error: no member named 'dir_weight' in 'sde_drm_scaler_v2'; did you mean 'dst_height'?
  scaler->dir_weight = scale_data.dir_weight;
          ^~~~~~~~~~
          dst_height
kernel/sony/msm-4.9/common-headers/kernel-headers/drm/sde_drm.h:103:12: note: 'dst_height' declared here
  uint32_t dst_height;
           ^
1 error generated.
[ 13% 14717/109599] target  C++: libsdmcore <= hardware/qcom/display/sde/sdm/libs/core/drm/hw_device_drm.cpp
FAILED: out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/drm/hw_device_drm.o
/bin/bash -c "PWD=/proc/self/cwd /usr/bin/ccache prebuilts/clang/host/linux-x86/clang-r353983c/bin/clang++      -I system/core/base/include -I hardware/qcom/display/sde/sdm/libs/core -I out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates -I out/target/product/lilac/gen/SHARED_LIBRARIES/libsdmcore_intermediates \$(cat out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/import_includes)   -isystem out/target/product/lilac/obj/include -isystem kernel/sony/msm-4.9/common-headers/kernel-headers -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -Wimplicit-fallthrough -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-zero-as-null-pointer-constant -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -march=armv8-a -mcpu=cortex-a53 -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin  -Wsign-promo -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden  -std=gnu++17   -fno-rtti -fno-operator-names -Wno-unused-parameter -DLOG_TAG=\\\"SDM\\\" -Wno-missing-field-initializers -Wconversion -Wall -Werror -std=c++14 -DUSE_GRALLOC1 -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8 -DUSE_COLOR_METADATA -D__ARM_HAVE_NEON -DMASTER_SIDE_CP -DVIDEO_MODE_DEFER_RETIRE_FENCE -DUSER_DEBUG -isystem external/libdrm -DPP_DRM_ENABLE -D__ANDROID_API__=29 -D__ANDROID_VNDK__ -fPIC -D_USING_LIBCXX -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare -Wno-tautological-unsigned-zero-compare -Wno-c++98-compat-extra-semi -Wno-return-std-move-in-c++11  -MD -MF out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/drm/hw_device_drm.d -o out/target/product/lilac/obj/SHARED_LIBRARIES/libsdmcore_intermediates/drm/hw_device_drm.o hardware/qcom/display/sde/sdm/libs/core/drm/hw_device_drm.cpp"
hardware/qcom/display/sde/sdm/libs/core/drm/hw_device_drm.cpp:215:30: error: use of undeclared identifier 'DRM_FORMAT_MOD_QCOM_TILE'
      *drm_format_modifier = DRM_FORMAT_MOD_QCOM_TILE;
                             ^
hardware/qcom/display/sde/sdm/libs/core/drm/hw_device_drm.cpp:235:30: error: use of undeclared identifier 'DRM_FORMAT_MOD_QCOM_TILE'
      *drm_format_modifier = DRM_FORMAT_MOD_QCOM_TILE |
                             ^
hardware/qcom/display/sde/sdm/libs/core/drm/hw_device_drm.cpp:245:30: error: use of undeclared identifier 'DRM_FORMAT_MOD_QCOM_TILE'
      *drm_format_modifier = DRM_FORMAT_MOD_QCOM_TILE |
                             ^
3 errors generated.
09:11:01 ninja failed with: exit status 1

For building it I use a hand-made script to adjust the required things, maybe there is an easy fix for the problem available? If not, that would be totally okay, then I just wait a little longer for 4.14 :-)

jerpelea commented 5 years ago

android 10 build guide is not out ! the binaries are alpha and should be used for kernel fixes !

MarijnS95 commented 5 years ago

@stefanhh0 I don't know why @wyzco would tell you that, because it's an internal preview for kernel 4.14. Afaik it's not supposed to be shared around since it's an early alpha (hence the a) release, only to be used by those interested in contributing to k4.14 :man_shrugging: I would say the Android_10.0 is only in there to indicate what tree it has been compiled/tested against since there's not much if anything specific. As you know the Android 9 blobs (for kernel 4.9...) work perfectly fine on Android 10.

Your script is not setting the display repository back to the 7.3 branch like you've done earlier this week, hence the error (and don't forget the other repos as said earlier this week).

stefanhh0 commented 5 years ago

@MarijnS95, yes I've forgotten to include the 7.3 changes in the script I have moved them now to my local_manifests.patch:

.repo/local_manifests$ git diff

```patch diff --git a/qcom.xml b/qcom.xml index 7077e28..402bc23 100644 --- a/qcom.xml +++ b/qcom.xml @@ -9,7 +9,7 @@ - + @@ -21,8 +21,7 @@ - - + ```

Also updated the build.sh to also include most of your PRs I have checked via git log that the cherry-picking works as expected... Although the conflict resolving needed to be a little harsh because of a conflict I've encountered.

Now it stops here:

FAILED: ninja: 'out/target/product/lilac/obj_arm/HEADER_LIBRARIES/display_intf_headers_gralloc1_intermediates/export_includes', needed by 'out/target/product/lilac/obj_arm/SHARED_LIBRARIES/libOmxVdec_intermediates/import_includes', missing and no known rule to make it
MarijnS95 commented 5 years ago

More changes have trickled in over time. this is holding your build back right now.

stefanhh0 commented 5 years ago

Device: Lilac Platform: Yoshino Kernel version: 4.9.189-gf407e2b59108 Android version: android-10.0.0_r1 Software binaries version: SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_yoshino.zip Version baseband: 1308-8921_47.1.A.16.20 Build: aosp_g8441-userdebug 10 QP1A.190711.019 eng.stefan.20190921.201435

Succesfully build it, flashed it and booted into it. Since the build with opengapps was pretty unstable, I've decided to give it a try with pure aosp. However it is as well not very stable. Additionally when I have to enter the SIM PIN the display is very slow, after I manage to log in, the display reacts then normally until the phone reboots.

I have pulled several files: dmesg after boot a: dmesg.log logcat after boot a: logcat.log pstore from crash from a boot before a: pstore.tar.gz pstore from another crash after boot a: pstore-2.tar.gz

dmesg after boot b: dmesg-2.log logcat after boot b until the phone crashed and rebooted: logcat-2.log pstore after the crash from boot b: pstore-3.tar.gz

stefanhh0 commented 5 years ago

@MarijnS95 I am now back to aosp 9r46, since 10 is not yet usable for me. However if you want me to test more just let me know. I have learned quite a few things during this session and with my new script it is easy to include various pull requests from you and others :-) Thanks a lot for your continuous support!

Cheers, Stefan

MarijnS95 commented 5 years ago

@stefanhh0 Unfortunately there's nothing obvious in the logs pointing to a crash, apart FPC gestures being very close to the end of the logs. I don't know if you are cherry-picking them to test the feature (and have been using it before on Android 9) or because I mentioned taking in a couple PRs of mine.

In the latter case I observed a similar pattern on other devices. Somehow the high frequency or contents of TA calls (to the fingerprint trust-app) trip something in the TZ, crashing the entire system. Unfortunately without the usual stacktrace that shows up in pstore.

In any case you don't need most of my PRs to run 10 anymore (most have been merged), those are just open for testing/discussion (or have yet to be reworked). I am glad to see them tested, but let's bring it down to a minimal running state for Q. If that works we have yet another reason why Sony has not provided fingerprint gestures on any phone so far. All you really need is the PR to transpower, that fixes telephony related crashes that leave you without any mobile capabilities whats however (on some phones - somehow this wasn't fatal on Tama). The rest is for 4.14 or fluff and can be safely dropped.

Finally, naming of opengapps apks. You seem to be copying them to the target directory, leaving the name of the file. Instead, opengapps uses either the sdk number (29), sometimes with a 2 prepended (229) and in other cases the entire version number. I haven't checked which codepath is used and whether this makes a large difference (the shell script is inherently annoying to debug), but the easiest is to check the sdk version of the relevant apps in the output directory with aapt badging again (relevant packages are in out/target/product/lilac/system/{product/,}/priv-app/).

stefanhh0 commented 5 years ago

@MarijnS95 so finally I am there and AOSP 10 is running with 4.9 kernel and opengapps fine on my phone.

Updated the build script in https://github.com/sonyxperiadev/bug_tracker/issues/456#issuecomment-533792254 accordingly and only pulling in the one open PR regarding transpower from you.

Additionally regarding opengapps, fixed the copying of the apk's and verified it via aapt dump badging in the out folder. So it seems to be always the versionCode that the apks have to be named to.

It wasn't even required to clear my userdata in order to getting aosp 10 running, thats pretty cool!

It crashed once though already. But not so sure if that is really because of 10 or a general problem of the kernel I am using, since I've also reported crashes on 9 and it was again one of those when the double reboots happen.

An android 10 issue seems to be when entering the SIM PIN. The display takes the input very slow... there seems to be an unfixed issue with that, can you confirm that?

Btw. you mentioned once in another thread that you may going to setup android 10 branches with Kernel 4.9 and also Alin told us it may take very long to stabilize 4.14. It would be pretty nice if you can afford the capacity to setup 4.9 kernel together with android 10.

Is it okay to open already new aosp 10 bugs if I encounter them with my current constellation?

Thanks again I am happy that I finally got android 10 working for me!

Cheers, Stefan

MarijnS95 commented 5 years ago

@stefanhh0 Great to hear!

Is there anything odd in the logs? Does turning the screen off and on change the situation? Does the slowness persist anywhere else in the system? I have not encountered it yet on any of the devices tested. Unfortunately I don't own a Yoshino, though I seriously doubt that particular device with Android 10 specifically runs into such an odd issue. I strongly doubt it's framework/systemui related if the rest works flawless, so perhaps something happens in RIL. But then, the PIN is only sent off when clicking ok, not a second earlier...

I can set up a manifest branch with references to forks, and revert everything related to 4.14. After all I'll be running the same setup for the coming months, until 4.14 becomes stable enough to use on a daily driver. However, it's going to be quite a PITA since I have a ton of in-progress features locally and some on forks. Expect hit-and-miss when it comes to forgetting a commit here and there, or keeping it updated every day. I won't be able to test that exact configuration, which is exactly the reason why Alin is holding off yet another branch that we need to keep in working order.

I'll see about adding it in the next 2-3 days, depending on my schedule.

As for bugs, I think everyone is fine reporting them on the bug_tracker as long as the kernel and Android version are included. That way we can more easily figure out where the issue is. It's a big thing to ask, but it would be awesome if you (and anyone else for that matter) could check around for PRs on the repositories here before reporting, maybe the issue has already been found and fixed.

stefanhh0 commented 5 years ago

Regarding the slowness I'll keep your questions in mind and will go through it soon... it happens only when entering the SIM PIN... afterwards everything runs at normal speed. So, all in all it is kind of harmless thing and not a big issue. Well, anyway I'll then open a separate issue with logs and so forth since this thread is closed anyway and already a little cluttered.

Would be really cool with the xtra branches. I'd try to help in testing it anyway since I like to build fresh things. I have setup CCACHE_EXEC for faster results when rebuilding. For now I just try to keep up with the changes and update my build.sh accordingly whenever required.

I try to keep an eye on what is being done and what is in progress in order to not cause too much noise for you all.

stefanhh0 commented 5 years ago

Does turning the screen off and on change the situation?

Yes, it seems to be the workaround :-)

One more question, I know again off-topic as with opengapps. Are you running successfully Magisk and/or TWRP. While TWRP works in general, it seems not to be able to mount the aosp 10 partitions any longer. Thus I can't install Magisk. Well not too much of an issue but I like the AdAway programm to filter all the rubbish in the web :-)

MarijnS95 commented 5 years ago

I hope you saved a dmesg+logcat so that we can see if drm/composer is screaming like crazy :grin: That said, I don't remember if the screen blanks after entering the sim pin. If it does, the screen might very well do the same in the entire UI when booting without SIM-card.

Well, no clean builds here and definitely no clean checkouts (installclean is as far as it goes). When testing and implementing there's not much time to do fresh builds every time (and a 56-core beast is not in my possession) and I can't risk loosing the tons of branches all around. I'll keep your build script in mind when creating the branches/repo_update, to cross-check whether I have everything :wink:

I haven't bothered to flash/boot TWRP since owning Android 10 (I would build it locally back when using Omnirom), and install Magisk the "hard" way. Cutting corners, as I usually either push the built bootimage or dd if=/dev/block/by-name/boot_a of=/sdcard/boot.img bs=1M (eventually with count=30M). Patch this installed bootimage from the Magisk Manager app, then the other way around: dd if=/sdcard/Download/magisk_patched.img of=/dev/block/by-name/boot_a bs=1M, and reboot.

stefanhh0 commented 5 years ago

@MarijnS95, Btw. tried several approaches to get that magisk running but it somehow likes to truncate the boot.img at around 15M when trying the dd approach. also patching the sparse boot.img from the build and then flashing that one leads to a none booting system.

However although I have installed the apk from Magisk-v19.4.zip, the Magisk Manager apk itself uses then surprisingly Magisk-v19.3.zip to patch the img. I guess that is the problem... Well, just wanted to to let you know. I try to get it patched by hand using Magisk-v19.4 and/or I am going to ask the devs from magisk about it.

MarijnS95 commented 5 years ago

@stefanhh0 Do you mean the initial bootimage (that you either acquire with dd if=/dev/block/by-name/boot_a of=/sdcard/boot.img or adb push out/target/product/lilac/boot.img sdcard), or the image that results from Magisk?

Don't worry about the number. Someone found it a good idea to not store the version in the git repository. I compile Magisk myself, and always have to check what the most recent version is and fill that in the untracked config.prop file. I bet they simply forgot to update it. I've built it quite a few times over the past weeks, and every build from master worked fine.

stefanhh0 commented 5 years ago

I've updated the build.sh and published it here: https://github.com/stefanhh0/aosp-10/blob/master/build.sh

@MarijnS95 I tried now a canary build from magisk, with that one I was able to patch my boot.img successfully.