diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index 1564b0f1f..80f8812b1 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -156,7 +156,7 @@ class ShowInstDirCmd(SubCmd): for m in manifests: ctx = ctx_gen.get_context(m.name) fetcher = m.create_fetcher(opts, ctx) - dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx) + dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx_gen) inst_dir = dirs["inst_dir"] print(inst_dir) @@ -236,7 +236,7 @@ class BuildCmd(SubCmd): if args.clean: fetcher.clean() - dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx) + dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx_gen) build_dir = dirs["build_dir"] inst_dir = dirs["inst_dir"] @@ -331,7 +331,7 @@ class FixupDeps(SubCmd): ctx = ctx_gen.get_context(m.name) fetcher = m.create_fetcher(opts, ctx) - dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx) + dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx_gen) inst_dir = dirs["inst_dir"] install_dirs.append(inst_dir) @@ -388,7 +388,7 @@ class TestCmd(SubCmd): ctx = ctx_gen.get_context(m.name) fetcher = m.create_fetcher(opts, ctx) - dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx) + dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx_gen) build_dir = dirs["build_dir"] inst_dir = dirs["inst_dir"] diff --git a/build/fbcode_builder/getdeps/buildopts.py b/build/fbcode_builder/getdeps/buildopts.py index 7e842d36e..d0e2b6339 100644 --- a/build/fbcode_builder/getdeps/buildopts.py +++ b/build/fbcode_builder/getdeps/buildopts.py @@ -148,7 +148,7 @@ class BuildOptions(object): } ) - def _compute_hash(self, hash_by_name, manifest, manifests_by_name, ctx): + def _compute_hash(self, hash_by_name, manifest, manifests_by_name, ctx_gen): """ This recursive function computes a hash for a given manifest. The hash takes into account some environmental factors on the host machine and includes the hashes of its dependencies. @@ -173,6 +173,7 @@ class BuildOptions(object): for tool in ["cc", "c++", "gcc", "g++", "clang", "clang++"]: env["tool-%s" % tool] = path_search(os.environ, tool) + ctx = ctx_gen.get_context(manifest.name) fetcher = manifest.create_fetcher(self, ctx) env["fetcher.hash"] = fetcher.hash() @@ -187,7 +188,7 @@ class BuildOptions(object): dep_list = sorted(manifest.get_section_as_dict("dependencies", ctx).keys()) for dep in dep_list: dep_hash = self._compute_hash( - hash_by_name, manifests_by_name[dep], manifests_by_name, ctx + hash_by_name, manifests_by_name[dep], manifests_by_name, ctx_gen ) hasher.update(dep_hash.encode("utf-8")) @@ -203,9 +204,9 @@ class BuildOptions(object): return h - def compute_dirs(self, manifest, fetcher, manifests_by_name, ctx): + def compute_dirs(self, manifest, fetcher, manifests_by_name, ctx_gen): hash_by_name = {} - hash = self._compute_hash(hash_by_name, manifest, manifests_by_name, ctx) + hash = self._compute_hash(hash_by_name, manifest, manifests_by_name, ctx_gen) if manifest.is_first_party_project(): directory = manifest.name