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
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
|
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
Wednesday, 19 November 2014, 20:45 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 1.67-2
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() {
sudo pacman -U /var/cache/pacman/pkg/cppcheck-1.66-1-*.pkg.tar.xz
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
}