diff --git a/build/fbcode_builder/getdeps/load.py b/build/fbcode_builder/getdeps/load.py index 44dd2f898d..a3d30fae61 100644 --- a/build/fbcode_builder/getdeps/load.py +++ b/build/fbcode_builder/getdeps/load.py @@ -260,6 +260,8 @@ class ManifestLoader(object): No caching of the computation is performed, which is theoretically wasteful but the computation is fast enough that it is not required to cache across multiple invocations. """ + ctx = self.ctx_gen.get_context(manifest.name) + hasher = hashlib.sha256() # Some environmental and configuration things matter env = {} @@ -272,6 +274,8 @@ class ManifestLoader(object): env[name] = os.environ.get(name) for tool in ["cc", "c++", "gcc", "g++", "clang", "clang++"]: env["tool-%s" % tool] = path_search(os.environ, tool) + for name in manifest.get_section_as_args("depends.environment", ctx): + env[name] = os.environ.get(name) fetcher = self.create_fetcher(manifest) env["fetcher.hash"] = fetcher.hash() @@ -282,7 +286,6 @@ class ManifestLoader(object): if value is not None: hasher.update(value.encode("utf-8")) - ctx = self.ctx_gen.get_context(manifest.name) manifest.update_hash(hasher, ctx) dep_list = sorted(manifest.get_section_as_dict("dependencies", ctx).keys()) diff --git a/build/fbcode_builder/getdeps/manifest.py b/build/fbcode_builder/getdeps/manifest.py index 2a160f96be..c11b0270e3 100644 --- a/build/fbcode_builder/getdeps/manifest.py +++ b/build/fbcode_builder/getdeps/manifest.py @@ -49,6 +49,7 @@ SCHEMA = { }, }, "dependencies": {"optional_section": True, "allow_values": False}, + "depends.environment": {"optional_section": True}, "git": { "optional_section": True, "fields": {"repo_url": REQUIRED, "rev": OPTIONAL, "depth": OPTIONAL}, diff --git a/build/fbcode_builder/manifests/watchman b/build/fbcode_builder/manifests/watchman index 7ff6cea8a6..7e6bf5706e 100644 --- a/build/fbcode_builder/manifests/watchman +++ b/build/fbcode_builder/manifests/watchman @@ -34,3 +34,6 @@ ENABLE_EDEN_SUPPORT=ON WATCHMAN_STATE_DIR=/opt/facebook/watchman/var/run/watchman # tell cmake not to try to create /opt/facebook/... INSTALL_WATCHMAN_STATE_DIR=OFF + +[depends.environment] +WATCHMAN_VERSION_OVERRIDE