A ccache remote storage helper for Redis.
This is a storage helper for ccache that enables caching compilation results on Redis servers. It implements the ccache remote storage helper protocol.
- Supports the Redis protocol over unencrypted or TLS/SSL network connections, as well as over unencrypted over local Unix domain socket connections
- Cross-platform: Linux, macOS, Windows
- Optional debug logging
The helper should be installed in a location where ccache searches for helper programs. Install it as:
ccache-storage-redisfor unencrypted Redisccache-storage-redissfor Redis TLS/SSLccache-storage-redis+unixfor Redis on local Unix domain socket
- Unencrypted:
redis://[[USERNAME:]PASSWORD@]HOST[:PORT][/DBNUMBER] - TLS/SSL-encrypted:
rediss://[[USERNAME:]PASSWORD@]HOST[:PORT][/DBNUMBER] - Unix domain socket:
redis+unix:SOCKET_PATH[?db=DBNUMBER]orredis+unix://[[USERNAME:]PASSWORD@localhost]SOCKET_PATH[?db=DBNUMBER]
Grab a prebuilt binary from Releases and place it in a suitable directory as described above.
# Clone the repository:
git clone https://github.com/ccache/ccache-storage-redis
cd ccache-storage-redis
# On Windows:
go mod download
go build -ldflags="-s -w" -trimpath -o ccache-storage-redis.exe .
# On Linux/macOS and similar:
make
# Install ccache-storage-redis plus ccache-storage-rediss and
# ccache-storage-redis+unix symlinks in /usr/local/bin:
make install
# Install ccache-storage-redis plus ccache-storage-rediss and
# ccache-storage-redis+unix symlinks in /example/dir:
make install INSTALL_DIR=/example/dirThe helper is configured via ccache's remote_storage configuration. The
binary is automatically invoked by ccache when needed.
For example:
# Set the CCACHE_REMOTE_STORAGE environment variable:
export CCACHE_REMOTE_STORAGE="redis://cache.example.com"
# Or set remote_storage in ccache's configuration file:
ccache -o remote_storage="redis://cache.example.com"See also the Redis storage wiki page for tips on how to set up a storage server.
Example ccache configuration:
remote_storage = redis://cache.example.com
Or as an environment variable:
export CCACHE_REMOTE_STORAGE="redis://cache.example.com"You can set the CRSH_LOGFILE environment variable to enable debug logging to a
file:
export CRSH_LOGFILE=/path/to/debug.logNote: The helper process is spawned by ccache, so the environment variable must be set before ccache is invoked.
Warning: The debug log is not redacted and may contain secrets such as credentials. Only enable it for troubleshooting and protect or delete the log file afterwards.
Contributions are welcome! Please submit pull requests or open issues on GitHub.