[Android Software Development] DavidXanatos:
Where is that script?

And what flags need to be removed?

I managed to compile it using cm-13 sources finally, but the process its not pretty.

to my successfully compiled CM-13 tree (stable/cm-13.0-ZNH5Y) I added a line to roomservice.xml with the TWRP repo https://github.com/MoKee/android_bootable_recovery-twrp/tree/mkm

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_oppo_common" path="device/oppo/common" remote="github" revision="stable/cm-13.0-ZNH5Y" />
<project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="github" revision="stable/cm-13.0-ZNH5Y" />

<project name="MoKee/android_bootable_recovery-twrp" path="bootable/recovery-twrp" remote="github" revision="mkm" />

<project name="TheMuppets/proprietary_vendor_oneplus" path="vendor/oneplus" remote="github" revision="stable/cm-13.0-ZNH5Y" />
<project name="CyanogenMod/android_device_oneplus_oneplus3" path="device/oneplus/oneplus3" remote="github" revision="stable/cm-13.0-ZNH5Y" />
<project name="CyanogenMod/android_kernel_oneplus_msm8996" path="kernel/oneplus/msm8996" remote="github" revision="stable/cm-13.0-ZNH5Y" />

<project name="CyanogenMod/android_external_sony_boringssl-compat" path="external/sony/boringssl-compat" remote="github" revision="stable/cm-13.0-ZNH5Y" />
<project name="CyanogenMod/android_external_stlport" path="external/stlport" remote="github" revision="stable/cm-13.0-ZNH5Y" />

<project name="CyanogenMod/android_vendor_nxp-nfc_opensource_Nfc" path="vendor/nxp-nfc/opensource/Nfc" remote="github" revision="stable/cm-13.0-ZNH5Y" />
<project name="CyanogenMod/android_vendor_nxp-nfc_opensource_frameworks" path="vendor/nxp-nfc/opensource/frameworks" remote="github" revision="stable/cm-13.0-ZNH5Y" />
<project name="CyanogenMod/android_vendor_nxp-nfc_opensource_libnfc-nci" path="vendor/nxp-nfc/opensource/libnfc-nci" remote="github" revision="stable/cm-13.0-ZNH5Y" />
</manifest>

and after repo sync --force-sync I changed the boardconfig.mk for my op3, replacing the original recovery section with

# TWRP-Recovery
BOARD_HAS_LARGE_FILESYSTEM := true
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true

RECOVERY_VARIANT := twrp
BOARD_HAS_NO_REAL_SDCARD := true
TW_THEME := portrait_hdpi
RECOVERY_SDCARD_ON_DATA := true
TARGET_RECOVERY_QCOM_RTC_FIX := true
TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
TW_EXTRA_LANGUAGES := true
TW_INCLUDE_CRYPTO := true
TW_DEFAULT_BRIGHTNESS := 80
TW_INCLUDE_NTFS_3G := true

Than I copyed the recovery sub fodler + the https://github.com/dianlujitao/android_device_oneplus_oneplus3/tree/twrp	recovery.fstab into the folder containing the boardconfig.mak

Than I deleted recovery.img and the recovery subfolter from the build output directory and ran

source build/envsetup.sh

brunch oneplus3

I did not run make clobber to ensure already compiled kernel stuff wont be recompiled as that would take a long time.

After creating the recovery.img with TWRP the build aborts

Installing recovery patch to system partition
Traceback (most recent call last):
File "./build/tools/releasetools/make_recovery_patch", line 55, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/make_recovery_patch", line 37, in main
OPTIONS.info_dict = common.LoadInfoDict(input_dir)
File "/home/me/Android/cm-13.0/build/tools/releasetools/common.py", line 201, in LoadInfoDict
d["fstab"] = LoadRecoveryFSTab(read_helper, d["fstab_version"], d["device_type"])
File "/home/me/Android/cm-13.0/build/tools/releasetools/common.py", line 285, in LoadRecoveryFSTab
raise ValueError("malformed recovery.fstab line: \"%s\"" % (line,))
ValueError: malformed recovery.fstab line: "/boot	emmc	/dev/block/bootdevice/by-name/boot"
make: *** [build/core/Makefile:1102: /home/me/Android/cm-13.0/out/target/product/oneplus3/system/bin/install-recovery.sh] Error 1
make: Leaving directory '/home/me/Android/cm-13.0'

but that is some later step apparently to integrate it somehow into the CM build so it does not matter that much its just not elegant!

The created recovery.img works fine on my op3 I could enter decryption password and make a backup of my device to a USB drive.

But anyhow I would like to solve the error posted above to ma be have a tree that builds cm and twrp in one go without any issues.