Presence of ccache prevents C builds from cleaning the environment

Hi,

First of all, thanks for providing the standard pipeline. Lintian will switch from a custom setup to your code in short order. @ina has been super helpful with the migration.

We are having a small issue with ccache (easily triaged) and I wonder whether its use in the standard Salsa CI pipelines should perhaps be made optional.

In #27 (closed), @otto requested the inclusion of ccache for performance reasons. @tin did not see a downside (#27 (comment 59971)) but I respectfully disagree.

Lintian builds about 1200 test packages for our test suite. We limit the environment to prevent variation in these test packages. A considerable number use gcc.

When ccache is installed, our builds fail in your standard CI pipelines because gcc detects its presence but cannot read CCACHE_DIR. The variable was sanitized from the environment. Gcc then uses the default location $HOME/.ccache as described in the documentation, but that path is not writable. The error is:

ccache: error: Failed to create directory /home/salsa-ci/.ccache/tmp: Permission denied

To be sure, others have had an issue with that, as well. Google's build system bazel also failed (https://salsa.debian.org/bazel-team/bazel/-/jobs/700220#L1755) until a special accommodation was made (bazel-team/bazel@9f5a6441). They chose to disable it via CCACHE_DISABLE.

My question is whether the use of ccache should be made optional. Does it provide any benefit when building Lintian's test packages?

In some ways, the use of ccache is also antithetical in clean docker containers, which are supposed to provide pristine builds.

At the same time, I sympathize with a desire to speed things up. Lintian's test suite takes 100 minutes, which is even longer than MariaDB's original build time of one hour.

Thank you to @ina for debugging the issue together.

Kind regards Felix Lechner