[llvm-bugs] [Bug 50300] New: Line endings issue with clang

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 11 06:30:57 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50300

            Bug ID: 50300
           Summary: Line endings issue with clang
           Product: clang
           Version: 11.0
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ds.akilesh at in.bosch.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Hi Team,

We generate the xml report for our project using gcovr( version 4.2) and clang
(version 11.0)

We are facing the line endings issue. The xml file generated as part of the
gcov and clang commands seems to contains more data than actual lines in the
file. Sonarqube-scanner is not able to find the lines mentioned in the xml and
hence fails the build.


We tried to fix the line endings issue by:

# .gitattributes approach to fix the line endings but no luck
# checked if it contains multiple files with same name and the answer is No
# there are no old gcno/gcna files available in the workspace


After addition of warnings in the gcovr, we get the below output/warnings:

WARNING: File src/src/ButtonManager/HardwareButtonHandler.cpp has 73 line(s)
but coverage data has 74 line(s).
WARNING: File src/src/ConfigurationInstaller/ConfigurationInstaller.cpp has 145
line(s) but coverage data has 155 line(s).
WARNING: File src/src/Filesystem/Filesystem.cpp has 258 line(s) but coverage
data has 549 line(s).
WARNING: File src/src/Lbtp/Client.cpp has 224 line(s) but coverage data has 404
line(s).
WARNING: File src/src/Led/Patterns/AssistanceModePattern.cpp has 46 line(s) but
coverage data has 82 line(s).
WARNING: File src/src/SystemUpdater/AllComponents.cpp has 44 line(s) but
coverage data has 177 line(s).
WARNING: File src/src/SystemUpdater/ComponentBase.cpp has 221 line(s) but
coverage data has 417 line(s).
WARNING: File src/src/Ui/Data/BatteryPackData.cpp has 53 line(s) but coverage
data has 85 line(s).
WARNING: File src/src/Ui/Views/BackgroundView.cpp has 69 line(s) but coverage
data has 76 line(s).
WARNING: File src/src/Ui/Views/BlePairingModeView.cpp has 128 line(s) but
coverage data has 194 line(s).
WARNING: File src/src/Ui/Views/CriticalErrorView.cpp has 56 line(s) but
coverage data has 78 line(s).
WARNING: File src/src/Ui/Views/DiagnosisProgramView.cpp has 35 line(s) but
coverage data has 69 line(s).
WARNING: File src/src/Ui/Views/GoodByeView.cpp has 60 line(s) but coverage data
has 79 line(s).
WARNING: File src/src/Ui/Views/NonCriticalErrorView.cpp has 83 line(s) but
coverage data has 97 line(s).
WARNING: File src/src/Ui/Views/SoftwareUpdateView.cpp has 80 line(s) but
coverage data has 88 line(s).
WARNING: File src/src/Ui/Views/StateOfChargeView.cpp has 60 line(s) but
coverage data has 92 line(s).
WARNING: File src/src/Ui/Views/WalkAssistActiveStateView.cpp has 62 line(s) but
coverage data has 69 line(s).
WARNING: File src/src/Ui/Views/WelcomeView.cpp has 52 line(s) but coverage data
has 76 line(s).

Command use for xml generation:

python -m gcovr --gcov-executable="llvm-cov gcov" -v --root
/var/jenkins/0/workspace/_feature_align-coverage-metrics2 --branches -f
'/var/jenkins/0/workspace/_feature_align-coverage-metrics2/build/unittest-clang/BRC36xx-5/Debug/(src|include)/'
-f
'/var/jenkins/0/workspace/_feature_align-coverage-metrics2/src/(src|include)/'
--object-dir=. --exclude-directories
'/var/jenkins/0/workspace/_feature_align-coverage-metrics2/build/unittest-gcc/'
--html-details=gcovreport/index.html --sonarqube=gcovreport/sonarqube.xml

For more details refer to the github issue:
https://github.com/gcovr/gcovr/issues/345

Regards,
Akilesh D S

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210511/11c63f67/attachment.html>


More information about the llvm-bugs mailing list