Skip to content

Commit 0c0f822

Browse files
benoit-nexthopmeta-codesync[bot]
authored andcommitted
getdeps must hash patches referenced by the manifest file
Summary: **Pre-submission checklist** - [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install` - [x] `pre-commit run` If we don’t include patches in the hash then we won’t rebuild the dependency when the patch changes. X-link: facebook/fboss#702 Reviewed By: bigfootjon Differential Revision: D90142693 Pulled By: KevinYakar fbshipit-source-id: a49e4d04cbcd5490d9280116b8bb2b2457580d43
1 parent 4c3596a commit 0c0f822

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)