Skip to content

Commit

Permalink
Merge pull request cupy#8930 from chainer-ci/bp-8927-v13-fix-cache-ke…
Browse files Browse the repository at this point in the history
…y-calc

[backport] Use relative path of header files to generate cache key
  • Loading branch information
kmaehashi authored Feb 7, 2025
2 parents 9b167f0 + 9f3e34f commit 83f3ccc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion install/cupy_builder/_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 83f3ccc

Please sign in to comment.