Files
swift-mirror/test/ParseableInterface/ModuleCache/Inputs/check-is-forwarding-module.py
Harlan Haskins 366bbf48b9 [ParseableInterface] Add ‘forwarding modules’
A ‘forwarding module’ is a YAML file that’s meant to stand in for a .swiftmodule file and provide an up-to-date description of its dependencies, always using modification times.

When a ‘prebuilt module’ is first loaded, we verify that it’s up-to-date by hashing all of its dependencies. Since this is orders of magnitude slower than reading mtimes, we’ll install a `forwarding module` containing the mtimes of the now-validated dependencies.
2019-03-07 11:36:15 -08:00

8 lines
231 B
Python

import sys
with open(sys.argv[1], 'r') as yaml_file:
# Forwarding files are YAML files that start with '---'
if yaml_file.read(3) != '---':
print("swiftmodule '%s' is not a forwarding module!")
sys.exit(1)