Bug 1341213 - Make the index path for toolchain jobs independent of the source path. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 16 Feb 2017 17:33:35 +0900
changeset 487253 ba67e59d04cc6d81b5ed334af12e8ad4be62b694
parent 487245 c749de1036a3b751a2174b160861a2831e23467b
child 546419 1cdd31dfacf2281ba5c4e57ec7c9045d6230d0e4
push id46179
push userbmo:mh+mozilla@glandium.org
push dateTue, 21 Feb 2017 07:35:15 +0000
reviewersdustin
bugs1341213
milestone54.0a1
Bug 1341213 - Make the index path for toolchain jobs independent of the source path. r?dustin When I refactored hash_paths to add caching, I mixed things up such that for each file, we end up hashing: (u'$sha256sum', u'$topsrcdir/$relpath') $relpath when the intent was to hash: $sha256sum $relpath This change fixes it, such that now the index paths are independent of the source path, as originally intended.
taskcluster/taskgraph/util/hash.py
--- a/taskcluster/taskgraph/util/hash.py
+++ b/taskcluster/taskgraph/util/hash.py
@@ -7,18 +7,17 @@ from mozbuild.util import memoize
 from mozpack.files import FileFinder
 import mozpack.path as mozpath
 import hashlib
 
 
 @memoize
 def _hash_path(path):
     with open(path) as fh:
-        return (hashlib.sha256(fh.read()).hexdigest(),
-                mozpath.normsep(path))
+        return hashlib.sha256(fh.read()).hexdigest()
 
 
 def hash_paths(base_path, patterns):
     """
     Give a list of path patterns, return a digest of the contents of all
     the corresponding files, similarly to git tree objects or mercurial
     manifests.