[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Markus-E:
I am trying to follow the build instructions of the OP in order to build LineageOS for the XZ2C on my Debian-buster-system.

After syncing LineageOS with

repo init -u [...]://github.com/LineageOS/android.git -b lineage-17.1
repo sync

and creating .repo/local_manifests/tama.xml with the stated content, I am experiencing issues with the following commands:

". build/envsetups.sh" fails with a file not found error and I execute ". build/envsetup.sh" instead.

"lunch xz2c-userdebug" fails with the message

15:42:29 Build sandboxing disabled due to nsjail error.
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "xz2c".
15:42:29 dumpvars failed with: exit status 1
Device xz2c not found. Attempting to retrieve device repository from LineageOS Github ([...]://github.com/LineageOS).
Found repository: android_device_sony_xz2c
Default revision: lineage-17.1
Checking branch info
Checking if device/sony/xz2c is fetched from android_device_sony_xz2c
Adding dependency: LineageOS/android_device_sony_xz2c -> device/sony/xz2c
Using default branch for android_device_sony_xz2c
Syncing repository to retrieve project.
fatal: duplicate path device/sony/xz2c in /srv/lineageOS/.repo/manifest.xml
Repository synced!
Looking for dependencies in device/sony/xz2c
device/sony/xz2c has no additional dependencies.
Done
15:42:31 Build sandboxing disabled due to nsjail error.
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "xz2c".
15:42:31 dumpvars failed with: exit status 1
15:42:31 Build sandboxing disabled due to nsjail error.
build/make/core/product_config.mk:223: error: Can not locate config makefile for product "xz2c".
15:42:31 dumpvars failed with: exit status 1

** Don't have a product spec for: 'xz2c'
** Do you have the right repo manifest?

The error message brought me to [...]://stackoverflow.com/a/42150660 which instructs me to create an "AndroidProducts.mk" file that should match my "vendorsetup.sh".

Now I can not find a "verdorsetup.sh" in the lineageOS tree.

I did some experiments and created different versions of "device/AndroidProducts.mk" with references to xz2c.mk and lineage_xz2c.mk but had no success executing the "lunch" command.

According to [...]://lineageosrom.com/2017/01/how-to-build-lineageos-rom-for-any.html this command might go wrong for some devices that "require a vendor directory to be populated before breakfast" and I tried downloading the vendor files with

git clone [...]://github.com/sony-sdm845/proprietary_vendor_sony.git vendor/sony

but the lunch command still produces errors.

At this point I am stuck, because I have no additional ideas how to proceed and I would like to ask if someone could point me in the right direction in order to compile LineageOS for the XZ2C.

I am also wondering about

fatal: duplicate path device/sony/xz2c in /srv/lineageOS/.repo/manifest.xml

After executing "lunch xz2c-userdebug" there appeared an additional file ".repo/local_manifests/roomservice.xml" containing also a reference to name="LineageOS/android_device_sony_xz2c" path="device/sony/xz2c" remote="github".

Can I safely ignore this message or should I adjust tama.xml accordingly?