Skip to content

Commit b7f2483

Browse files
getdeps must hash patches referenced by the manifest file
If we don’t include patches in the hash then we won’t rebuild the dependency when the patch changes.
1 parent 238ca3f commit b7f2483

File tree

1 file changed

+10
-0
lines changed
  • build/fbcode_builder/getdeps

1 file changed

+10
-0
lines changed

build/fbcode_builder/getdeps/load.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,16 @@ def _compute_project_hash(self, manifest) -> str:
315315

316316
manifest.update_hash(hasher, ctx)
317317

318+
# If a patchfile is specified, include its contents in the hash
319+
patchfile = manifest.get("build", "patchfile", ctx=ctx)
320+
if patchfile:
321+
patchfile_path = os.path.join(
322+
self.build_opts.fbcode_builder_dir, "patches", patchfile
323+
)
324+
if os.path.exists(patchfile_path):
325+
with open(patchfile_path, "rb") as f:
326+
hasher.update(f.read())
327+
318328
dep_list = manifest.get_dependencies(ctx)
319329
for dep in dep_list:
320330
dep_manifest = self.load_manifest(dep)

0 commit comments

Comments
 (0)