[ccache] [PATCH] Potentially produce better relative pathnames when symlinks are

Joel Rosdahl joel at rosdahl.net
Sun Mar 20 14:23:17 MDT 2011


On 2011-03-14 12:03, Mike Crowe wrote:
> Well, that certainly is a problem that I would also like to resolve
> but you are correct in saying that the patch does not address it. I
> ended up deciding that the only way to solve it would be to invent
> CCACHE_BASEDIRS to support multiple base directories. I have a patch
> in development that does this.

Right. I think that we in that case just should allow multiple
directories separated by colon in the existing CCACHE_BASEDIR variable.

> Yes, this is the use case that is addressed by the patch. The reason
> it is a problem for me is that we share a ccache among multiple users
> and the rewritten path ends up being unique for each user (without the
> patch.)
> 
> I'm open to suggestions if you think there is a better way to fix
> either or both problems.

I can't think of a better solution for the moment, but one thing you
could do is to check whether current_working_dir and
x_realpath(current_working_dir) are different (only needed once) and
only then try the second get_relative_path. Also, I would be very happy
if you have opportunity to make a test case for this in test.sh. :-)

-- Joel


More information about the ccache mailing list