title: How to get Bazel, ccache, and sandboxing to work together (ccache read only filesystem)
body: <p>I'm attempting to build a C++ application on Fedora 28 using Bazel 0.16.1 installed via copr and ccache 3.4.2 installed via DNF. I'm using the default cc_binary and cc_library rules. When I run the bazel build command, ccache errors out with:</p>
  
  <pre><code>ccache: error: Failed to create temporary file for /home/mwalker/.ccache/tmp/time.stdout: Read-only file system
  </code></pre>
  
  <p>I can see when I build with <code>--verbose_failures --sandbox_debug</code> that we're not mounting the ccache tmp directory r/w.</p>
  
  <p>So, how do I get bazel to mount my ccache directory r/w, or how do I tell ccache through bazel where the correct cache directory for my workspace resides?</p>
  
  <p><s>When I run the same command on Ubuntu 18.04 it succeeds, so this leads me to believe that ccache is supported in some way.</s></p>
  
  <p>It looks like part of my problem is that ccache installed its compiler driver as gcc. E.g. <code>which gcc -&gt; /usr/lib64/ccache/gcc</code>. Where on Ubuntu ccache must be explicitly invoked, and the default toolchain is not calling it.</p>