Buildless + SCCache
Build caching with SCCache and Buildless
Using SCache with Buildless
SCCache is the spiritual successor to CCache, rewritten in Rust with an emphasis on distributed compile execution as well as caching. It is primarily used with the Rust toolchain, but can be used with nearly any C-like toolchain, like CCache.
Selecting a backend
SCCache supports many backends, including an HTTP-based backend and direct use of Redis.
HTTP ("Webdav") backend
SCCache provides the WebDAV adapter for plain HTTP or HTTP+TLS remote backends; it uses the SCCACHE_WEBDAV_*
set of variables, which should be set as demonstrated below:
Variable | Value |
---|---|
SCCACHE_WEBDAV_ENDPOINT | https://sccache.less.build/cache/generic |
SCCACHE_WEBDAV_USERNAME | apikey (Literal value) |
SCCACHE_WEBDAV_PASSWORD | Your API key |
The HTTP backend is great because it is easy to understand, monitor, and diagnose; in some cases, though, the Redis-based adapter may perform better.
Redis backend
SCCache also supports caching via Redis-compliant backends. Buildless API endpoints natively speak Redis protocol. To configure this backend, you'll use the SCCACHE_REDIS
variable, which specifies a formatted connection URL. Here's an example:
Variable | Value |
---|---|
SCCACHE_REDIS | rediss://apikey:{your key}@redis.less.build:6379 |
Let's break this URL down into components:
Component | Meaning | Notes |
---|---|---|
rediss:// | Activate TLS | Buildless uses TLS with publicly-verifiable certificates. |
apikey | Redis username | The literal string apikey , or a specific org tenant ID. |
{your key} | Redis password | Your API key should be used in this field. |
redis.less.build | Endpoint | Traffic endpoint. |
6379 | Port | Buildless uses the standard Redis port, 6379 . |
For more information about using Redis with Buildless, see our Buildless + Redis guide.
Updated about 1 month ago