Files
wasmtime/lib/codegen/meta-python/gen_build_deps.py
Nathan Froyd 363eea6960 avoid directories for cargo build dependencies
We are facing peculiar Windows-only regressions in build times in
https://bugzilla.mozilla.org/show_bug.cgi?id=1506511 and while the build
times might just be Windows being slow, putting directories in
`rerun-if-changed` might also be causing problems.  The build only
depends on the files, anyway, so let's just say that.
2019-01-22 13:20:55 -08:00

33 lines
916 B
Python

"""
Generate build dependencies for Cargo.
The `build.py` script is invoked by cargo when building lib/codegen to
generate Rust code from the instruction descriptions. Cargo needs to know when
it is necessary to rerun the build script.
If the build script outputs lines of the form:
cargo:rerun-if-changed=/path/to/file
cargo will rerun the build script when those files have changed since the last
build.
"""
from __future__ import absolute_import, print_function
import os
from os.path import dirname, abspath, join
try:
from typing import Iterable # noqa
except ImportError:
pass
def generate():
# type: () -> None
print("Dependencies from meta language directory:")
meta = dirname(abspath(__file__))
for (dirpath, _, filenames) in os.walk(meta):
for f in filenames:
if f.endswith('.py'):
print("cargo:rerun-if-changed=" + join(dirpath, f))