Warnings Next Generation Plugin With GCC C++

392 views
Skip to first unread message

Sverre Moe

unread,
May 6, 2019, 6:27:29 AM5/6/19
to Jenkins Users
How do I use this plugin to record and show C/C++ Warnings/Errors from GCC?

There is two tools available GNU C Compiler (gcc3) and GNU C Compiler (gcc4), but are those for C?
We are using a much newer version of GCC.

Otherwise I could only find these for C++
recordIssues(tools: [cppCheck()])
recordIssues(tools: [cppLint()])

Neither found no warnings, but there where plenty of warnings when running GCC.

[50/107] Building CXX object src/CMakeFiles/some.dir/thing/file.cpp.o src/thing/file.cpp: In member function ‘std::__cxx11::string file::method(const string&, const string&)’:
src/thing/file.cpp:141:31: warning: unused variable ‘id’ [-Wunused-variable]
 for (const auto & [ id, m ] : _id_to_var)


I tried with the gcc4, and it spewed out some errors with stacktrace in the recording. Looks like it tried to run some git commands, and I do not have a git repository at hand, just a stashed archive.
However it seems at least it did find some Warnings. The warning above was detected by gcc4.
Is there any way I can stop it from accessing Git when it is trying to record?

Ullrich Hafner

unread,
May 6, 2019, 6:55:15 AM5/6/19
to Jenkins Users

Am 06.05.2019 um 12:27 schrieb Sverre Moe <sverr...@gmail.com>:

How do I use this plugin to record and show C/C++ Warnings/Errors from GCC?

There is two tools available GNU C Compiler (gcc3) and GNU C Compiler (gcc4), but are those for C?
We are using a much newer version of GCC.


I think I should rename the Tools

GNU C Compiler (gcc4) -> GNU C Compiler 
GNU C Compiler (gcc3) -> GNU C Compiler (3 and older)

And the ID to gcc. 

Would that make sense?

Otherwise I could only find these for C++
recordIssues(tools: [cppCheck()])
recordIssues(tools: [cppLint()])

Neither found no warnings, but there where plenty of warnings when running GCC.

[50/107] Building CXX object src/CMakeFiles/some.dir/thing/file.cpp.o src/thing/file.cpp: In member function ‘std::__cxx11::string file::method(const string&, const string&)’:
src/thing/file.cpp:141:31: warning: unused variable ‘id’ [-Wunused-variable]
 for (const auto & [ id, m ] : _id_to_var)


I’m not sure if your log is different but the parser gcc4 should work. 


I tried with the gcc4, and it spewed out some errors with stacktrace in the recording. Looks like it tried to run some git commands, and I do not have a git repository at hand, just a stashed archive.
However it seems at least it did find some Warnings. The warning above was detected by gcc4.
Is there any way I can stop it from accessing Git when it is trying to record?


Yes, use 

recordIssues blameDisabled: true, …

BTW: there is also a Gitter channel available: https://gitter.im/jenkinsci/warnings-plugin

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/db195bc3-2907-4dee-8a4b-a9a1bf2c6734%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sverre Moe

unread,
May 6, 2019, 7:01:22 AM5/6/19
to Jenkins Users
It seems to be very confused.
I am bulding on 4 nodes
opensuse42.3
opensuse15.0
sles12.3
sles15.0

They have each their own gcc4 ID, but they have the same result, showing the same 4 entries for each.
Total 5 /dev/shm/rpmroot-build-opensuse42.3_x86_64/projectA/BUILD/projectA-1.3.2/something/some_thing_file
Total 6 /dev/shm/rpmroot-build-opensuse15.0_x86_64/projectA/BUILD/projectA-1.3.2/src/dirA
Total 2 /dev/shm/rpmroot-build-opensuse15.0_x86_64/projectA/BUILD/projectA-1.3.2/src/dirB
Total 10 /dev/shm/rpmroot-build-opensuse15.0_x86_64/projectA/BUILD/projectA-1.3.2/something/some_thing_file

None from the sles nodes are shown.

Sverre Moe

unread,
May 6, 2019, 7:02:11 AM5/6/19
to Jenkins Users
mandag 6. mai 2019 12.55.15 UTC+2 skrev Ullrich Hafner følgende:


I think I should rename the Tools

GNU C Compiler (gcc4) -> GNU C Compiler 
GNU C Compiler (gcc3) -> GNU C Compiler (3 and older)

And the ID to gcc. 

Would that make sense?


That makes sense. 

Sverre Moe

unread,
May 6, 2019, 7:12:25 AM5/6/19
to Jenkins Users
I think the tool
Reads the complete output (where all 4 nodes are intermingled).
It would be better if it could read only for the one node it is executed within.

Still I find it odd that it showed the same issues for all nodes. It should at least show the ones from the node itself
sles12.3 output showed none of the sles12.3 warnings.

Ullrich Hafner

unread,
May 6, 2019, 7:23:02 AM5/6/19
to Jenkins Users
There are some open issues about that:

As a workaround you should pipe the log to a file.

-- 
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Sverre Moe

unread,
May 6, 2019, 8:47:40 AM5/6/19
to Jenkins Users
mandag 6. mai 2019 13.23.02 UTC+2 skrev Ullrich Hafner følgende:
There are some open issues about that:

As a workaround you should pipe the log to a file.
 
How so, is there a pipeline step to do this?
Or do I need to take the output from sh step?

Ullrich Hafner

unread,
May 6, 2019, 9:55:59 AM5/6/19
to Jenkins Users

Am 06.05.2019 um 14:47 schrieb Sverre Moe <sverr...@gmail.com>:

mandag 6. mai 2019 13.23.02 UTC+2 skrev Ullrich Hafner følgende:
There are some open issues about that:

As a workaround you should pipe the log to a file.
 
How so, is there a pipeline step to do this?

No.

Or do I need to take the output from sh step?

Yes.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages