[ccache] base_dir and symbolic links

Joel Rosdahl joel at rosdahl.net
Thu Jan 4 20:48:53 UTC 2018


On 2 January 2018 at 13:49, Andreas Wettstein via ccache <
ccache at lists.samba.org> wrote:

> Hello Joel,
>
> > https://www.mail-archive.com/ccache@lists.samba.org/msg00802.html
>
> Thank you.  It is trickier than I thought.
>
> > ccache has a test suite and it fails like this with your patch:
>
> Sorry, I missed the test directory.  Attached is a modified patch, which
> fixes this issue and includes tests as well.
>

Thanks, but that unfortunately doesn't normalize "../" parts like the
current code with realpath does. For example, the following change to the
test suite makes it fail with your proposal:

--- a/test.sh
+++ b/test.sh
@@ -2355,8 +2355,8 @@ SUITE_basedir() {
     expect_stat 'cache miss' 1

     # Rewriting triggered by CCACHE_BASEDIR should handle paths with
multiple
-    # slashes correctly:
-    CCACHE_BASEDIR=`pwd` $CCACHE_COMPILE -I`pwd`//include -c
`pwd`//src/test.c
+    # slashes, redundant "/." parts and "foo/.." parts correctly:
+    CCACHE_BASEDIR=`pwd` $CCACHE_COMPILE -I`pwd`//./include/../include -c
`pwd`/src/test.c
     expect_stat 'cache hit (direct)' 1
     expect_stat 'cache hit (preprocessed)' 0
     expect_stat 'cache miss' 1


I would prefer not to lose that ability.

-- Joel


More information about the ccache mailing list