# Role: sccache

## Description

Installs and configures sccache and sccache-dist.

Distributed sccache and compiling Rust, C and C++ is not officially supported in Gentoo, but works well enough with some tinkering.

A package.env that disables sccache should be created for packages that don't like to be built with sccache.

https://github.com/mozilla/sccache

## Usage

Using in a playbook:

```yaml
- name: Play
  hosts:
    - all
  roles:
    - samuliy.ansible.sccache
  vars:
    ...
```

### Vars

`sccache_bin`:

Binary path for sccache.

`sccache_bin_links_path`:

Path where to install links to sccache.

`sccache_cache_size`:

Sccache cache size.

`sccache_client`:

Enable/disable sccache client on the host.

`sccache_client_dist_auth_token`:

Auth token for job distribution.

`sccache_client_dist_auth_type`:

Auth type for job distribution.

`sccache_client_scheduler_public_addr`:

Sccache-dist scheduler address for client.

`sccache_client_toolchain_cache_size`:

Toolchain cache size for the client.

`sccache_dir`:

Sccache cache dir.

`sccache_user`:

Sccache user.

`sccache_group`:

Sccache user group.

`sccache_log`:

Sccache logging level.

`sccache_max_frame_length`:

Sccache max frame length.

`sccache_port`:

Sccache listening port.

`sccache_rust_log`:

Sccache RUST logging level.

`sccache_scheduler`:

Enable/disable sccache scheduler.

`sccache_scheduler_client_auth_token`:

Sccache scheduler client auth token.

`sccache_scheduler_client_auth_type`:

Sccache scheduler client auth type.

`sccache_scheduler_public_addr`:

Sccache scheduler public address.

`sccache_scheduler_server_auth_type`:

Sccache server auth type.

`sccache_scheduler_server_secret_key`:

Sccache server secret key.

`sccache_scheduler_server_token`:

Sccache server token for scheduler.

`sccache_server`:

Enable/disable sccache-server.

`sccache_server_builder_build_dir`:

Sccache server build dir.

`sccache_server_builder_bwrap_path`:

Sccache server bwrap binary path.

`sccache_server_builder_type`:

Sccache server builder type.

`sccache_server_cache_dir`:

Sccache server cache directory.

`sccache_server_public_addr`:

Sccache server public address.

`sccache_server_scheduler_auth_token`:

Sccache scheduler auth token for server.

`sccache_server_scheduler_auth_type`:

Sccache scheduler auth type for server.

`sccache_server_scheduler_url`:

Sccache scheduler URL for server.

`sccache_server_toolchain_cache_size`:

Sccache server toolchain cache size.

`sccache_client_portage_features_disable`:

Portage features to disable for sccache-client.

`sccache_user_service_override_dir`:

Directory to install the user service override to.
