[OnePlus 3 Guides, News, & Discussion] arnabJ:
Update 1:

Bad luck. I too got stuck at making cache.img.

I got printname too large error. Probably cache.img size error as stated by @HolyAngel.

I have approximately 250GB of free HDD space left just in case it may be of some help to know.

I will now try to search for such an issue and try to fix if I get some fix related to it.

If someone knows anything regarding this and can shed some light on how to get past this it would be really appreciated.

Heres the whole error message:

14 warnings generated.
[ 55% 46381/83932] Target cache fs image: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
FAILED: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
/bin/bash -c "(mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache ) && (mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates && rm -rf /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"ext_mkuserimg=mkuserimg.sh\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"fs_type=ext4\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"system_size=3154116608\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"userdata_size=57436708864\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_fs_type=f2fs\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_size=268435456\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"extfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"squashfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"selinux_fc=/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"skip_fsck=true\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:\$PATH ./build/tools/releasetools/build_image.py /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/system ) && (size=\$(for i in /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img; do stat --format \"%s\" \"\$i\" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo \"\$size\" ) )); printname=\$(echo -n \"/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img\" | tr \" \" +); img_blocksize=270336; twoblocks=\$((img_blocksize * 2)); onepct=\$(((((276824064 / 100) - 1) / img_blocksize + 1) * img_blocksize)); reserve=\$((twoblocks > onepct ? twoblocks : onepct)); maxsize=\$((276824064 - reserve)); echo \"\$printname maxsize=\$maxsize blocksize=\$img_blocksize total=\$total reserve=\$reserve\"; if [ \"\$total\" -gt \"\$maxsize\" ]; then echo \"error: \$printname too large (\$total > [276824064 - \$reserve])\"; false; elif [ \"\$total\" -gt \$((maxsize - 32768)) ]; then echo \"WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)\"; fi )"
error: failed to build /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img from /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache
Running: mkf2fsuserimg.sh /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img 268435456
in mkf2fsuserimg.sh PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:/usr/lib/jvm/java-8-openjdk-amd64/bin:/home/arnabj/Android/AOSP/LineageOS15/out/soong/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/development/scripts:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/devtools/tools:/home/arnabj/Android/AOSP/LineageOS15/external/selinux/prebuilts/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/android-emulator/linux-x86_64:/home/arnabj/bin:/home/arnabj/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
make_f2fs -l 268435456 /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
[ 55% 46386/83932] ld /home/arnabj/Android/AOSP/LineageOS15/out/soong/.intermediates/external/protobuf/aprotoc/linux_x86_64/aprotoc
ninja: build stopped: subcommand failed.
15:58:23 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
make: Leaving directory '/home/arnabj/Android/AOSP/LineageOS15'

#### make failed to build some targets (04:37:46 (hh:mm:ss)) ####

Original:

Just an update.

Hoping for the best.

I am using Akhilnarang's device sources (kernel & vendor included).

I have replaced hardware_qcom_xyz / hardware_qcom_xyz-caf with hardware_qcom_xyz from Official LineageOS repo instead of that from dianlujitao as posted by HolyAngel.

Also I have cherry picked the required commit in vendor/oneplus3 as stated by inflames91.

The build is under process.

I am already at 52% with 44333 files out of 83932.

As per HolyAngel he/she got stuck at ~35k lines.

I am currently at ~45k lines.

Which is surely better.

I am completely noob on all these things.

I am just reading through different guides and posts here to try to build.

Wish me luck and give suggestions if you think it will be useful for me.