Symlink file system loops causes scanner to not find files

  • versions used: build-wrapper, version 3.9 (linux-x86)

When scanning an Android build, the build output contains a linux kernel build in which there are symlinks in a child-directory pointing back to a parent director (aka file system loop).
For example when running find in this directory it will print: find: File system loop detected; ‘out/target/product/myproduct/obj/kernel/lib/modules/4.9.56-quilt-2e5dc0ac-ged48a0a/build’ is part of the same file system loop as ‘out/target/product/myproduct/obj/kernel’

When running Sonarqube on this output, the last scanning step seems to be confused by this and keeps recursing the loop and concatenating invalid file-paths up to a certain limit which eventually fail with FileNotFoundError:

ERROR: Error during SonarQube Scanner execution
ERROR: Cannot feed the data into sonar, details: 'javax.xml.stream.XMLStreamException: java.io.FileNotFoundException: /workspace/out/target/product/myproduct/obj/kernel/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/build/lib/modules/4.19.152-PKT-201102T090902Z-gd38365ca3532/source/drivers/gpu/drm/amd/display/modules/inc (Is a directory)'