Bug 8530 - ccache 3.x ignores $CPATH
Summary: ccache 3.x ignores $CPATH
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: 3.1.6
Hardware: All All
: P5 major
Target Milestone: 3.1.7
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
Depends on:
Reported: 2011-10-18 08:29 UTC by Mathias Krause
Modified: 2012-01-08 14:47 UTC (History)
0 users

See Also:

Test case showing ccache wrongly using the cached object file (532 bytes, application/x-gzip)
2011-10-18 08:29 UTC, Mathias Krause
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias Krause 2011-10-18 08:29:33 UTC
Created attachment 7008 [details]
Test case showing ccache wrongly using the cached object file

ccache's 3.x optimization, not to call the preprocessor, fails when using the CPATH environment variable to add additional include paths. The reason for this is, ccache 3.x does not include this environment variable in the hash generation for the .manifest file.

A Test case for this bug is attached. The last line should print b/foo.h instead of a/foo.h.

This is a regression from ccache 2.4, which behaves correctly regarding this issue, as it uses the preprocessor which does correctly handle the CPATH environment variable.

A fix should not only take care of CPATH but also of the following variables, as the manpages of gcc and clang suggest: C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, OBJC_INCLUDE_PATH and OBJCPLUS_INCLUDE_PATH (clang only).

The related variable LIBRARY_PATH, to add additional paths to look for library files, should be of no concern, as ccache doesn't cache calls to the linker.
Comment 1 Joel Rosdahl 2012-01-06 16:10:37 UTC
Fixed in 8328b3b93525cb4091054bd2162cc3ddc970ef3d.
Comment 2 Joel Rosdahl 2012-01-08 14:47:40 UTC
Included in v3.1.7.