Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759613 - =dev-util/cppcheck-2.2 fails to find std.cfg
Summary: =dev-util/cppcheck-2.2 fails to find std.cfg
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-12 15:04 UTC by Dan Goodliffe
Modified: 2020-12-13 18:23 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Goodliffe 2020-12-12 15:04:45 UTC
This used to work, but having reinstalled cppcheck (same version) it now fails to find std.cfg.

Reproducible: Always

Steps to Reproduce:
1. emerge =cppcheck-2.2
2. cppcheck some.cpp
Actual Results:  
cppcheck: Failed to load library configuration file 'std.cfg'. File not found
nofile:0:0: information: Failed to load std.cfg. Your Cppcheck installation is broken, please re-install. The Cppcheck binary was compiled with FILESDIR set to "usr/share/cppcheck/" and will therefore search for std.cfg in usr/share/cppcheck//cfg. [failedToLoadCfg]


Expected Results:  
Successful run and diagnostics of some.cpp

I think this might be related to the recent cmake update, but I haven't had chance to prove that yet (somewhat speculative, but I can't see anything else in emerge.log which jumps out). However, there are two places in cppcheck-2.2.ebuild where FILESDIR is set to usr/share/${PN}/ (with no leading /). Adding the leading / does fix the problem.

Output from ebuild ... configure:
-- ------------------ General configuration for Cppcheck 2.2 -----------------
-- 
-- CMake Generator =       Ninja
-- Compiler =              GNU
-- Compiler Version =      10.2.0
-- Build type =            Gentoo
-- CMAKE_INSTALL_PREFIX =  /usr
-- CMAKE_DISABLE_PRECOMPILE_HEADERS = On
-- C++ flags (General) =   -O3 -march=native -pipe
-- C++ flags (Release) =   -O3 -DNDEBUG
-- C++ flags (RelWithDebInfo) = -O2 -g -DNDEBUG
-- C++ flags (Debug) =     -g
-- Found Define: FILESDIR="usr/share/cppcheck/"
-- Found Define: HAVE_RULES
-- Found Define: TIXML_USE_STL
-- Found Define: USE_Z3
-- 
-- ---------------------------------------------------------


Portage 3.0.12 (python 3.7.9-final-0, default/linux/amd64/17.1/no-multilib/hardened, gcc-10.2.0, glibc-2.32-r5, 5.4.80 x86_64)
=================================================================
System uname: Linux-5.4.80-x86_64-Intel-R-_Core-TM-_i5-6400_CPU_@_2.70GHz-with-gentoo-2.7
KiB Mem:    16104612 total,   3763924 free
KiB Swap:    2097148 total,   2044668 free
Timestamp of repository gentoo: Sat, 12 Dec 2020 14:35:09 +0000
Head commit of repository gentoo: 97741d499a5ab8ef2f94862184d2a5a1a807cf38

Head commit of repository RandomLAN: 7a5f48952ac751df6e0d2698987a6018246928ac

sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.1 p2) 2.35.1
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
ccache version 4.1 [enabled]
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          3.6.12::gentoo, 3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo
dev-util/ccache:          4.1::gentoo
dev-util/cmake:           3.19.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.15.1-r2::gentoo, 1.16.3-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            8.4.0-r1::gentoo, 10.2.0-r3::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

RandomLAN
    location: /var/lib/layman/RandomLAN
    sync-type: git
    sync-uri: https://git.randomdan.homeip.net/git/portage
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE linux-fw-redistributable no-source-code vim.org MSttfEULA free-noncomm CC-Sampling-Plus-1.0 PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-backup unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://portage.randomdan.homeip.net/ http://mirrorsearch.randomdan.homeip.net/ http://distfiles.gentoo.org/"
LANG="en_GB.utf8"
LC_ALL="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -O3 -march=native -pipe"
LINGUAS="en en_GB"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
USE="acl amd64 apache2 arc autoservicerestart autoupdate bash-completion berkdb btrfs bzip2 c++0x caps ci clang cron crypt css curl device-mapper dmarc dot dvb exiscan-acl extras fam firmware fontconfig fpm fuse git gold graphviz grub hardened hpn http2 iconv icu inspector ipv6 ithreads jit jpeg jpeg2k json ldap libglvnd libtirpc llvm logrotate lvm lvmboot lvmroot lzma lzo maildir minizip modperl mp3 mpm-prefork mysql ncurses network network-cron nls nohourlyupdate nptl nscd nuv ocfs2 offload openmp pam pcre pcre-jit pcre16 pcre32 pie png postgres postproc proxy readline rtmp savedconfig seccomp secure-delete smp sndfile spf split-usr ssl ssp symlink syslog system-boost system-cairo system-cmark system-crontab system-ffmpeg system-harfbuzz system-heimdal system-icu system-jpeg system-jsoncpp system-libevent system-libmspack system-libs system-libvpx system-libyaml system-llvm system-lua system-qemu system-seabios system-sqlite system-uulib system-wide systemd threads truetype unicode uuid vim-pager vim-syntax xattr xml xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="access_compat alias auth_basic authn_core authz_core authz_host authz_user autoindex cache cache_disk cgid dav deflate dir env expires filter headers http2 log_config macro mime mime_magic proxy proxy_http remoteip rewrite socache_shmcb status unixd vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python3_7" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Dan Goodliffe 2020-12-12 15:46:10 UTC
OK, cmake seems to be unrelated, reinstalled with cmake 3.19.0 and 3.18.5, but cppcheck still configures and fails in the same. So I have no clue as to why/how it used to work and now apparently doesn't.
Comment 2 Brian Gloyer 2020-12-13 08:57:32 UTC
I get this too.

The problem is it looking for the config based a relative path from the current directory. (e.g it's looking in ~/proj/usr/share/cppcheck/cfg).

A work around is to run it from the root directory '/' or copy the config to where it is looking.
Comment 3 Jaak Ristioja 2020-12-13 17:33:17 UTC
Reverting this commit seems to help:

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=604edcde867f02343888b64b2e08e8bea1cf23d0
Comment 4 Larry the Git Cow gentoo-dev 2020-12-13 18:23:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6ba9facf734344a00ff866863f7066d474b9d01

commit a6ba9facf734344a00ff866863f7066d474b9d01
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2020-12-13 18:19:52 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2020-12-13 18:20:39 +0000

    Revert "dev-util/cppcheck: fix double prefix in installed files"
    
    This reverts commit 604edcde867f02343888b64b2e08e8bea1cf23d0.
    
    Closes: https://bugs.gentoo.org/759613
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 dev-util/cppcheck/cppcheck-2.2.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)