BuildCache
Enumerations | Functions
bcache::config Namespace Reference

BuildCachce configuration options. More...

Enumerations

enum  cache_accuracy_t { cache_accuracy_t::SLOPPY, cache_accuracy_t::DEFAULT, cache_accuracy_t::STRICT }
 The cache accuracy. More...
 
enum  compress_format_t { compress_format_t::LZ4, compress_format_t::ZSTD, compress_format_t::DEFAULT }
 The compression format. More...
 

Functions

std::string to_string (const cache_accuracy_t accuracy)
 Convert a cache accuracy enum value to a string. More...
 
std::string to_string (const compress_format_t format)
 Convert a compression format enum value to a string. More...
 
void init ()
 Initialize the configuration based on environment variables etc.
 
const std::string & config_file ()
 
cache_accuracy_t accuracy ()
 
bool cache_link_commands ()
 
bool compress ()
 
compress_format_t compress_format ()
 
int32_t compress_level ()
 
int32_t debug ()
 
const std::string & dir ()
 
bool direct_mode ()
 
bool disable ()
 
bool hard_links ()
 
string_list_t hash_extra_files ()
 
const std::string & impersonate ()
 
const std::string & log_file ()
 
const string_list_tlua_paths ()
 
int64_t max_cache_size ()
 
int64_t max_local_entry_size ()
 
int64_t max_remote_entry_size ()
 
bool perf ()
 
const std::string & prefix ()
 
bool read_only ()
 
bool read_only_remote ()
 
const std::string & remote ()
 
bool remote_locks ()
 
const std::string & s3_access ()
 
const std::string & s3_secret ()
 
bool terminate_on_miss ()
 

Detailed Description

BuildCachce configuration options.

Configuration options are gathered during program startup, and they can be queried via the functions in the config namespace (which acts as a sigleton).

Enumeration Type Documentation

◆ cache_accuracy_t

The cache accuracy.

Enumerator
SLOPPY 

Maximize cache hit ratio, but may produce incorrect results for certain use cases.

DEFAULT 

For most users.

STRICT 

Be as strict as possible.

◆ compress_format_t

The compression format.

Enumerator
LZ4 

Utilize LZ4 compression (faster compression, larger cache sizes)

ZSTD 

Utilize ZSTD compression (slower compression, smaller cache sizes)

DEFAULT 

Utilize LZ4 compression.

Function Documentation

◆ accuracy()

cache_accuracy_t bcache::config::accuracy ( )
Returns
the cache accuracy.

◆ cache_link_commands()

bool bcache::config::cache_link_commands ( )
Returns
true if BuildCache should cache link commands.

◆ compress()

bool bcache::config::compress ( )
Returns
true if BuildCache should compress data in the cache.

◆ compress_format()

compress_format_t bcache::config::compress_format ( )
Returns
the compression format.

◆ compress_level()

int32_t bcache::config::compress_level ( )
Returns
the compression level.

◆ config_file()

const std::string & bcache::config::config_file ( )
Returns
the BuildCache configuration file.

◆ debug()

int32_t bcache::config::debug ( )
Returns
the debug level (-1 for no debugging).

◆ dir()

const std::string & bcache::config::dir ( )
Returns
the BuildCache home directory.

◆ direct_mode()

bool bcache::config::direct_mode ( )
Returns
true if direct mode shall be used.

◆ disable()

bool bcache::config::disable ( )
Returns
true if BuildCache is disabled.

◆ hard_links()

bool bcache::config::hard_links ( )
Returns
true if BuildCache should use hard links when possible.

◆ hash_extra_files()

string_list_t bcache::config::hash_extra_files ( )
Returns
a list of extra files to hash.

◆ impersonate()

const std::string & bcache::config::impersonate ( )
Returns
the executable to impersonate.

◆ log_file()

const std::string & bcache::config::log_file ( )
Returns
the log file (empty string for stdout).

◆ lua_paths()

const string_list_t & bcache::config::lua_paths ( )
Returns
the Lua search paths.

◆ max_cache_size()

int64_t bcache::config::max_cache_size ( )
Returns
the maximum cache size (in bytes).

◆ max_local_entry_size()

int64_t bcache::config::max_local_entry_size ( )
Returns
the maximum local cache entry size (in bytes).

◆ max_remote_entry_size()

int64_t bcache::config::max_remote_entry_size ( )
Returns
the maximum remote cache entry size (in bytes).

◆ perf()

bool bcache::config::perf ( )
Returns
true if performance profiling output is enabled.

◆ prefix()

const std::string & bcache::config::prefix ( )
Returns
the compiler execution prefix command.

◆ read_only()

bool bcache::config::read_only ( )
Returns
true if the readonly mode is enabled.

◆ read_only_remote()

bool bcache::config::read_only_remote ( )
Returns
true if the remote cache is read only.

◆ remote()

const std::string & bcache::config::remote ( )
Returns
the remote cache service address.

◆ remote_locks()

bool bcache::config::remote_locks ( )
Returns
true if BuildCache must use file locks that are safe for remote file systems.

◆ s3_access()

const std::string & bcache::config::s3_access ( )
Returns
the S3 access key for the remote cache.

◆ s3_secret()

const std::string & bcache::config::s3_secret ( )
Returns
the S3 secret key for the remote cache.

◆ terminate_on_miss()

bool bcache::config::terminate_on_miss ( )
Returns
true if a "terminate on a miss" mode is enabled.

◆ to_string() [1/2]

std::string bcache::config::to_string ( const cache_accuracy_t  accuracy)

Convert a cache accuracy enum value to a string.

Parameters
accuracyThe cache accuracy.
Returns
an upper case string representing the cache accuracy.

◆ to_string() [2/2]

std::string bcache::config::to_string ( const compress_format_t  format)

Convert a compression format enum value to a string.

Parameters
formatThe compression format.
Returns
an upper case string representing the compression format.