Page MenuHomePhabricator

arc lint doesn't handle miscompiled cppcheck properly
Closed, DuplicatePublic

Description

Issue:

If cppcheck is compiled with a CFGDIR which doesn't exist at runtime for some reason (packaging errors, overzealous cleaning by inexperienced sysadmins, gremlins/aliens, etc.), cpp generates an error. However, arc lint does not pass an error status back to the user.

Reproduction:

  • Add cppcheck as a linter for C files to .arclint.
  • $ arc lint file.c OKAY No lint warnings.

Expected:

  • Add cppcheck as a linter for C files to .arclint.
  • $ arc lint file.c ERROR Problem with cppcheck binary. (or something similar)

More information:

$ cppcheck file.c
cppcheck: Failed to load library configuration file 'std.cfg'. File not found
(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" and will therefore search for std.cfg in that path.