MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / sanity_is_correct

Function sanity_is_correct

tools/shared.py:410–424  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

408 sanity_file = cache.get_path('sanity.txt')
409
410 def sanity_is_correct():
411 sanity_data = None
412 # We can't simply check for the existence of sanity_file and then read from
413 # it here because we don't hold the cache lock yet and some other process
414 # could clear the cache between checking for, and reading from, the file.
415 with contextlib.suppress(Exception):
416 sanity_data = utils.read_file(sanity_file)
417 if sanity_data == expected:
418 logger.debug(f'sanity file up-to-date: {sanity_file}')
419 # Even if the sanity file is up-to-date we still run the checks
420 # when force is set.
421 if force:
422 perform_sanity_checks(quiet)
423 return True # all is well
424 return False
425
426 if sanity_is_correct():
427 # Early return without taking the cache lock

Callers 1

check_sanityFunction · 0.85

Calls 1

perform_sanity_checksFunction · 0.85

Tested by

no test coverage detected