add support for ccache in reprotest with new reprotest-ccache job
This will allow to use ccache in reprotest. Either in the standard way, or through --control-build (which I have copied from #118 but is not included here).
- Split and slighly rearrange the ".build-script" into smaller scripts to be able to reuse them in reprotest-ccache
- Add a reprotest-ccache job calling the new ".test reprotest-ccache"
- Current test-reprotest remains unchanged for backward compatibility
This is also ready to reuse debs built in the "build" job through the --control-build option of reprotest (it is not part of this MR). For it to work, the image has to be the same as the image used in the "build" job. Otherwise there may be no cache hits because the compiler changed.
Add a SALSA_CI_REPROTEST_USE_CCACHE variable. If 1, it will run reprotest-ccache and reprotest is not created. If 0, it is the contrary.
Since reprotest is ran as root and ccache was initially created as user salsaci, we have to chown the .ccache folder before rerprotest, otherwise, there will be error like "not allowed to write to .ccache/..."
To maximize the ccache hits, one has to set sloppiness of ccache to "locale". This is done with variable SALSA_CI_REPROTEST_CCACHE_SLOPPINESS which can be overriden. (replaced by LANG=C.UTF-8, see comment)
Other aspects to make reprotest work with ccache are detailed here #37
Fixes: #37