FS#42524 - [cppcheck] Failed to load std.cfg. Your Cppcheck installation is broken

Attached to Project: Community Packages
Opened by Sami Kerola (kerolasa) - Friday, 24 October 2014, 13:30 GMT
Last edited by Jelle van der Waa (jelly) - Wednesday, 19 November 2014, 20:45 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jelle van der Waa (jelly)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 7
Private No

Details

Description:
Execution of the cppcheck fails.

$ cppcheck /dev/null
(information) Failed to load std.cfg. Your Cppcheck installation is broken, please re-install. The Cppcheck binary was compiled with CFGDIR set to "/usr/share/cppcheck/cfg" and will

Looking system calls the command does not even try to open file from /usr/share/cppcheck/cfg/ directory...

$ strace cppcheck /dev/null
[...]
open("std.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
open("./cfg/std.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "(information) Failed to load std"..., 224

...which is a pity, because the file is included in package.

$ pacman -Qkk cppcheck
cppcheck: 18 total files, 0 altered files
$ pacman -Ql cppcheck |grep std
cppcheck /usr/share/cppcheck/cfg/std.cfg


Additional info:

Name : cppcheck
Version : 1.67-1
[...]
Build Date : Fri Oct 24 09:35:27 2014
Install Date : Fri Oct 24 12:26:05 2014
[...]
Validated By : Signature

Steps to reproduce:
Just run the program, input file or options does not matter.
This task depends upon

Closed by  Jelle van der Waa (jelly)
Wednesday, 19 November 2014, 20:45 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 1.67-2
Comment by Layne (xente) - Monday, 27 October 2014, 15:40 GMT
diff --git a/PKGBUILD b/PKGBUILD
index ae6ac1c..1ccdd45 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,7 +27,7 @@ build() {
check() {
cd "${pkgname}-${pkgver}"

- LANG='en_US.UTF-8' make CFGDIR=./cfg HAVE_RULES=yes test
+ LANG='en_US.UTF-8' make CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes test
}

package() {
Comment by Manuel (schnecki) - Wednesday, 05 November 2014, 10:48 GMT
As the fix is not in the repos yet, a downgrade works:
sudo pacman -U /var/cache/pacman/pkg/cppcheck-1.66-1-*.pkg.tar.xz
Comment by Johan R (cleanrock) - Saturday, 08 November 2014, 10:40 GMT
cppcheck has been broken for 2 weeks now, can some other maintainer fix this ? (Jelle seem MIA)
Comment by Jelle van der Waa (jelly) - Saturday, 08 November 2014, 19:05 GMT
I haven't found a fix for this issue, cppcheck-gui seems to work though
Comment by Layne (xente) - Saturday, 08 November 2014, 20:32 GMT
See above for the fix
Comment by Matthias Krüger (matthiaskrgr) - Saturday, 08 November 2014, 23:13 GMT
Note that "make install" might need the CFGDIR parameter passed as well.

EDIT:
what xente suggested (make ... CFGDIR= ... test) will fail if we run make test and don't have cppcheck installed already (since the cfg files are not available to the testrunner at /usr/share....)

Instead, try to seperately build the testrunner (yes, it's an awful hack):

check() {
cd "$srcdir"/cppcheck
mkdir check
cd check
cp -r ../* . || true
make SRCDIR=build CFGDIR=./cfg HAVE_RULES=yes testrunner
./testrunner
}


Comment by Jelle van der Waa (jelly) - Sunday, 09 November 2014, 13:12 GMT
Thanks all, the issue was indeed in the check(). An 1.67-2 version has been pushed to the repos

Loading...