omni.repo.build.distributed_build#

class omni.repo.build.distributed_build.CCacheConfig(
remote_storage: str,
reshare: bool,
cache_dir: Path,
max_cache_size: str,
sloppiness: str = 'pch_defines,time_macros,include_file_mtime,include_file_ctime',
enable_windows_ci: bool = False,
)#

Bases: object

A data type for configuring ccache.

ccache is a C/C++ compiler cache, we embed 4.7.4 within linbuild. Documentation -> https://ccache.dev/manual/4.7.4.html

This dataclass contains the currently supported configuration options that can be set via a consuming project’s repo.toml. There are very few defaults so that people know exactly what they are getting into via repo.toml configuration.

Sloppiness is set with the suggested defaults -> https://ccache.dev/manual/4.7.4.html#_precompiled_headers. Kit has run into issues with precompiled headers being cached and not correctly re-cached/retrieved, breaking linking. Hopefully these settings will be sufficient to prevent future issues.

Parameters:
  • remote_storage – ccache supports many options, redis is what repo_build + kit will be using. If remote_storage is None or an empty string then it will not be set, and local cache will be used. https://ccache.dev/manual/4.7.4.html#_remote_storage_backends

  • reshare – If true, ccache will write results to remote storage even for local storage cache hits. This enables multiple builds to build once use many.

  • cache_dir – The path to the local/on-disk cache.

  • max_cache_size – Set the maximum size of the files stored in the cache. max_cache_size should be a number followed by an optional suffix: k, M, G, T (decimal), Ki, Mi, Gi or Ti (binary).

  • sloppiness – This option makes it possible to tell ccache to relax some checks in order to increase the hit rate. The value should be a comma-separated string with one or several of the following values.

  • enable_windows_ci – This option allows ccache to be used on CI, default to “false”. NOTE: This should be “false” on any projects that require PDB support on Windows.

cache_dir: Path#
enable_windows_ci: bool = False#
max_cache_size: str#
remote_storage: str#
reshare: bool#
sloppiness: str = 'pch_defines,time_macros,include_file_mtime,include_file_ctime'#
omni.repo.build.distributed_build.linbuild_version_check(linbuild_path: Path) bool#

Check the linbuild version and determine if it meets our minimum value.

Parameters:

linbuild_path – A pathlib.Path that points at the local repository linbuild.sh script.

Returns:

A bool indicating if the found version of linbuild meets our minimum requirement.

omni.repo.build.distributed_build.write_ccache_conf(
config: CCacheConfig,
)#

Write out a ccache.conf file within the ccache directory. This directory is mapped into the linbuild container.

Parameters:

config – a populated CCacheConfig with values pulled from repo.toml