From 9f3e34ff3545b2070feafd063d1c7898497f799a Mon Sep 17 00:00:00 2001 From: Akifumi Imanishi Date: Fri, 7 Feb 2025 10:15:37 +0900 Subject: [PATCH] Merge pull request #8927 from kmaehashi/fix-cache-key-calc Use relative path of header files to generate cache key --- install/cupy_builder/_context.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/cupy_builder/_context.py b/install/cupy_builder/_context.py index 0c12fabbf15..832a63dadaa 100644 --- a/install/cupy_builder/_context.py +++ b/install/cupy_builder/_context.py @@ -66,7 +66,8 @@ def __init__( hasher = hashlib.sha1(usedforsecurity=False) for include_file in include_files: with open(include_file, 'rb') as f: - hasher.update(include_file.encode()) + relpath = os.path.relpath(include_file, source_root) + hasher.update(relpath.encode()) hasher.update(f.read()) hasher.update(b'\x00') cache_key = hasher.hexdigest()