Bug 11713 - allow ccache to fall back to copy if hardlink fails
Summary: allow ccache to fall back to copy if hardlink fails
Status: CLOSED FIXED
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: 3.2.1
Hardware: All All
: P5 enhancement
Target Milestone: 3.3
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-04 00:40 UTC by mblythester+ccache
Modified: 2016-04-17 14:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mblythester+ccache 2016-02-04 00:40:53 UTC
If CCACHE_HARDLINK is set, ccache will fall back to running the compiler if it fails to create the hard link.

log:
[2016-02-03T19:32:17.368179 2517 ] === CCACHE 3.2.1 STARTED =========================================
[...
[2016-02-03T19:32:17.378361 2517 ] Got object file hash from manifest
[2016-02-03T19:32:17.379446 2517 ] Unlink test.o via test.o.rm.hostname.2517.XXXXXX
[2016-02-03T19:32:17.380619 2517 ] Failed to link /path/to/ccache/1/9/a6a636ff20485f7d9b0b5b1e80e26f-586953.o to test.o: Invalid cross-device link
[2016-02-03T19:32:17.380719 2517 ] Failed; falling back to running the real compiler
[2016-02-03T19:32:17.381237 2517 ] Acquired lock /path/to/ccache/1/stats.lock
[2016-02-03T19:32:17.386757 2517 ] Releasing lock /path/to/ccache/1/stats.lock
[2016-02-03T19:32:17.386869 2517 ] Unlink /path/to/ccache/1/stats.lock
[2016-02-03T19:32:17.387254 2517 ] Result: ccache internal error

I think it would make sense to simply fall back to copying the file from the cache, as if CCACHE_HARLINK wasn't set.  If you don't want to change the meaning of CCACHE_HARDLINK, then perhaps this new functionality could be enabled with a CCACHE_ALLOW_HARDLINK option?
Comment 1 Joel Rosdahl 2016-02-07 11:07:22 UTC
Sounds reasonable. Fixed in 9612954e19099c7e741ee56f2cb5f763b26601e0 on master.
Comment 2 Joel Rosdahl 2016-04-17 14:49:27 UTC
Included in 3.2.5.