From f05e95c88a5a37747830c6c3ac4958a6261f8443 Mon Sep 17 00:00:00 2001 From: Hubert Hesse Date: Sat, 12 Nov 2016 17:53:35 +0100 Subject: [PATCH] Switch file hashing to xxhash Change-Id: I7104c68d9f3023e55ae9ce5137742e31e6356f1a --- README.asciidoc | 8 ++++++++ appveyor.yml | 3 +++ clcache.py | 6 +++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index a7223f8d..edec0c15 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -21,6 +21,14 @@ Installation Python 3.3+ is required. +Install dependencies +^^^^^^^^^^^^^^^^^^^^ + +clcache uses https://pypi.python.org/pypi/xxhash[xxhash] for file hashing. +Install it via: + + pip install xxhash + Installation via exe ^^^^^^^^^^^^^^^^^^^^ diff --git a/appveyor.yml b/appveyor.yml index f18f19b5..f5402d36 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,6 +42,9 @@ install: - pip install codecov - coverage --version + # Install xxhash python bindings + - pip install xxhash + build_script: - python clcache.py --help - python clcache.py -s diff --git a/clcache.py b/clcache.py index fe117214..666762d2 100644 --- a/clcache.py +++ b/clcache.py @@ -13,7 +13,6 @@ import codecs import contextlib import errno -import hashlib import json import multiprocessing import os @@ -21,11 +20,12 @@ import signal import subprocess import sys +import xxhash from tempfile import TemporaryFile VERSION = "3.3.1-dev" -HashAlgorithm = hashlib.md5 +HashAlgorithm = xxhash.xxh64 # try to use os.scandir or scandir.scandir # fall back to os.listdir if not found @@ -192,7 +192,7 @@ class ManifestRepository(object): # invalidation, such that a manifest that was stored using the old format is not # interpreted using the new format. Instead the old file will not be touched # again due to a new manifest hash and is cleaned away after some time. - MANIFEST_FILE_FORMAT_VERSION = 6 + MANIFEST_FILE_FORMAT_VERSION = 7 def __init__(self, manifestsRootDir): self._manifestsRootDir = manifestsRootDir