(meta: CacheMeta, manager: BuildManager, meta_file: str)
| 2406 | |
| 2407 | |
| 2408 | def write_cache_meta(meta: CacheMeta, manager: BuildManager, meta_file: str) -> None: |
| 2409 | # Write meta cache file |
| 2410 | metastore = manager.metastore |
| 2411 | if manager.options.fixed_format_cache: |
| 2412 | data_io = WriteBuffer() |
| 2413 | meta.write(data_io) |
| 2414 | # Prefix with both low- and high-level cache format versions for future validation. |
| 2415 | # TODO: switch to something like librt.internal.write_byte() if this is slow. |
| 2416 | meta_bytes = bytes([cache_version(), CACHE_VERSION]) + data_io.getvalue() |
| 2417 | else: |
| 2418 | meta_dict = meta.serialize() |
| 2419 | meta_bytes = json_dumps(meta_dict, manager.options.debug_cache) |
| 2420 | if not metastore.write(meta_file, meta_bytes): |
| 2421 | # Most likely the error is the replace() call |
| 2422 | # (see https://github.com/python/mypy/issues/3215). |
| 2423 | # The next run will simply find the cache entry out of date. |
| 2424 | manager.log(f"Error writing cache meta file {meta_file}") |
| 2425 | |
| 2426 | |
| 2427 | def write_cache_meta_ex(meta_file: str, meta_ex: CacheMetaEx, manager: BuildManager) -> None: |
no test coverage detected
searching dependent graphs…