[Android] DiamondJohn:
I have no solution, but if its was me, to maybe help narrow down the source of the error, I would do the following.

The error is triggered by the command that occurs on the "FAILED:" line.

FAILED: /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes-full-debug.jar
/bin/bash -c "
(rm -f /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes-full-debug.jar )
&& (rm -rf /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/anno )
&& (mkdir -p /home/kacang/ ...snip...

Looking at the line, its actually made up of a few commands. I would run the build till it fails, and then run each step individually / manually in the command window to see which is causing the actual failure. NB: it could be more than one. But hopefully, that will give you a better understanding.

rm -f /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes-full-debug.jar;

rm -rf /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/anno;

mkdir -p /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/;

mkdir -p /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/anno;

/home/kacang/cm/out/soong/host/linux-x86/bin/zipsync -d /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/srcjars -l /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/srcjar-list -f \"*.java\" /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/aapt2.srcjar;

if [ -s /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/java-source-list -o -s /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/srcjar-list ] ; then /home/kacang/cm/out/soong/host/linux-x86/bin/soong_javac_wrapper prebuilts/jdk/jdk9/linux-x86/bin/javac -Xmaxerrs 9999999 -encoding UTF-8 -sourcepath \"\" -g -XDskipDuplicateBridges=true -XDstringConcat=inline -encoding UTF-8 -bootclasspath /home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/core-lambda-stubs_intermediates/classes-header.jar -classpath /home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android.car_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/SystemUI-tags_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/SystemUI-proto_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/org.lineageos.platform.internal_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/vendor.lineage.biometrics.fingerprint.inscreen-V1.0-java_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-annotations_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-arch-lifecycle-common_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/SystemUIPluginLib_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/SystemUISharedLib_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/SettingsLib_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-car_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v7-recyclerview_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v7-preference_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v7-appcompat_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v7-mediarouter_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v7-palette_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v14-preference_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v17-leanback_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-slices-core_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-slices-view_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-slices-builders_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-arch-core-runtime_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-arch-lifecycle-extensions_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-arch-lifecycle-runtime_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v7-recyclerview_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v7-preference_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v7-appcompat_intermediates/classes-header.jar:/home/kacang/cm/out/target/common/obj/JAVA_LIBRARIES/android-support-v14-preference_intermediates/classes-header.jar -d /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes -s /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/anno -source 1.8 -target 1.8 -g:source,lines \\@/home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/java-source-list \\@/home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/srcjar-list || ( rm -rf /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes ; exit 41 ) fi;

prebuilts/jdk/jdk9/linux-x86/bin/jar -cf /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes-full-debug.jar @<(find /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes -type f | sort | build/soong/scripts/jar-args.sh /home/kacang/cm/out/target/common/obj/APPS/SystemUI_intermediates/classes; echo \"-C /home/kacang/cm/out/empty .\";

Once you find the line that is failing, chances are you could break it down further and maybe help with searching the web for a solution. Or all the above could be a waste of time:o