#NEWLINE# @ classmethod #NEWLINE# def register_options( cls , register ) : #NEWLINE# #INDENT# super ( CacheSetup , cls ) . register_options ( register ) #NEWLINE# default_cache = [ os . path . join ( get_buildroot ( ) , '.cache' ) ] #NEWLINE# register ( '--read' , type = bool , default = True , help = 'Read build artifacts from cache, if available.' ) #NEWLINE# register ( '--write' , type = bool , default = True , help = 'Write build artifacts to cache, if available.' ) #NEWLINE# register ( '--overwrite' , advanced = True , type = bool , help = 'If writing build artifacts to cache, overwrite existing artifacts instead of skipping them.' ) #NEWLINE# register ( '--resolver' , advanced = True , choices = [ 'none' , 'rest' ] , default = 'none' , help = 'Select which resolver strategy to use for discovering URIs that access artifact caches. none: use URIs from static config options, i.e. --read-from, --write-to. rest: look up URIs by querying a RESTful URL, which is a remote address from --read-from, --write-to.' ) #NEWLINE# register ( '--read-from' , advanced = True , type = list , default = default_cache , help = "The URIs of artifact caches to read directly from. Each entry is a URL of a RESTful cache, a path of a filesystem cache, or a pipe-separated list of alternate caches to choose from. This list is also used as input to the resolver. When resolver is 'none' list is used as is." ) #NEWLINE# register ( '--write-to' , advanced = True , type = list , default = default_cache , help = "The URIs of artifact caches to write directly to. Each entry is a URL ofa RESTful cache, a path of a filesystem cache, or a pipe-separated list of alternate caches to choose from. This list is also used as input to the resolver. When resolver is 'none' list is used as is." ) #NEWLINE# register ( '--compression-level' , advanced = True , type = int , default = 5 , help = 'The gzip compression level (0-9) for created artifacts.' ) #NEWLINE# register ( '--max-entries-per-target' , advanced = True , type = int , default = 8 , help = 'Maximum number of old cache files to keep per task target pair' ) #NEWLINE# register ( '--pinger-timeout' , advanced = True , type = float , default = 0.5 , help = 'number of seconds before pinger times out' ) #NEWLINE# register ( '--pinger-tries' , advanced = True , type = int , default = 2 , help = 'number of times pinger tries a cache' )