LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 50300 - Line endings issue with clang
Summary: Line endings issue with clang
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: 11.0
Hardware: Other Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-11 06:30 PDT by Akilesh D S
Modified: 2021-07-02 02:09 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Akilesh D S 2021-05-11 06:30:57 PDT
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
Comment 1 Akilesh D S 2021-07-02 02:09:42 PDT
Hi team,

Is there an update on this topic?

Let us know if you need more details.

Thanks in advance!

Regards,
Akilesh D S