I am trying to compile pure aosp sourceand keep getting theese two errors. I am using the lineage vendor files and am using aosp device trees P.S. I'm using a live system but the issue is that there are two undefined methods
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
TARGET_PRODUCT=aosp_trlte
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-7634-generic-x86_64-Pop!_OS-20.04-LTS
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
============================================
[ 43% 49/113] compile out/soong/.bootstrap/soong-lineage-generator/pkg/lineage/soong/generator.a
FAILED: out/soong/.bootstrap/soong-lineage-generator/pkg/lineage/soong/generator.a
GOROOT='prebuilts/go/linux-x86' prebuilts/go/linux-x86/pkg/tool/linux_amd64/compile -c 8 -o out/soong/.bootstrap/soong-lineage-generator/pkg/lineage/soong/generator.a.tmp -p lineage/soong/generator -complete -I out/soong/.bootstrap/blueprint-parser/pkg -I out/soong/.bootstrap/blueprint-deptools/pkg -I out/soong/.bootstrap/blueprint-pathtools/pkg -I out/soong/.bootstrap/blueprint-proptools/pkg -I out/soong/.bootstrap/blueprint/pkg -I out/soong/.bootstrap/soong/pkg -I out/soong/.bootstrap/blueprint-bootstrap-bpdoc/pkg -I out/soong/.bootstrap/blueprint-bootstrap/pkg -I out/soong/.bootstrap/soong-env/pkg -I out/soong/.bootstrap/soong-android/pkg -I out/soong/.bootstrap/soong-shared/pkg -pack vendor/lineage/build/soong/generator/generator.go vendor/lineage/build/soong/generator/variables.go && if cmp --quiet out/soong/.bootstrap/soong-lineage-generator/pkg/lineage/soong/generator.a.tmp out/soong/.bootstrap/soong-lineage-generator/pkg/lineage/soong/generator.a; then rm out/soong/.bootstrap/soong-lineage-generator/pkg/lineage/soong/generator.a.tmp; else mv -f out/soong/.bootstrap/soong-lineage-generator/pkg/lineage/soong/generator.a.tmp out/soong/.bootstrap/soong-lineage-generator/pkg/lineage/soong/generator.a; fi
vendor/lineage/build/soong/generator/generator.go:124:48: ctx.Config().BuildOSTarget undefined (type android.Config has no field or method BuildOSTarget)
vendor/lineage/build/soong/generator/generator.go:229:38: undefined: android.PathForSourceRelaxed
03:19:35 soong bootstrap failed with: exit status 1
#### failed to build some targets (2 seconds) ####
I'm building with similar parameters (AOSP base, LOS device, common board and kernel trees and using
vendor/lineageto get some configs). I faced thiserroronly:After some investigation, I've found out that
PathForSourceRelaxedis a function defined on LOS build/soong/android/paths.go in this commit.About
BuildOSTarget, I've found it defined on build/soong/android/config.go, included on this commit. However, when I look atAOSP 11.0.0_r24tag source code, it's already there (it's the tag I'm using as base).EDIT:
One possible way to include these commits in your AOSP base would be to follow this gist. Basically, you'll do this:
cd project_you_need_fixesso you go to the correct project;git remote addto add the remote for the project (personally I like to use it like this:git remote add git@github:someone/somerepo -t branch_i_wish_to_clonebecause you can track just one branch if you wish with the-tflag) ;git fetch --allto make sure you fetch everything;git branch --track local_branch_name_of_the_one_you_want_to_track remote_you_just_added/branch_you_want_to_trackto create the branch;git pullso you merge the fetched changes if any.Then you need to cherry-pick the commit(s) you need to solve your issues. In case of
PathForSourceRelaxed, it would need to cherry-pick from LOS repo:git statusorgit branchto make sure you're at your branch, not the one you fetched from LOS;git cherry-pick 191bf4e250d097995a2d55e5ca464ffd022b5baa(considering you fetchedlineage-18.1branch.